Exemplo n.º 1
0
 public static function delete($id_)
 {
     Logger::debug('main', 'Starting Abstract_Session::delete for \'' . $id_ . '\'');
     $SQL = SQL::getInstance();
     $id = $id_;
     $SQL->DoQuery('SELECT 1 FROM @1 WHERE @2 = %3 LIMIT 1', $SQL->prefix . 'sessions', 'id', $id);
     $total = $SQL->NumRows();
     if ($total == 0) {
         Logger::error('main', "Abstract_Session::delete({$id_}) session does not exist (NumRows == 0)");
         return false;
     }
     $SQL->DoQuery('DELETE FROM @1 WHERE @2 = %3 LIMIT 1', $SQL->prefix . 'sessions', 'id', $id);
     Abstract_Liaison::delete('ServerSession', NULL, $id_);
     $tokens = Abstract_Token::load_by_session($id_);
     foreach ($tokens as $token) {
         Abstract_Token::delete($token->id);
     }
     return true;
 }