From 2046a6546c8ed62b9a7b33305b6201458f2f8291 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Wed, 12 Mar 2014 15:38:28 +0000 Subject: Allow user info to be retrieved without groups Some parts of dokuwiki (e.g. recent changes, old revisions) can requests lots of user info (to provide editor names) without requiring any group information. This change also implements caching of user info by authmysql & authpgsql plugins to avoid repeated querying of the DB to retrieve the same user information. --- lib/plugins/authpgsql/auth.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/auth.php b/lib/plugins/authpgsql/auth.php index e51b39858..99f3ed443 100644 --- a/lib/plugins/authpgsql/auth.php +++ b/lib/plugins/authpgsql/auth.php @@ -160,7 +160,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { $result = $this->_queryDB($sql); foreach($result as $user) - if(($info = $this->_getUserInfo($user['user']))) + if(($info = $this->_getCachedUserInfo($user['user']))) $out[$user['user']] = $info; $this->_unlockTables(); @@ -212,7 +212,10 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { $sql = str_replace('%{user}', addslashes($user), $sql); $sql = str_replace('%{gid}', addslashes($gid), $sql); $sql = str_replace('%{group}', addslashes($group), $sql); - if($this->_modifyDB($sql) !== false) return true; + if($this->_modifyDB($sql) !== false) { + $this->_flushUserInfoCache($user); + return true; + } if($newgroup) { // remove previously created group on error $sql = str_replace('%{gid}', addslashes($gid), $this->conf['delGroup']); @@ -267,6 +270,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { } if($gid !== false){ + $this->_flushUserInfoCache($user); return true; } else { /* remove the new user and all group relations if a group can't -- cgit v1.2.3 From 2c917972fa1601d7765e56a079884f4a24a69a7e Mon Sep 17 00:00:00 2001 From: Mohamad Mehdi Habibi Date: Wed, 10 Sep 2014 09:50:56 +0200 Subject: translation update --- lib/plugins/authpgsql/lang/fa/settings.php | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/plugins/authpgsql/lang/fa/settings.php (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/lang/fa/settings.php b/lib/plugins/authpgsql/lang/fa/settings.php new file mode 100644 index 000000000..813493967 --- /dev/null +++ b/lib/plugins/authpgsql/lang/fa/settings.php @@ -0,0 +1,8 @@ + + */ +$lang['database'] = 'پایگاه داده مورد استفاده'; -- cgit v1.2.3 From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 03:34:17 +0200 Subject: scrutinizer documentations issues --- lib/plugins/authpgsql/auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/auth.php b/lib/plugins/authpgsql/auth.php index 99f3ed443..4f5e3346f 100644 --- a/lib/plugins/authpgsql/auth.php +++ b/lib/plugins/authpgsql/auth.php @@ -265,7 +265,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { if($uid) { foreach($grps as $group) { - $gid = $this->_addUserToGroup($user, $group, 1); + $gid = $this->_addUserToGroup($user, $group, true); if($gid === false) break; } -- cgit v1.2.3 From 07a1dd10b8b570789d74054892a20c952ee99e54 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Mon, 29 Sep 2014 14:10:08 +0100 Subject: postgresql auth plugin: correct function name --- lib/plugins/authpgsql/auth.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/auth.php b/lib/plugins/authpgsql/auth.php index 99f3ed443..de41598e0 100644 --- a/lib/plugins/authpgsql/auth.php +++ b/lib/plugins/authpgsql/auth.php @@ -159,9 +159,11 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { if($first) $sql .= " OFFSET $first"; $result = $this->_queryDB($sql); - foreach($result as $user) - if(($info = $this->_getCachedUserInfo($user['user']))) + foreach($result as $user) { + if(($info = $this->_getUserInfo($user['user']))) { $out[$user['user']] = $info; + } + } $this->_unlockTables(); $this->_closeDB(); -- cgit v1.2.3 From 253d4b48ec708eb42033862dc15c8576f44a48ed Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 15:32:05 +0200 Subject: more PHPDocs, unused var, small bit code reformatting --- lib/plugins/authpgsql/auth.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/auth.php b/lib/plugins/authpgsql/auth.php index 4f5e3346f..06590fedd 100644 --- a/lib/plugins/authpgsql/auth.php +++ b/lib/plugins/authpgsql/auth.php @@ -104,7 +104,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { * * @author Matthias Grimm * - * @param array $keys + * @param string[] $keys * @param bool $wop * @return bool */ @@ -340,7 +340,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { * @author Matthias Grimm * * @param string $query SQL string that contains the query - * @return array the result table + * @return array|false the result table */ protected function _queryDB($query) { $resultarray = array(); @@ -363,6 +363,9 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { * MySQL one because it does NOT return the last insertID * * @author Andreas Gohr + * + * @param string $query + * @return bool */ protected function _modifyDB($query) { if($this->dbcon) { @@ -396,6 +399,8 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { * Commit a transaction * * @author Matthias Grimm + * + * @return bool */ protected function _unlockTables() { if($this->dbcon) { -- cgit v1.2.3 From a1298aeaa8cf1dc3bba3fb7ecadb0d989afc42cf Mon Sep 17 00:00:00 2001 From: Aleksandr Selivanov Date: Sat, 18 Oct 2014 18:25:58 +0200 Subject: translation update --- lib/plugins/authpgsql/lang/ru/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/lang/ru/settings.php b/lib/plugins/authpgsql/lang/ru/settings.php index 65cbce8df..668ba4ef6 100644 --- a/lib/plugins/authpgsql/lang/ru/settings.php +++ b/lib/plugins/authpgsql/lang/ru/settings.php @@ -10,7 +10,7 @@ $lang['server'] = 'Ваш PostgreSQL-сервер'; $lang['port'] = 'Порт вашего PostgreSQL-сервера'; $lang['user'] = 'Имя пользователя PostgreSQL'; -$lang['password'] = 'Пароль для указанного пользователя.'; +$lang['password'] = 'Пароль для указанного пользователя'; $lang['database'] = 'Имя базы данных'; $lang['debug'] = 'Отображать дополнительную отладочную информацию'; $lang['checkPass'] = 'Выражение SQL, осуществляющее проверку пароля'; -- cgit v1.2.3 From 4b5834378cc09b182f926aa21a58b50842719f77 Mon Sep 17 00:00:00 2001 From: Torpedo Date: Tue, 9 Dec 2014 23:16:25 +0100 Subject: translation update --- lib/plugins/authpgsql/lang/it/settings.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/lang/it/settings.php b/lib/plugins/authpgsql/lang/it/settings.php index baf40a468..e8a40dcb2 100644 --- a/lib/plugins/authpgsql/lang/it/settings.php +++ b/lib/plugins/authpgsql/lang/it/settings.php @@ -4,8 +4,10 @@ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * * @author Francesco + * @author Torpedo */ $lang['server'] = 'Il tuo server PostgreSQL '; $lang['port'] = 'La porta del tuo server PostgreSQL '; $lang['user'] = 'Lo username PostgreSQL'; $lang['database'] = 'Database da usare'; +$lang['getUsers'] = 'Dichiarazione SQL per elencare tutti gli utenti'; -- cgit v1.2.3 From d52dfa3a1a992c5cbc5517cc2fc9e947d3a54ee4 Mon Sep 17 00:00:00 2001 From: Jaroslav Lichtblau Date: Sat, 13 Dec 2014 12:56:08 +0100 Subject: translation update --- lib/plugins/authpgsql/lang/cs/settings.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/lang/cs/settings.php b/lib/plugins/authpgsql/lang/cs/settings.php index aec7eecf1..ad135e241 100644 --- a/lib/plugins/authpgsql/lang/cs/settings.php +++ b/lib/plugins/authpgsql/lang/cs/settings.php @@ -4,6 +4,7 @@ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * * @author mkucera66@seznam.cz + * @author Jaroslav Lichtblau */ $lang['server'] = 'Váš server PostgreSQL'; $lang['port'] = 'Port vašeho serveru PostgreSQL'; @@ -18,7 +19,7 @@ $lang['getGroups'] = 'Příkaz SQL pro získání členství uživat $lang['getUsers'] = 'Příkaz SQL pro seznam všech uživatelů'; $lang['FilterLogin'] = 'Příkaz SQL pro filtrování uživatelů podle přihlašovacího jména'; $lang['FilterName'] = 'Příkaz SQL pro filtrování uživatelů podle celého jména'; -$lang['FilterEmail'] = 'Příkaz SQL pro filtrování uživatelů podle adres emailů'; +$lang['FilterEmail'] = 'Příkaz SQL pro filtrování uživatelů podle adres e-mailů'; $lang['FilterGroup'] = 'Příkaz SQL pro filtrování uživatelů podle členství ve skupinách'; $lang['SortOrder'] = 'Příkaz SQL pro řazení uživatelů'; $lang['addUser'] = 'Příkaz SQL pro řazení uživatelů'; @@ -31,7 +32,7 @@ $lang['delUserRefs'] = 'Příkaz SQL pro odstranění členství uživ $lang['updateUser'] = 'Příkaz SQL pro aktualizaci uživatelského profilu'; $lang['UpdateLogin'] = 'Klauzule pro aktualizaci přihlačovacího jména uživatele'; $lang['UpdatePass'] = 'Klauzule pro aktualizaci hesla uživatele'; -$lang['UpdateEmail'] = 'Klauzule pro aktualizaci emailové adresy uživatele'; +$lang['UpdateEmail'] = 'Klauzule pro aktualizaci e-mailové adresy uživatele'; $lang['UpdateName'] = 'Klauzule pro aktualizaci celého jména uživatele'; $lang['UpdateTarget'] = 'Omezující klauzule pro identifikaci uživatele při aktualizaci'; $lang['delUserGroup'] = 'Příkaz SQL pro zrušení členství uživatele v dané skupině'; -- cgit v1.2.3 From e88b0b78dca1024132a36f217b59c9e73a9cc338 Mon Sep 17 00:00:00 2001 From: Vitaly Filatenko Date: Mon, 15 Dec 2014 22:36:37 +0100 Subject: translation update --- lib/plugins/authpgsql/lang/ru/settings.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/plugins/authpgsql') diff --git a/lib/plugins/authpgsql/lang/ru/settings.php b/lib/plugins/authpgsql/lang/ru/settings.php index 668ba4ef6..416ea0ec9 100644 --- a/lib/plugins/authpgsql/lang/ru/settings.php +++ b/lib/plugins/authpgsql/lang/ru/settings.php @@ -6,6 +6,7 @@ * @author Ivan I. Udovichenko (sendtome@mymailbox.pp.ua) * @author Aleksandr Selivanov * @author Aleksandr Selivanov + * @author Vitaly Filatenko */ $lang['server'] = 'Ваш PostgreSQL-сервер'; $lang['port'] = 'Порт вашего PostgreSQL-сервера'; @@ -30,5 +31,8 @@ $lang['getUserID'] = 'Выражение SQL, обеспечиваю $lang['delUser'] = 'Выражение SQL, осуществляющее удаление пользователя'; $lang['delUserRefs'] = 'Выражение SQL, осуществляющее удаление пользователя из всех группы'; $lang['updateUser'] = 'Выражение SQL, осуществляющее обновление профиля пользователя'; +$lang['UpdateLogin'] = 'Измените условие для обновления логина'; +$lang['UpdatePass'] = 'Измените условие для обновления пароля'; +$lang['UpdateEmail'] = 'Измените условие для обновления email'; $lang['delUserGroup'] = 'Выражение SQL, осуществляющее удаление пользователя из указанной группы'; $lang['getGroupID'] = 'Выражение SQL, обеспечивающее получение первичного ключа указанной группы'; -- cgit v1.2.3