Exemplo n.º 1
0
 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();
             }
         }
     }
 }
 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');
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (!AdminCore::auth()) {
         if (!$this->checkMembership() || !$this->group->chatroulette) {
             $this->paymentRedirect();
         }
     }
 }
Exemplo n.º 4
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');
     }
 }
Exemplo n.º 5
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');
     }
 }
Exemplo n.º 6
0
 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');
     }
 }
Exemplo n.º 7
0
 public function __construct()
 {
     parent::__construct();
     $oAffModel = new AffiliateModel();
     $iProfileId = AdminCore::auth() && !Affiliate::auth() && $this->httpRequest->getExists('profile_id') ? $this->httpRequest->get('profile_id', 'int') : $this->session->get('affiliate_id');
     $oAff = $oAffModel->readProfile($iProfileId, 'Affiliates');
     if (!$this->str->equals($this->httpRequest->post('bank_account'), $oAff->bankAccount)) {
         $oAffModel->updateProfile('bankAccount', $this->httpRequest->post('bank_account'), $iProfileId, 'Affiliates');
     }
     unset($oAffModel, $oAff);
     /* Clean Affiliate UserCoreModel / readProfile Cache */
     (new Framework\Cache\Cache())->start(UserCoreModel::CACHE_GROUP, 'readProfile' . $iProfileId . 'Affiliates', null)->clear();
     \PFBC\Form::setSuccess('form_bank_account', t('Your bank information has been saved successfully!'));
 }
 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();
         }
     }
 }
Exemplo n.º 9
0
 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();
         }
     }
 }
Exemplo n.º 10
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');
     }
 }
Exemplo n.º 11
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');
     }
 }
Exemplo n.º 12
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');
     }
 }
Exemplo n.º 13
0
<?php

/**
 * @author         Pierre-Henry Soria <*****@*****.**>
 * @copyright      (c) 2012-2014, Pierre-Henry Soria. All Rights Reserved.
 * @license        GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package        PH7 / App / System / Module / Game
 */
namespace PH7;

defined('PH7') or die('Restricted access');
// If the Games are not installed (no game folders) and the administrator is not logged in to add games, we will display a Not Found page with an explanatory message.
if (!AdminCore::auth()) {
    $sGamePath = PH7_PATH_PUBLIC_DATA_SYS_MOD . 'game/file';
    $sThumbPath = PH7_PATH_PUBLIC_DATA_SYS_MOD . 'game/img/thumb';
    if (!(is_dir($sGamePath) && is_dir($sThumbPath)) || !(filesize($sGamePath) > 5000 && filesize($sThumbPath) > 5000)) {
        (new Controller())->displayPageNotFound(t('Sorry, but no games seem to be installed at time.'), false);
    }
    // We disable the HTTP error code 404 for Ajax requests running
}