'; } /** * Méthode qui valide la durée de vide d'un token * * @parm $request (deprecated) * @return stdio/null * @author Stephane F **/ public static function validateFormToken($request='') { if($_SERVER['REQUEST_METHOD']=='POST' AND isset($_SESSION['formtoken'])) { if(empty($_POST['token']) OR plxUtils::getValue($_SESSION['formtoken'][$_POST['token']]) < time() - 3600) { # 3600 seconds unset($_SESSION['formtoken']); die('Security error : invalid or expired token'); } unset($_SESSION['formtoken'][$_POST['token']]); } } } ?>