includes/sessions.php
changeset 371 dc6026376919
parent 370 b251818286b1
child 372 5bd429428101
equal deleted inserted replaced
370:b251818286b1 371:dc6026376919
  1199     }
  1199     }
  1200     $keyhash = md5($key);
  1200     $keyhash = md5($key);
  1201     $salt = $db->escape($keydata[3]);
  1201     $salt = $db->escape($keydata[3]);
  1202     // using a normal call to $db->sql_query to avoid failing on errors here
  1202     // using a normal call to $db->sql_query to avoid failing on errors here
  1203     $query = $db->sql_query('SELECT u.user_id AS uid,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,' . "\n"
  1203     $query = $db->sql_query('SELECT u.user_id AS uid,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,' . "\n"
  1204                              . '    u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,COUNT(p.message_id) AS num_pms,' . "\n"
  1204                              . '    u.reg_time,u.account_active,u.activation_key,u.user_lang,k.source_ip,k.time,k.auth_level,COUNT(p.message_id) AS num_pms,' . "\n"
  1205                              . '    x.* FROM '.table_prefix.'session_keys AS k' . "\n"
  1205                              . '    x.* FROM '.table_prefix.'session_keys AS k' . "\n"
  1206                              . '  LEFT JOIN '.table_prefix.'users AS u' . "\n"
  1206                              . '  LEFT JOIN '.table_prefix.'users AS u' . "\n"
  1207                              . '    ON ( u.user_id=k.user_id )' . "\n"
  1207                              . '    ON ( u.user_id=k.user_id )' . "\n"
  1208                              . '  LEFT JOIN '.table_prefix.'users_extra AS x' . "\n"
  1208                              . '  LEFT JOIN '.table_prefix.'users_extra AS x' . "\n"
  1209                              . '    ON ( u.user_id=x.user_id OR x.user_id IS NULL )' . "\n"
  1209                              . '    ON ( u.user_id=x.user_id OR x.user_id IS NULL )' . "\n"
  1210                              . '  LEFT JOIN '.table_prefix.'privmsgs AS p' . "\n"
  1210                              . '  LEFT JOIN '.table_prefix.'privmsgs AS p' . "\n"
  1211                              . '    ON ( p.message_to=u.username AND p.message_read=0 )' . "\n"
  1211                              . '    ON ( p.message_to=u.username AND p.message_read=0 )' . "\n"
  1212                              . '  WHERE k.session_key=\''.$keyhash.'\'' . "\n"
  1212                              . '  WHERE k.session_key=\''.$keyhash.'\'' . "\n"
  1213                              . '    AND k.salt=\''.$salt.'\'' . "\n"
  1213                              . '    AND k.salt=\''.$salt.'\'' . "\n"
  1214                              . '  GROUP BY u.user_id,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,x.user_id, x.user_aim, x.user_yahoo, x.user_msn, x.user_xmpp, x.user_homepage, x.user_location, x.user_job, x.user_hobbies, x.email_public;');
  1214                              . '  GROUP BY u.user_id,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,u.user_lang,k.source_ip,k.time,k.auth_level,x.user_id, x.user_aim, x.user_yahoo, x.user_msn, x.user_xmpp, x.user_homepage, x.user_location, x.user_job, x.user_hobbies, x.email_public;');
  1215     
  1215     
  1216     if ( !$query )
  1216     if ( !$query )
  1217     {
  1217     {
  1218       $query = $this->sql('SELECT u.user_id AS uid,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,COUNT(p.message_id) AS num_pms FROM '.table_prefix.'session_keys AS k
  1218       $query = $this->sql('SELECT u.user_id AS uid,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,COUNT(p.message_id) AS num_pms FROM '.table_prefix.'session_keys AS k
  1219                              LEFT JOIN '.table_prefix.'users AS u
  1219                              LEFT JOIN '.table_prefix.'users AS u
  1725       if ( $row['real_name'] == $real_name && $real_name != '' )
  1725       if ( $row['real_name'] == $real_name && $real_name != '' )
  1726       {
  1726       {
  1727         $str .= '_realname';
  1727         $str .= '_realname';
  1728       }
  1728       }
  1729       
  1729       
  1730       return $lang->get($r);
  1730       return $lang->get($str);
  1731     }
  1731     }
  1732     
  1732     
  1733     // Is the password strong enough?
  1733     // Is the password strong enough?
  1734     if ( getConfig('pw_strength_enable') )
  1734     if ( getConfig('pw_strength_enable') )
  1735     {
  1735     {