本文整理汇总了PHP中MEMBER::cleanupActivationTable方法的典型用法代码示例。如果您正苦于以下问题:PHP MEMBER::cleanupActivationTable方法的具体用法?PHP MEMBER::cleanupActivationTable怎么用?PHP MEMBER::cleanupActivationTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEMBER
的用法示例。
在下文中一共展示了MEMBER::cleanupActivationTable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_activatesetpwd
/**
* Account activation - set password part
*
* @author dekarma
*/
function action_activatesetpwd()
{
$key = postVar('key');
// clean up old activation keys
MEMBER::cleanupActivationTable();
// get activation info
$info = MEMBER::getActivationInfo($key);
if (!$info || $info->type == 'addresschange') {
return $this->_showActivationPage($key, _ERROR_ACTIVATE);
}
$mem = MEMBER::createFromId($info->vmember);
if (!$mem) {
return $this->_showActivationPage($key, _ERROR_ACTIVATE);
}
$password = postVar('password');
$repeatpassword = postVar('repeatpassword');
if (!$password) {
return $this->_showActivationPage($key, _ERROR_PASSWORDMISSING);
}
if ($password != $repeatpassword) {
return $this->_showActivationPage($key, _ERROR_PASSWORDMISMATCH);
}
if (strlen($password) < 6) {
return $this->_showActivationPage($key, _ERROR_PASSWORDTOOSHORT);
}
$pwdvalid = true;
$pwderror = '';
global $manager;
$manager->notify('PrePasswordSet', array('password' => $password, 'errormessage' => &$pwderror, 'valid' => &$pwdvalid));
if (!$pwdvalid) {
return $this->_showActivationPage($key, $pwderror);
}
$error = '';
$manager->notify('ValidateForm', array('type' => 'activation', 'member' => $mem, 'error' => &$error));
if ($error != '') {
return $this->_showActivationPage($key, $error);
}
// set password
$mem->setPassword($password);
$mem->write();
// do the activation
MEMBER::activate($key);
$this->pagehead();
echo '<h2>', _ACTIVATE_SUCCESS_TITLE, '</h2>';
echo '<p>', _ACTIVATE_SUCCESS_TEXT, '</p>';
$this->pagefoot();
}