Dies ist eine alte Version des Dokuments!
External authentication from OC through Authpdo
OC9: SQL Statement to select the data of a single user
SELECT oc_users.uid AS 'id', oc_users.displayname AS 'name', oc_users.password AS 'pass', oc_preferences.configvalue AS 'mail' FROM oc_users INNER JOIN oc_preferences ON oc_users.uid=oc_preferences.userid WHERE oc_users.uid = 'admin' AND oc_preferences.configkey = 'email'
OC10: SQL Statement to select the data of a single user
SELECT oc_accounts.user_id as 'user', oc_accounts.display_name as 'name', oc_accounts.email as 'mail', substr(oc_authtoken.password, 3) as 'hash' FROM oc_accounts LEFT JOIN oc_authtoken ON oc_accounts.user_id=oc_authtoken.uid WHERE oc_accounts.user_id LIKE 'xxxx'
OC10: in PDO
SELECT "oc_accounts.user_id" as "user",
"oc_accounts.display_name" as "name",
"oc_accounts.email" as "mail",
"substr(oc_authtoken.password, 3)" as "hash"
FROM "oc_accounts" LEFT JOIN "oc_authtoken" ON "oc_accounts.user_id=oc_authtoken.uid"
WHERE "oc_accounts.user_id" LIKE :user