public function __construct()
 {
     parent::__construct();
     if (!AdminCore::auth()) {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Header::redirect(Uri::get('user', 'main', 'login'), $this->adminSignInMsg(), 'error');
     }
 }
示例#2
0
 public function __construct()
 {
     parent::__construct();
     // Level for Admins
     if (!AdminCore::auth() && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         HeaderUrl::redirect(Uri::get('fake-admin-panel', 'main', 'login'), $this->adminSignInMsg(), 'error');
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (UserCore::auth() && ($this->registry->action === 'index' || $this->registry->action === 'login' || $this->registry->action === 'register')) {
         Header::redirect(Uri::get('user', 'account', 'index'), $this->alreadyConnectedMsg(), 'error');
     }
     if (!AdminCore::auth() && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Header::redirect(Uri::get('user', 'main', 'login'), $this->adminSignInMsg(), 'error');
     }
 }
 public function __construct()
 {
     parent::__construct();
     // Admin Security, if you have forgotten your admin password, comment this code below
     if ($this->httpRequest->get('mod') == PH7_ADMIN_MOD && ($this->registry->action == 'forgot' || $this->registry->action == 'reset')) {
         Header::redirect(Uri::get(PH7_ADMIN_MOD, 'main', 'login'), t('For security reasons, you do not have the right to generate a new password. To disable this security option, you must go to the Permission file of "lost-password" module'), 'error');
     }
     if ((UserCore::auth() || AffiliateCore::auth() || AdminCore::auth()) && ($this->registry->action == 'forgot' || $this->registry->action == 'reset')) {
         Header::redirect(Uri::get('lost-password', 'main', 'account'), $this->alreadyConnectedMsg(), 'error');
     }
 }
示例#5
0
 public function __construct()
 {
     parent::__construct();
     if (UserCore::auth() && $this->registry->controller === 'HomeController') {
         // Newsletter subscription is only for visitors, not for members since they can subscribe into their account.
         HeaderUrl::redirect(Uri::get('user', 'main', 'index'));
     }
     if (!AdminCore::auth() && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         HeaderUrl::redirect(Uri::get('user', 'main', 'login'), $this->adminSignInMsg(), 'error');
     }
 }
 public function __construct()
 {
     parent::__construct();
     $bAdminAuth = AdminCore::auth();
     /***** Levels for admin module *****/
     // Overall levels
     if (!$bAdminAuth && $this->registry->action !== 'login') {
         Header::redirect(Uri::get(PH7_ADMIN_MOD, 'main', 'login'), $this->signInMsg(), 'error');
     }
     if ($bAdminAuth && $this->registry->action === 'login') {
         Header::redirect(Uri::get(PH7_ADMIN_MOD, 'main', 'index'), t('Oops! You are already logged in as administrator.'), 'error');
     }
     // Options ...
 }
 public function __construct()
 {
     parent::__construct();
     /*
      * This file is not required, It serves the permissions of the module.
      * pH7CMS includes this file only if it exists.
      *
      * Example of Code:
      * if (!UserCore::auth() && ($this->registry->controller === 'HelloWorldController'))
      * {
      *     Header::redirect(Uri::get('user','main','login'), $this->signInMsg(), 'error');
      * }
      */
 }
 public function __construct()
 {
     parent::__construct();
     $bAffAuth = AffiliateCore::auth();
     $bAdminAuth = AdminCore::auth();
     if (!$bAffAuth && ($this->registry->controller === 'AdsController' || $this->registry->action === 'logout')) {
         Header::redirect(Uri::get('affiliate', 'signup', 'step1'), $this->signUpMsg(), 'error');
     }
     if (!$bAffAuth && !$bAdminAuth && ($this->registry->controller === 'AccountController' && $this->registry->action !== 'activate')) {
         Header::redirect(Uri::get('affiliate', 'signup', 'step1'), $this->signUpMsg(), 'error');
     }
     if ($bAffAuth && ($this->registry->controller === 'SignupController' || $this->registry->action === 'activate' || $this->registry->action === 'resendactivation' || $this->registry->action === 'login')) {
         Header::redirect(Uri::get('affiliate', 'account', 'index'), $this->alreadyConnectedMsg(), 'error');
     }
     if (!$bAdminAuth && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Header::redirect(Uri::get('affiliate', 'home', 'index'), $this->adminSignInMsg(), 'error');
     }
 }
示例#9
0
 public function __construct()
 {
     parent::__construct();
 }