本文整理汇总了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;
}
}