本文整理汇总了PHP中MEMBER::sendActivationLink方法的典型用法代码示例。如果您正苦于以下问题:PHP MEMBER::sendActivationLink方法的具体用法?PHP MEMBER::sendActivationLink怎么用?PHP MEMBER::sendActivationLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEMBER
的用法示例。
在下文中一共展示了MEMBER::sendActivationLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createAccount
/**
* Creates a new user account
*/
function createAccount()
{
global $CONF, $manager;
if (!$CONF['AllowMemberCreate']) {
doError(_ERROR_MEMBERCREATEDISABLED);
}
// evaluate content from FormExtra
$result = 1;
$data = array('type' => 'membermail', 'error' => &$result);
$manager->notify('ValidateForm', &$data);
if ($result != 1) {
return $result;
} else {
// even though the member can not log in, set some random initial password. One never knows.
srand((double) microtime() * 1000000);
$initialPwd = md5(uniqid(rand(), TRUE));
// create member (non admin/can not login/no notes/random string as password)
$name = shorten(postVar('name'), 32, '');
$r = MEMBER::create($name, postVar('realname'), $initialPwd, postVar('email'), postVar('url'), 0, 0, '');
if ($r != 1) {
return $r;
}
// send message containing password.
$newmem = new MEMBER();
$newmem->readFromName($name);
$newmem->sendActivationLink('register');
$manager->notify('PostRegister', array('member' => &$newmem));
if (postVar('desturl')) {
redirect(postVar('desturl'));
} else {
// header has been already sent, so deleted the line below
sendContentType('text/html', '', _CHARSET);
echo _MSG_ACTIVATION_SENT;
echo '<br /><br />Return to <a href="' . $CONF['IndexURL'] . '" title="' . $CONF['SiteName'] . '">' . $CONF['SiteName'] . '</a>';
echo "\n</body>\n</html>";
}
exit;
}
}