コード例 #1
0
ファイル: Permission.php プロジェクト: joswilson/NotJustOK
 public function __construct()
 {
     parent::__construct();
     $bUserAuth = User::auth();
     $bAdminAuth = AdminCore::auth();
     /***** Levels for members *****/
     // Overall levels
     if (!$bUserAuth && ($this->registry->controller === 'AccountController' && $this->registry->action !== 'activate' || $this->registry->controller === 'FriendController' && $this->registry->action === 'mutual' || $this->registry->action === 'logout')) {
         $this->signUpRedirect();
     }
     if (!$bUserAuth && !$bAdminAuth && $this->registry->controller === 'SettingController') {
         $this->signUpRedirect();
     }
     if ($bUserAuth && ($this->registry->controller === 'SignupController' || $this->registry->action === 'activate' || $this->registry->action === 'resendactivation' || $this->registry->action === 'login')) {
         $this->alreadyConnectedRedirect();
     }
     // Options and Memberships ...
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || $bUserAuth && !$this->group->member_site_access) {
             $this->paymentRedirect();
         } elseif ($this->registry->controller === 'SearchController') {
             if (!$this->group->quick_search_profiles || !$this->group->advanced_search_profiles) {
                 $this->paymentRedirect();
             }
         }
     }
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct();
     if (!Framework\Api\Tool::checkAccess($this->config, $this->httpRequest)) {
         Framework\Http\Http::setHeadersByCode(403);
         exit('Your API key and/or the URL of your external application don\'t match with the one in the pH7CMS\'s configuration system!');
     }
 }
コード例 #3
0
 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.
         Framework\Url\Header::redirect(PH7_URL_ROOT, $this->adminSignInMsg(), 'error');
     }
 }
コード例 #4
0
 public function __construct()
 {
     parent::__construct();
     if (!AdminCore::auth()) {
         if (!$this->checkMembership() || !$this->group->chatroulette) {
             $this->paymentRedirect();
         }
     }
 }
コード例 #5
0
 public function __construct()
 {
     parent::__construct();
     if (!UserCore::auth()) {
         $this->signUpRedirect();
     } elseif (!$this->checkMembership() || !$this->group->love_calculator) {
         $this->paymentRedirect();
     }
 }
コード例 #6
0
 public function __construct()
 {
     parent::__construct();
     if (!UserCore::auth() && $this->registry->controller !== 'AdminController') {
         $this->signUpRedirect();
     }
     if (!AdminCore::auth() && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('payment', 'main', 'index'), $this->adminSignInMsg(), 'error');
     }
 }
コード例 #7
0
 public function __construct()
 {
     parent::__construct();
     // This module is available only to members
     if (!UserCore::auth() && !AdminCore::auth()) {
         $this->signInRedirect();
     }
     if (!AdminCore::auth() && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('user', 'main', 'login'), $this->adminSignInMsg(), 'error');
     }
 }
コード例 #8
0
ファイル: Permission.php プロジェクト: joswilson/NotJustOK
 public function __construct()
 {
     parent::__construct();
     $bAdminAuth = AdminCore::auth();
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || !$this->group->games_access) {
             $this->paymentRedirect();
         }
     }
     if (!$bAdminAuth && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\HeaderUrl::redirect(Framework\Mvc\Router\Uri::get('game', 'main', 'index'), $this->adminSignInMsg(), 'error');
     }
 }
コード例 #9
0
 public function __construct()
 {
     parent::__construct();
     if (!UserCore::auth() && ($this->registry->action === 'addalbum' || $this->registry->action === 'addphoto' || $this->registry->action === 'editalbum' || $this->registry->action === 'editphoto' || $this->registry->action === 'deletephoto' || $this->registry->action === 'deletealbum')) {
         $this->signInRedirect();
     }
     if (!AdminCore::auth()) {
         if (!$this->checkMembership() || !$this->group->view_pictures) {
             $this->paymentRedirect();
         } elseif (($this->registry->action === 'addalbum' || $this->registry->action === 'addvideo') && !$this->group->upload_pictures) {
             $this->paymentRedirect();
         }
     }
 }
コード例 #10
0
ファイル: Permission.php プロジェクト: joswilson/NotJustOK
 public function __construct()
 {
     parent::__construct();
     $bAdminAuth = AdminCore::auth();
     if (!UserCore::auth() && !$bAdminAuth && ($this->registry->action === 'add' || $this->registry->action === 'delete')) {
         $this->signInRedirect();
     }
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || !$this->group->view_comments) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'add' && !$this->group->write_comments) {
             $this->paymentRedirect();
         }
     }
 }
コード例 #11
0
 public function __construct()
 {
     parent::__construct();
     $bAdminAuth = AdminCore::auth();
     if (!UserCore::auth() && !$bAdminAuth) {
         $this->signInRedirect();
     }
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || $this->registry->action === 'inbox' && !$this->group->read_mails) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'compose' && !$this->group->send_mails) {
             $this->paymentRedirect();
         }
     }
     if (!$bAdminAuth && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('user', 'main', 'login'), $this->adminSignInMsg(), 'error');
     }
 }
コード例 #12
0
 public function __construct()
 {
     parent::__construct();
     // Level for Notes
     $bAdminAuth = AdminCore::auth();
     if (!UserCore::auth() && ($this->registry->action === 'add' || $this->registry->action === 'edit' || $this->registry->action === 'delete')) {
         $this->signUpRedirect();
     }
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || $this->registry->action === 'read' && !$this->group->read_notes) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'add' && !$this->group->write_notes) {
             $this->paymentRedirect();
         }
     }
     if (!$bAdminAuth && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('blog', 'main', 'index'), $this->adminSignInMsg(), 'error');
     }
 }
コード例 #13
0
 public function __construct()
 {
     parent::__construct();
     /***** Levels for the forums *****/
     $bAdminAuth = AdminCore::auth();
     if (!UserCore::auth() && !$bAdminAuth && ($this->registry->action === 'addtopic' || $this->registry->action === 'edittopic' || $this->registry->action === 'deletetopic' || $this->registry->action === 'reply' || $this->registry->action === 'editmessage' || $this->registry->action === 'deletemessage')) {
         $this->signInRedirect();
     }
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || !$this->group->forum_access) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'addtopic' && !$this->group->create_forum_topics) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'reply' && !$this->group->answer_forum_topics) {
             $this->paymentRedirect();
         }
     }
     if (!$bAdminAuth && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('forum', 'forum', 'index'), $this->adminSignInMsg(), 'error');
     }
 }