Changeset 11356


Ignore:
Timestamp:
Jun 14, 2011, 10:25:45 AM (9 years ago)
Author:
plg
Message:

merge r11355 from branch 2.2 to trunk

bug 2340 fixed: external authentication was broken, error in SQL syntax and wrong PHP variable name was used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_user.inc.php

    r10860 r11356  
    322322  $row = pwg_db_fetch_assoc(pwg_query($query));
    323323
     324  // retrieve additional user data ?
     325  if ($conf['external_authentification'])
     326  {
     327    $query = '
     328SELECT
     329    COUNT(1) AS counter
     330  FROM '.USER_INFOS_TABLE.' AS ui
     331    LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id
     332    LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme
     333  WHERE ui.user_id = '.$user_id.'
     334  GROUP BY ui.user_id
     335;';
     336    list($counter) = pwg_db_fetch_row(pwg_query($query));
     337    if ($counter != 1)
     338    {
     339      create_user_infos($user_id);
     340    }
     341  }
     342
    324343  // retrieve user info
    325344  $query = '
     
    336355  $result = pwg_query($query);
    337356  $user_infos_row = pwg_db_fetch_assoc($result);
    338 
    339   // retrieve additional user data ?
    340   if ($conf['external_authentification'])
    341   {
    342     $query = '
    343 SELECT
    344     COUNT(1) AS counter,
    345   FROM '.USER_INFOS_TABLE.' AS ui
    346     LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id
    347     LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme
    348   WHERE ui.user_id = '.$user_id.'
    349   GROUP BY ui.user_id
    350 ;';
    351     if (pwg_db_fetch_row(pwg_query($query))!=1)
    352     {
    353       create_user_infos($user_id);
    354    
    355       $result = pwg_query($user_info_query);
    356       $user_infos_row = pwg_db_fetch_assoc($result);     
    357     }
    358   }
    359357
    360358  // then merge basic + additional user data
Note: See TracChangeset for help on using the changeset viewer.