aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-06-09 20:26:47 +0000
committernikrou <nikrou@piwigo.org>2010-06-09 20:26:47 +0000
commita59d15b7b68e86b8d51b77b4b53e4f2e83b273a3 (patch)
tree249d1ba514079e709a0010087e2192e71bf9ec18 /include/functions_user.inc.php
parent54fc109f97284a40cba84b131fcc5948e503bbac (diff)
Fix bug 1722 : PosgtreSQL wants all fields in select to be in Group by clause
or agregate function Fix issue for lambda function (incorrect number of params) merge from trunk. git-svn-id: http://piwigo.org/svn/branches/2.1@6511 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_user.inc.php')
-rw-r--r--include/functions_user.inc.php30
1 files changed, 22 insertions, 8 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 3ba596633..aa35539d6 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -290,26 +290,40 @@ SELECT ';
$row = pwg_db_fetch_assoc(pwg_query($query));
- // retrieve additional user data
+ // retrieve user info
$query = '
SELECT
- COUNT(1) AS counter,
ui.*,
uc.*,
t.name AS theme_name
FROM '.USER_INFOS_TABLE.' AS ui
LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id
LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme
- WHERE ui.user_id = \''.$user_id.'\'
- GROUP BY ui.user_id
+ WHERE ui.user_id = '.$user_id.'
;';
+
$result = pwg_query($query);
$user_infos_row = pwg_db_fetch_assoc($result);
- if (!isset($user_infos_row['counter']) or 0 == $user_infos_row['counter']) {
- create_user_infos($user_id);
+
+ // retrieve additional user data ?
+ if ($conf['external_authentification'])
+ {
+ $query = '
+SELECT
+ COUNT(1) AS counter,
+ FROM '.USER_INFOS_TABLE.' AS ui
+ LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id
+ LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme
+ WHERE ui.user_id = '.$user_id.'
+ GROUP BY ui.user_id
+;';
+ if (pwg_db_fetch_row(pwg_query($query))!=1)
+ {
+ create_user_infos($user_id);
- $result = pwg_query($query);
- $user_infos_row = pwg_db_fetch_assoc($result);
+ $result = pwg_query($user_info_query);
+ $user_infos_row = pwg_db_fetch_assoc($result);
+ }
}
// then merge basic + additional user data