本文整理汇总了PHP中SecurityToken::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP SecurityToken::reset方法的具体用法?PHP SecurityToken::reset怎么用?PHP SecurityToken::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecurityToken
的用法示例。
在下文中一共展示了SecurityToken::reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testReset
public function testReset()
{
$t = new SecurityToken();
$initialValue = $t->getValue();
$t->reset();
$this->assertNotEquals($t->getValue(), $initialValue);
}
示例2: sendSignupConfirmation
public function sendSignupConfirmation($request)
{
$body = $this->request->getBody();
$json = json_decode($body, true);
if (!$this->securityToken->checkRequest($request)) {
$response = new SS_HTTPResponse();
$response->setStatusCode(403);
$response->addHeader('Content-Type', 'application/json');
$response->setBody(json_encode("Error"));
return $response;
}
$this->securityToken->reset();
$to = $json['email'];
$news_update_email_from = defined('NEWS_UPDATE_EMAIL_FROM') ? NEWS_UPDATE_EMAIL_FROM : 'openstacknews@openstack.org';
$user_name = sprintf('%s %s', $json['first_name'], $json['last_name']);
$email = EmailFactory::getInstance()->buildEmail('noreply@openstack.org', $to, 'Thank you for subscribing to OpenStack Foundation News updates');
$email->setTemplate('NewsPageSignupConfirmationEMail');
$email->populateTemplate(array('UserName' => $user_name, 'NewsUpdateEmailFrom' => $news_update_email_from));
$email->send();
return 'OK';
}
示例3: emitPackagePurchaseOrder
/**
* @param $request
* @return SS_HTTPResponse|string
*/
public function emitPackagePurchaseOrder($request)
{
if (!Director::is_ajax()) {
return $this->forbiddenError();
}
if (!$this->packagePurchaseOrderSecurityToken->checkRequest($request)) {
return $this->forbiddenError();
}
$body = $this->request->getBody();
$json = json_decode($body, true);
$this->packagePurchaseOrderSecurityToken->reset();
try {
$this->getPackagePurchaseOrderManager()->registerPurchaseOrder($json, new NewPurchaseOrderEmailMessageSender());
} catch (EntityValidationException $ex1) {
SS_Log::log($ex1, SS_Log::WARN);
return $this->validationError($ex1->getMessages());
} catch (Exception $ex) {
SS_Log::log($ex, SS_Log::ERR);
return $this->serverError();
}
return $this->ok(array('token' => $this->packagePurchaseOrderSecurityToken->getValue()));
}