コード例 #1
0
ファイル: admin.php プロジェクト: nailsapp/module-api
 /**
  * Constructor
  *
  * @access	public
  * @return	void
  *
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     $this->_authorised = TRUE;
     $this->_error = '';
     // --------------------------------------------------------------------------
     //	Constructor mabobs.
     //	IP whitelist?
     $_ip_whitelist = json_decode(APP_ADMIN_IP_WHITELIST);
     if ($_ip_whitelist) {
         if (!ip_in_range($this->input->ip_address(), $_ip_whitelist)) {
             show_404();
         }
     }
     //	Only logged in users
     if (!$this->user_model->is_logged_in()) {
         $this->_authorised = FALSE;
         $this->_error = lang('auth_require_session');
         //	Only admins
     } elseif (!$this->user_model->is_admin()) {
         $this->_authorised = FALSE;
         $this->_error = lang('auth_require_administrator');
     }
 }
コード例 #2
0
ファイル: auth.php プロジェクト: nailsapp/module-api
 /**
  * Constructor
  *
  * @access	public
  * @return	void
  *
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	Where are we returning user to?
     $this->data['return_to'] = $this->input->get('return_to');
 }
コード例 #3
0
ファイル: shop.php プロジェクト: nailsapp/module-api
 /**
  * Constructor
  *
  * @access	public
  * @return	void
  *
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	Check this module is enabled in settings
     if (!module_is_enabled('shop')) {
         //	Cancel execution, module isn't enabled
         $this->_method_not_found($this->uri->segment(2));
     }
 }
コード例 #4
0
ファイル: cms.php プロジェクト: nailsapp/module-api
 /**
  * Constructor
  *
  * @access	public
  * @return	void
  *
  **/
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     $this->_authorised = TRUE;
     $this->_error = '';
     // --------------------------------------------------------------------------
     if (!module_is_enabled('cms')) {
         //	Cancel execution, module isn't enabled
         show_404();
     }
     // --------------------------------------------------------------------------
     //	Only logged in users
     if (!$this->user_model->is_logged_in()) {
         $this->_authorised = FALSE;
         $this->_error = lang('auth_require_session');
     }
     // --------------------------------------------------------------------------
     //	Only admins
     if (!$this->user_model->is_admin()) {
         $this->_authorised = FALSE;
         $this->_error = lang('auth_require_administrator');
     }
 }