includes/sessions.php
changeset 593 4f9bec0d65c1
parent 592 27377179fe58
child 595 b051eb79b158
equal deleted inserted replaced
592:27377179fe58 593:4f9bec0d65c1
  2517     global $lang;
  2517     global $lang;
  2518     global $user_ranks;
  2518     global $user_ranks;
  2519     // cache info if possible
  2519     // cache info if possible
  2520     static $_cache = array();
  2520     static $_cache = array();
  2521     
  2521     
       
  2522     if ( is_int($id) && $id == 0 )
       
  2523       $id = 1;
       
  2524     
  2522     if ( is_int($id) )
  2525     if ( is_int($id) )
  2523       $col = "user_id = $id";
  2526       $col = "u.user_id = $id";
  2524     else if ( is_string($id) )
  2527     else if ( is_string($id) )
  2525       $col = ENANO_SQLFUNC_LOWERCASE . "(username) = " . ENANO_SQLFUNC_LOWERCASE . "('" . $db->escape($id) . "')";
  2528       $col = ENANO_SQLFUNC_LOWERCASE . "(username) = " . ENANO_SQLFUNC_LOWERCASE . "('" . $db->escape($id) . "')";
  2526     else
  2529     else
  2527       // invalid parameter
  2530       // invalid parameter
  2528       return false;
  2531       return false;