Skip to content

Commit

Permalink
Add SessionManager isValidId method - refs BT#9092
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Barreto committed Feb 24, 2015
1 parent 2694c82 commit 8b73468
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main/inc/lib/sessionmanager.lib.php
Expand Up @@ -5798,4 +5798,18 @@ public static function searchSession($term, $extraFieldsToInclude = array())

return $resultData;
}

public static function isValidId($sessionId)
{
$sessionId = intval($sessionId);
if ($sessionId > 0) {
$rows = Database::select('id', Database::get_main_table(TABLE_MAIN_SESSION), array('where' => array('id = ?' => $sessionId)));
if (!empty($rows)) {

return true;
}
}

return false;
}
}

0 comments on commit 8b73468

Please sign in to comment.