本文整理匯總了PHP中OpenVBX::connectAuthTenant方法的典型用法代碼示例。如果您正苦於以下問題:PHP OpenVBX::connectAuthTenant方法的具體用法?PHP OpenVBX::connectAuthTenant怎麽用?PHP OpenVBX::connectAuthTenant使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenVBX
的用法示例。
在下文中一共展示了OpenVBX::connectAuthTenant方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: login
private function login($redirect)
{
try {
$user = VBX_User::authenticate($this->input->post('email'), $this->input->post('pw'), $this->input->post('captcha'), $this->input->post('captcha_token'));
if ($user) {
$connect_auth = OpenVBX::connectAuthTenant($user->tenant_id);
// we kick out non-admins, admins will have an opportunity to re-auth the account
if (!$connect_auth && !$user->is_admin) {
$this->session->set_flashdata('error', 'Connect auth denied');
return redirect('auth/connect/account_deauthorized');
}
$userdata = array('email' => $user->email, 'user_id' => $user->id, 'is_admin' => $user->is_admin, 'loggedin' => TRUE, 'signature' => VBX_User::signature($user->id));
$this->session->set_userdata($userdata);
if (OpenVBX::schemaVersion() >= 24) {
return $this->after_login_completed($user, $redirect);
}
return $this->redirect($redirect);
}
$this->session->set_flashdata('error', 'Email address and/or password is incorrect');
return redirect('auth/login?redirect=' . urlencode($redirect));
} catch (GoogleCaptchaChallengeException $e) {
$this->session->set_flashdata('error', $e->getMessage());
$data['error'] = $e->getMessage();
$data['captcha_url'] = $e->captcha_url;
$data['captcha_token'] = $e->captcha_token;
}
}