+ public function check_openid_login()
+ {
+ $user = $this->users_model->openid_complete_login();
+
+ // Authentication failed.
+ if ($user == Auth_OpenID_CANCEL)
+ {
+ $this->load->helper('message');
+ show_error_msg_page($this, $this->lang->line('openid_cancel'));
+ return;
+ }
+ else if ($user == Auth_OpenID_FAILURE)
+ {
+ $this->load->helper('message');
+ show_error_msg_page($this, $this->lang->line('openid_failure'));
+ return;
+ }
+
+ // Authentication successful: set session with user data.
+ $this->session->set_userdata(array(
+ 'user_id'=> $user['id'],
+ 'username'=> $user['username'],
+ 'auth_src'=> $user['auth_src'],
+ 'time_zone'=> $user['time_zone']
+ ));
+
+ if ($user['import'])
+ header('Location: '. site_url('user/account'));
+ else
+ header('Location: '. site_url());
+ }
+
+ public function openid_policy()
+ {
+ $this->load->view('openid_policy_view');
+ }
+