Changeset 11355


Ignore:
Timestamp:
06/14/11 10:24:48 (8 years ago)
Author:
plg
Message:

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
  • branches/2.2/include/functions_user.inc.php

    r9923 r11355  
    293293  $row = pwg_db_fetch_assoc(pwg_query($query)); 
    294294 
     295  // retrieve additional user data ? 
     296  if ($conf['external_authentification']) 
     297  { 
     298    $query = ' 
     299SELECT 
     300    COUNT(1) AS counter 
     301  FROM '.USER_INFOS_TABLE.' AS ui 
     302    LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id 
     303    LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme 
     304  WHERE ui.user_id = '.$user_id.' 
     305  GROUP BY ui.user_id 
     306;'; 
     307    list($counter) = pwg_db_fetch_row(pwg_query($query)); 
     308    if ($counter != 1) 
     309    { 
     310      create_user_infos($user_id); 
     311    } 
     312  } 
     313 
    295314  // retrieve user info 
    296315  $query = ' 
     
    307326  $result = pwg_query($query); 
    308327  $user_infos_row = pwg_db_fetch_assoc($result); 
    309  
    310   // retrieve additional user data ? 
    311   if ($conf['external_authentification']) 
    312   { 
    313     $query = ' 
    314 SELECT 
    315     COUNT(1) AS counter, 
    316   FROM '.USER_INFOS_TABLE.' AS ui 
    317     LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id 
    318     LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme 
    319   WHERE ui.user_id = '.$user_id.' 
    320   GROUP BY ui.user_id 
    321 ;'; 
    322     if (pwg_db_fetch_row(pwg_query($query))!=1) 
    323     { 
    324       create_user_infos($user_id); 
    325      
    326       $result = pwg_query($user_info_query); 
    327       $user_infos_row = pwg_db_fetch_assoc($result);       
    328     } 
    329   } 
    330328 
    331329  // then merge basic + additional user data 
Note: See TracChangeset for help on using the changeset viewer.