CSRF : Allow to get the CSRF token from the CSRF or FORM classes

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2790 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-06-28 08:43:18 +00:00
parent 5f49609a28
commit d621438f0c
2 changed files with 19 additions and 0 deletions

View File

@@ -68,4 +68,12 @@ class csrf
$res .= "value='$this->csrfToken'/>\n";
return $res;
}
/** Return the token if exists or create a new one if needed */
public function getToken ()
{
if ($this->csrfToken === "")
$this->createToken ();
return $this->csrfToken;
}
}