コード例 #1
0
ファイル: SecurityUtil.php プロジェクト: rmaiwald/core
 /**
  * Validate a given security token.
  *
  * @param string                $token          Token to be validated.
  * @param Zikula_ServiceManager $serviceManager ServiceManager default = null.
  *
  * @return boolean
  */
 public static function validateCsrfToken($token, Zikula_ServiceManager $serviceManager = null)
 {
     if (!$serviceManager) {
         $serviceManager = ServiceUtil::getManager();
     }
     $tokenValidator = $serviceManager->get('token.validator');
     if (System::getVar('sessioncsrftokenonetime')) {
         $result = $tokenValidator->validate($token, false, false);
         if ($result) {
             return true;
         }
         SessionUtil::expire();
         // something went wrong so expire the session.
     }
     return $tokenValidator->validate($token);
 }
コード例 #2
0
ファイル: Legacy.php プロジェクト: rmaiwald/core
 /**
  * {@inheritdoc}
  */
 public function expire()
 {
     SessionUtil::expire();
 }