本文整理汇总了PHP中VBX_User::send_reset_notification方法的典型用法代码示例。如果您正苦于以下问题:PHP VBX_User::send_reset_notification方法的具体用法?PHP VBX_User::send_reset_notification怎么用?PHP VBX_User::send_reset_notification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VBX_User
的用法示例。
在下文中一共展示了VBX_User::send_reset_notification方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reset
public function reset()
{
$this->template->write('title', 'Reset Password');
$data = array();
$email = $this->input->post('email');
if (empty($email)) {
$data['error'] = $this->session->flashdata('error');
return $this->respond('', 'reset', $data, 'login-wrapper', 'layout/login');
}
$user = VBX_User::get(array('email' => $this->input->post('email'), 'is_active' => 1));
if (empty($user)) {
$this->session->set_flashdata('error', 'No active account found.');
return redirect('auth/reset');
}
if ($user->auth_type == 'google') {
header('Location: http://www.google.com/support/accounts/bin/answer.py?answer=48598&hl=en&ctx=ch_Login&fpUrl=https%3A%2F%2Fwww.google.com%2Faccounts%2FForgotPasswd%3FfpOnly%3D1%26continue%3Dhttp%253A%252F%252Fwww.google.com%252F%26hl%3Den');
return;
} else {
$user = new VBX_User($user);
$emailSent = $user->send_reset_notification();
if ($emailSent) {
$this->session->set_flashdata('error', 'To complete the password reset, check your inbox.');
} else {
$this->session->set_flashdata('error', 'The email was not sent. Contact your admin.');
}
return redirect('auth/login');
}
return redirect('auth/reset');
}