includes/sessions.php
changeset 776 f37b60d393bc
parent 770 62fed244fa1c
child 782 96848f04bbba
equal deleted inserted replaced
775:20370871c333 776:f37b60d393bc
  1053                              . '    ON ( u.user_id=x.user_id OR x.user_id IS NULL )' . "\n"
  1053                              . '    ON ( u.user_id=x.user_id OR x.user_id IS NULL )' . "\n"
  1054                              . '  LEFT JOIN '.table_prefix.'privmsgs AS p' . "\n"
  1054                              . '  LEFT JOIN '.table_prefix.'privmsgs AS p' . "\n"
  1055                              . '    ON ( p.message_to=u.username AND p.message_read=0 )' . "\n"
  1055                              . '    ON ( p.message_to=u.username AND p.message_read=0 )' . "\n"
  1056                              . '  WHERE k.session_key=\''.$keyhash.'\'' . "\n"
  1056                              . '  WHERE k.session_key=\''.$keyhash.'\'' . "\n"
  1057                              . '    AND k.salt=\''.$salt.'\'' . "\n"
  1057                              . '    AND k.salt=\''.$salt.'\'' . "\n"
  1058                              . '  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,u.user_timezone,u.user_title,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, x.disable_js_fx;');
  1058                              . '  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,u.user_timezone,u.user_title,u.user_dst,k.source_ip,k.time,k.auth_level,k.key_type,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, x.disable_js_fx;');
  1059     
  1059     
  1060     if ( !$query && ( defined('IN_ENANO_INSTALL') or defined('IN_ENANO_UPGRADE') ) )
  1060     if ( !$query && ( defined('IN_ENANO_INSTALL') or defined('IN_ENANO_UPGRADE') ) )
  1061     {
  1061     {
  1062       $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, 1440 AS user_timezone, \'0;0;0;0;60\' AS user_dst, ' . SK_SHORT . ' AS key_type FROM '.table_prefix.'session_keys AS k
  1062       $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, 1440 AS user_timezone, \'0;0;0;0;60\' AS user_dst, ' . SK_SHORT . ' AS key_type FROM '.table_prefix.'session_keys AS k
  1063                              LEFT JOIN '.table_prefix.'users AS u
  1063                              LEFT JOIN '.table_prefix.'users AS u
  2368          . "    ON (\n"
  2368          . "    ON (\n"
  2369          . $assoc
  2369          . $assoc
  2370          . "      )\n"
  2370          . "      )\n"
  2371          . "  LEFT JOIN " . table_prefix . "ranks AS rd\n"
  2371          . "  LEFT JOIN " . table_prefix . "ranks AS rd\n"
  2372          . "    ON ( rd.rank_id = 1 )$append\n"
  2372          . "    ON ( rd.rank_id = 1 )$append\n"
  2373          . "  GROUP BY u.user_id, u.username, u.user_level, u.user_group, u.user_rank, u.user_title, g.group_rank,\n"
  2373          . "  GROUP BY u.user_id, u.username, u.user_level, u.user_group, u.user_rank, u.user_title, u.user_rank_userset, g.group_rank,\n"
  2374          . "       ru.rank_id, ru.rank_title, ru.rank_style,rg.rank_id, rg.rank_title, rg.rank_style,\n"
  2374          . "       ru.rank_id, ru.rank_title, ru.rank_style,rg.rank_id, rg.rank_title, rg.rank_style,\n"
  2375          . "       rl.rank_id, rl.rank_title, rl.rank_style,rd.rank_id, rd.rank_title, rd.rank_style;";
  2375          . "       rl.rank_id, rl.rank_title, rl.rank_style,rd.rank_id, rd.rank_title, rd.rank_style;";
  2376     
  2376     
  2377     return $sql;
  2377     return $sql;
  2378   }
  2378   }