plugins/admin/UserManager.php
changeset 937 b174cdb75bec
parent 928 e2971f4a3123
child 966 2db0975aa31a
equal deleted inserted replaced
936:41090c4d2648 937:b174cdb75bec
   547     }
   547     }
   548     else
   548     else
   549     {
   549     {
   550       // Get the current session information so the user doesn't get logged out
   550       // Get the current session information so the user doesn't get logged out
   551       $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
   551       $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
   552       $sk = md5(strrev($session->sid_super));
   552       $sk = md5($session->sid_super);
   553       $qb = $db->sql_query('SELECT session_key,salt,auth_level,source_ip,time FROM '.table_prefix.'session_keys WHERE session_key=\''.$sk.'\' AND user_id='.$session->user_id.' AND auth_level='.USER_LEVEL_ADMIN);
   553       $qb = $db->sql_query('SELECT session_key,salt,auth_level,source_ip,time FROM '.table_prefix.'session_keys WHERE session_key=\''.$sk.'\' AND user_id='.$session->user_id.' AND auth_level='.USER_LEVEL_ADMIN);
   554       if ( !$qb )
   554       if ( !$qb )
   555       {
   555       {
   556         die('Error selecting session key info block B: '.$db->get_error());
   556         die('Error selecting session key info block B: '.$db->get_error());
   557       }
   557       }
   572       $rb = $db->fetchrow($qb);
   572       $rb = $db->fetchrow($qb);
   573       $db->free_result($qa);
   573       $db->free_result($qa);
   574       $db->free_result($qb);
   574       $db->free_result($qb);
   575       
   575       
   576       $db->sql_query('DELETE FROM '.table_prefix.'session_keys;');
   576       $db->sql_query('DELETE FROM '.table_prefix.'session_keys;');
   577       $db->sql_query('INSERT INTO '.table_prefix.'session_keys( session_key,salt,user_id,auth_level,source_ip,time ) VALUES( \''.$ra['session_key'].'\', \''.$ra['salt'].'\', \''.$session->user_id.'\', \''.$ra['auth_level'].'\', \''.$ra['source_ip'].'\', '.$ra['time'].' ),( \''.$rb['session_key'].'\', \''.$rb['salt'].'\', \''.$session->user_id.'\', \''.$rb['auth_level'].'\', \''.$rb['source_ip'].'\', '.$rb['time'].' )');
   577       $db->sql_query('INSERT INTO '.table_prefix.'session_keys( session_key,salt,user_id,auth_level,source_ip,time ) VALUES( \''.$ra['session_key'].'\', \'' . $db->escape($ra['salt']) . '\', \''.$session->user_id.'\', \''.$ra['auth_level'].'\', \''.$ra['source_ip'].'\', '.$ra['time'].' ),( \''.$rb['session_key'].'\', \'' . $db->escape($rb['salt']) . '\', \''.$session->user_id.'\', \''.$rb['auth_level'].'\', \''.$rb['source_ip'].'\', '.$rb['time'].' )');
   578       
   578       
   579       echo '<div class="info-box">' . $lang->get('acpum_msg_sessionclear_success') . '</div>';
   579       echo '<div class="info-box">' . $lang->get('acpum_msg_sessionclear_success') . '</div>';
   580     }
   580     }
   581   }
   581   }
   582   echo '<form action="' . makeUrlNS('Special', 'Administration', 'module=' . $paths->cpage['module'], true) . '" method="post" enctype="multipart/form-data" onsubmit="if ( !submitAuthorized ) return false;">';
   582   echo '<form action="' . makeUrlNS('Special', 'Administration', 'module=' . $paths->cpage['module'], true) . '" method="post" enctype="multipart/form-data" onsubmit="if ( !submitAuthorized ) return false;">';