本文整理匯總了PHP中Authentication::forcePasswordChangeByUserID方法的典型用法代碼示例。如果您正苦於以下問題:PHP Authentication::forcePasswordChangeByUserID方法的具體用法?PHP Authentication::forcePasswordChangeByUserID怎麽用?PHP Authentication::forcePasswordChangeByUserID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Authentication
的用法示例。
在下文中一共展示了Authentication::forcePasswordChangeByUserID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: disable
function disable($id){
return Authentication::forcePasswordChangeByUserID($id);
}
示例2: isset
require_once('RedirectBrowserException.php');
require_once('User.php');
require_once('Session.php');
require_once('Quick_Login.php');
require_once('Mail.php');
setSession(0, '/');
$email = isset($_GET['email']) ? $_GET['email'] : null;
if( $email ){
$auth = Authentication::getByIdentity($email);
if( $auth ){
$user = $auth->user;
if( $user ){
Authentication::forcePasswordChangeByUserID($user->userid);
//create login hash
$hash = hash('whirlpool', $user->authentication->password . time() . $user->authentication->salt);
if( !Quick_Login::add($hash, $user->userid, time() + 3600, 0) ){
// die
}
//load email template
ob_start();
include('templates/account_recover.html');
$body = ob_get_clean();
if( Mail::sendMail($user->contact->email, 'no-reply-automator@afterthought.thomasrandolph.info', "Afterthought System Account Recovery", $body) ){
//redirect to login
throw new RedirectBrowserException("/index.php?code=6");