/home/techb158/workloadmatch.com/includes
NameSizeModeActions
config_loader.php9630644editdlrm
CSRF_Protect.php22240644editdlrm
db_connect.php5680644editdlrm
error.php4850644editdlrm
firebase_auth.php63180644editdlrm
footer.php6170644editdlrm
forgetpassword.php108250644editdlrm
forgetpassword_Bak.php74480644editdlrm
functions.php313300644editdlrm
geoiploc.php25204350644editdlrm
header.php18040644editdlrm
hex.php10500644editdlrm
hexbin.php9420644editdlrm
login_page.php29930644editdlrm
logout.php8700644editdlrm
migrate_last_activity.php12780644editdlrm
process_login.php21190644editdlrm
psl-config-Bak.php12130644editdlrm
psl-config.php18830644editdlrm
reset.php65370644editdlrm
Edit: /home/techb158/workloadmatch.com/includes/CSRF_Protect.php (2224B)
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 (!isset($_POST[$this->namespace]) || !$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 = bin2hex(random_bytes(32)); $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; } }