本文整理汇总了PHP中Captcha::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Captcha::delete方法的具体用法?PHP Captcha::delete怎么用?PHP Captcha::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Captcha
的用法示例。
在下文中一共展示了Captcha::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* @see Form::save()
*/
public function save()
{
parent::save();
// delete captcha
if ($this->useCaptcha) {
$this->captcha->delete();
}
WCF::getSession()->unregister('captchaDone');
}
示例2: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
// save language id
$this->additionalFields['languageID'] = $this->languageID;
// save registration ip address
$this->additionalFields['registrationIpAddress'] = WCF::getSession()->ipAddress;
// generate activation code
$addDefaultGroups = true;
if (REGISTER_ACTIVATION_METHOD == 1 || REGISTER_ACTIVATION_METHOD == 2) {
$activationCode = UserRegistrationUtil::getActivationCode();
$this->additionalFields['activationCode'] = $activationCode;
$addDefaultGroups = false;
$this->groupIDs = Group::getGroupIdsByType(array(Group::EVERYONE, Group::GUESTS));
}
// create
$this->user = UserEditor::create($this->username, $this->email, $this->password, $this->groupIDs, $this->activeOptions, $this->additionalFields, $this->visibleLanguages, $addDefaultGroups);
// update session
WCF::getSession()->changeUser($this->user);
// activation management
if (REGISTER_ACTIVATION_METHOD == 0) {
$this->message = 'wcf.user.register.success';
}
if (REGISTER_ACTIVATION_METHOD == 1) {
$mail = new Mail(array($this->username => $this->email), WCF::getLanguage()->get('wcf.user.register.needActivation.mail.subject', array('PAGE_TITLE' => WCF::getLanguage()->get(PAGE_TITLE))), WCF::getLanguage()->get('wcf.user.register.needActivation.mail', array('PAGE_TITLE' => WCF::getLanguage()->get(PAGE_TITLE), '$username' => $this->username, '$userID' => $this->user->userID, '$activationCode' => $activationCode, 'PAGE_URL' => PAGE_URL, 'MAIL_ADMIN_ADDRESS' => MAIL_ADMIN_ADDRESS)));
$mail->send();
$this->message = 'wcf.user.register.needActivation';
}
if (REGISTER_ACTIVATION_METHOD == 2) {
$this->message = 'wcf.user.register.awaitActivation';
}
// notify admin
if (REGISTER_ADMIN_NOTIFICATION) {
// get default language
$language = WCF::getLanguage()->getLanguageID() != Language::getDefaultLanguageID() ? new Language(Language::getDefaultLanguageID()) : WCF::getLanguage();
$language->setLocale();
// send mail
$mail = new Mail(MAIL_ADMIN_ADDRESS, $language->get('wcf.user.register.notification.mail.subject', array('PAGE_TITLE' => $language->get(PAGE_TITLE))), $language->get('wcf.user.register.notification.mail', array('PAGE_TITLE' => $language->get(PAGE_TITLE), '$username' => $this->username)));
$mail->send();
WCF::getLanguage()->setLocale();
}
// delete captcha
if (REGISTER_USE_CAPTCHA && !WCF::getSession()->getVar('captchaDone')) {
$this->captcha->delete();
}
WCF::getSession()->unregister('captchaDone');
// login user
UserAuth::getInstance()->storeAccessData($this->user, $this->username, $this->password);
$this->saved();
// forward to index page
WCF::getTPL()->assign(array('url' => 'index.php' . SID_ARG_1ST, 'message' => WCF::getLanguage()->get($this->message, array('$username' => $this->username, '$email' => $this->email))));
WCF::getTPL()->display('redirect');
exit;
}