diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d9b22d096e5..9c9bf505b05 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8325,3 +8325,24 @@ function isAFileWithExecutableContent($filename) } return false; } + +/** + * Return the value of token currently saved into session with name 'newtoken'. + * This token must be send by any POST as it will be used by next page for comparison with value in session. + * + * @return string + */ +function newToken() +{ + return $_SESSION['newtoken']; +} + +/** + * Return the value of token currently saved into session with name 'token'. + * + * @return string + */ +function currentToken() +{ + return $_SESSION['token']; +}