Changeset 1192


Ignore:
Timestamp:
Apr 17, 2006, 5:13:32 PM (18 years ago)
Author:
nikrou
Message:

bug 308: improve correction
svn merge -r1190:1191 from branch1_6 into trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_session.inc.php

    r1176 r1192  
    166166;';
    167167  pwg_query($query);
    168   if ( mysql_affected_rows()==0 )
    169   { // 2 possible cases:
    170     //- the user has just login so we need to insert
    171     //- the user went through 2 pages very fast (in the same second), so
    172     //  data and expiration are the same as before
    173     $query = '
    174 SELECT id FROM '.SESSIONS_TABLE.'
    175   WHERE id = \''.$session_id.'\'
    176 ;';
    177     $id =  array_from_query( $query, array('id') );
    178     if ( empty($id) )
    179     {
    180       $query = '
     168  if ( mysql_affected_rows()>0 )
     169  {
     170    return true;
     171  }
     172  $query = '
    181173INSERT INTO '.SESSIONS_TABLE.'
    182174  (id,data,expiration)
    183175  VALUES(\''.$session_id.'\',\''.$data.'\',now())
    184176;';
    185       pwg_query($query);
    186     }
    187   }
     177  pwg_query($query);
    188178  return true;
    189179}
Note: See TracChangeset for help on using the changeset viewer.