/home/techb158/workloadmatch.com/workloadmatch.com/includes
NameSizeModeActions
CSRF_Protect.php21880644editdlrm
db_connect.php6940644editdlrm
error.php4510644editdlrm
error_log24180644editdlrm
forgetpassword.php68310644editdlrm
functions.php241620644editdlrm
geoiploc.php25204350644editdlrm
hex.php10500644editdlrm
hexbin.php9420644editdlrm
logout.php7940644editdlrm
process_login.php28840644editdlrm
process_login_Remove rechaptcha.php28910644editdlrm
psl-config.php16870644editdlrm
register.inc.php33040644editdlrm
register.php263220644editdlrm
reset.php61540644editdlrm
Edit: /home/techb158/workloadmatch.com/workloadmatch.com/includes/CSRF_Protect.php (2188B)
namespace = $namespace; if (session_id() === '') { session_start(); } $this->setToken(); } /** * Return the token from persistent storage * * @return string */ public function getToken() { return $this->readTokenFromStorage(); } /** * Verify if supplied token matches the stored token * * @param string $userToken * @return boolean */ public function isTokenValid($userToken) { return ($userToken === $this->readTokenFromStorage()); } /** * Echoes the HTML input field with the token, and namespace as the * name of the field */ public function echoInputField() { $token = $this->getToken(); echo "namespace}\" value=\"{$token}\" />"; } /** * Verifies whether the post token was set, else dies with error */ public function verifyRequest() { if (!$this->isTokenValid($_POST[$this->namespace])) { die("CSRF validation failed."); } } /** * Generates a new token value and stores it in persisent storage, or else * does nothing if one already exists in persisent storage */ private function setToken() { $storedToken = $this->readTokenFromStorage(); if ($storedToken === '') { $token = md5(uniqid(rand(), TRUE)); $this->writeTokenToStorage($token); } } /** * Reads token from persistent sotrage * @return string */ private function readTokenFromStorage() { if (isset($_SESSION[$this->namespace])) { return $_SESSION[$this->namespace]; } else { return ''; } } /** * Writes token to persistent storage */ private function writeTokenToStorage($token) { $_SESSION[$this->namespace] = $token; } }