Changeset 27997


Ignore:
Timestamp:
03/28/14 14:26:30 (5 years ago)
Author:
plg
Message:

merge r27996 from branch 2.6 to trunk

bug 3065 fixed: avoid SQL errors with external authentication

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/group_list.php

    r26461 r27997  
    395395{ 
    396396  $query = ' 
    397 SELECT username 
     397SELECT u.'. $conf['user_fields']['username'].' AS username 
    398398  FROM '.USERS_TABLE.' AS u 
    399399  INNER JOIN '.USER_GROUP_TABLE.' AS ug 
  • trunk/admin/user_list_backend.php

    r27837 r27997  
    3636 * you want to insert a non-database field (for example a counter or static image) 
    3737 */ 
    38 $aColumns = array('id', 'username', 'status', 'mail_address', 'recent_period', 'level', 'registration_date'); 
     38$aColumns = array( 
     39  $conf['user_fields']['id'], 
     40  $conf['user_fields']['username'], 
     41  'status', 
     42  $conf['user_fields']['email'], 
     43  'recent_period', 
     44  'level', 
     45  'registration_date' 
     46  ); 
     47 
    3948$aColumns = trigger_change('user_list_columns', $aColumns); 
    4049         
    4150/* Indexed column (used for fast and accurate table cardinality) */ 
    42 $sIndexColumn = "id"; 
     51$sIndexColumn = 'user_id'; 
    4352         
    4453/* DB table to use */ 
    45 $sTable = USERS_TABLE.' INNER JOIN '.USER_INFOS_TABLE.' AS ui ON id = ui.user_id'; 
     54$sTable = USERS_TABLE.' INNER JOIN '.USER_INFOS_TABLE.' AS ui ON '.$conf['user_fields']['id'].' = ui.user_id'; 
    4655 
    4756/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
     
    163172while ( $aRow = pwg_db_fetch_array( $rResult ) ) 
    164173{ 
    165   $user_ids[] = $aRow['id']; 
     174  $user_ids[] = $aRow[ $conf['user_fields']['id'] ]; 
    166175   
    167176  $row = array(); 
     
    179188    { 
    180189      /* General output */ 
    181       $row[] = $aRow[ $aColumns[$i] ]; 
    182     } 
     190      $colname = $aColumns[$i]; 
     191      foreach ($conf['user_fields'] as $real_name => $alias) 
     192      { 
     193        if ($aColumns[$i] == $real_name) 
     194        { 
     195          $colname = $alias; 
     196        } 
     197      } 
     198       
     199      $row[] = $aRow[$colname]; 
     200    } 
     201 
    183202  } 
    184203  $output['aaData'][] = $row; 
  • trunk/include/functions_mail.inc.php

    r27403 r27997  
    441441    AND u.'.$conf['user_fields']['email'].' IS NOT NULL 
    442442    AND i.user_id <> '.$user['id'].' 
    443   ORDER BY username 
     443  ORDER BY name 
    444444;'; 
    445445  $admins = array_from_query($query); 
Note: See TracChangeset for help on using the changeset viewer.