Changeset 27996


Ignore:
Timestamp:
Mar 28, 2014, 2:24:14 PM (6 years ago)
Author:
plg
Message:

bug 3065 fixed: avoid SQL errors with external authentication

Location:
branches/2.6
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/admin/group_list.php

    r26461 r27996  
    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
  • branches/2.6/admin/user_list_backend.php

    r27836 r27996  
    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;
  • branches/2.6/include/functions_mail.inc.php

    r26461 r27996  
    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.