コード例 #1
0
ファイル: login.php プロジェクト: nailsapp/module-auth
 /**
  * Constructor
  *
  * @access	public
  * @param	none
  * @return	void
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	Load libraries
     $this->load->library('form_validation');
     // --------------------------------------------------------------------------
     //	Where are we returning user to?
     $_return_to = $this->input->get('return_to');
     $_return_to = preg_match('#^(http|https)\\://#', $_return_to) ? $_return_to : site_url($_return_to);
     $_return_to = parse_url($_return_to);
     //	urlencode the query if there is one
     if (!empty($_return_to['query'])) {
         //	Break it apart and glue it together (urlencoded)
         $_query = parse_str($_return_to['query'], $_query_ar);
         $_return_to['query'] = http_build_query($_query_ar);
     }
     $this->data['return_to'] = '';
     $this->data['return_to'] .= !empty($_return_to['scheme']) ? $_return_to['scheme'] . '://' : 'http://';
     $this->data['return_to'] .= !empty($_return_to['host']) ? $_return_to['host'] : site_url();
     $this->data['return_to'] .= !empty($_return_to['path']) ? $_return_to['path'] : '';
     $this->data['return_to'] .= !empty($_return_to['query']) ? '?' . $_return_to['query'] : '';
     // --------------------------------------------------------------------------
     //	Specify a default title for this page
     $this->data['page']->title = lang('auth_title_login');
 }
コード例 #2
0
 /**
  * Constructor
  *
  * @access	public
  * @param	none
  * @return	void
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	If user is logged in they shouldn't be accessing this method
     if ($this->user_model->is_logged_in()) {
         $this->session->set_flashdata('error', lang('auth_no_access_already_logged_in', active_user('email')));
         redirect('/');
     }
 }
コード例 #3
0
 /**
  * Constructor
  *
  * @access	public
  * @param	none
  * @return	void
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	Load libraries
     $this->load->library('form_validation');
     // --------------------------------------------------------------------------
     //	Specify a default title for this page
     $this->data['page']->title = lang('auth_title_forgotten_password');
 }
コード例 #4
0
ファイル: override.php プロジェクト: nailsapp/module-auth
 /**
  * Constructor
  *
  * @access	public
  * @param	none
  * @return	void
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	If you're not a admin then you shouldn't be accessing this class
     if (!$this->user_model->was_admin() && !$this->user_model->is_admin()) {
         $this->session->set_flashdata('error', lang('auth_no_access'));
         redirect('/');
     }
 }
コード例 #5
0
ファイル: register.php プロジェクト: nailsapp/module-auth
 /**
  * Constructor
  *
  * @access	public
  * @param	none
  * @return	void
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	Is registration enabled
     if (!app_setting('user_registration_enabled', 'app')) {
         show_404();
     }
     // --------------------------------------------------------------------------
     //	Load libraries
     $this->load->library('form_validation');
     // --------------------------------------------------------------------------
     //	Specify a default title for this page
     $this->data['page']->title = lang('auth_title_register');
 }
コード例 #6
0
ファイル: tw.php プロジェクト: nailsapp/module-auth
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	Ensure the sub-module is enabled
     if (app_setting('social_signin_tw_enabled')) {
         show_404();
     }
     // --------------------------------------------------------------------------
     //	Load the LinkedIn Library
     $this->load->library('twitter_connect', NULL, 'tw');
     // --------------------------------------------------------------------------
     //	Set a return_to if available
     $this->_register_use_return = TRUE;
     $this->_return_to = $this->input->get('return_to');
     //	If nothing, check the 'nailsTWConnectReturnTo' GET var which may be passed back
     if (!$this->_return_to) {
         $this->_return_to = $this->input->get('nailsTWConnectReturnTo');
         //	Still empty? Group homepage
         if (!$this->_return_to) {
             $this->_return_to = active_user('group_homepage');
             $this->_register_use_return = FALSE;
         }
     }
     // --------------------------------------------------------------------------
     //	Set a return_to_fail if available
     $this->_return_to_fail = $this->input->get('return_to_fail');
     //	If nothing, check the GET var which may be passed back
     if (!$this->_return_to_fail) {
         $this->_return_to_fail = $this->input->get('nailsTWConnectReturnToFail');
         if (!$this->_return_to_fail) {
             //	Fallback to the value of $this->_return_to
             $this->_return_to_fail = $this->_return_to;
         }
     }
     // --------------------------------------------------------------------------
     //	Default register token is empty
     $this->_register_token = array();
 }