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
// instead of the previous require_once(CASH_PLATFORM_PATH) call, we manually
// load CASHSystem and set admin_primary_cash_request to the first CASHRequest set
include_once dirname(CASH_PLATFORM_PATH) . '/classes/core/CASHSystem.php';
include_once dirname(CASH_PLATFORM_PATH) . '/lib/mustache/Mustache.php';
$admin_primary_cash_request = CASHSystem::startUp(true);
// admin-specific autoloader
function cash_admin_autoloadCore($classname)
{
    $file = ADMIN_BASE_PATH . '/classes/' . $classname . '.php';
    if (file_exists($file)) {
        require_once $file;
    }
}
spl_autoload_register('cash_admin_autoloadCore');
// make an object to use throughout the pages
$cash_admin = new AdminCore($admin_primary_cash_request->sessionGet('cash_effective_user'), $admin_primary_cash_request);
$cash_admin->mustache_groomer = new Mustache();
$cash_admin->page_data['www_path'] = ADMIN_WWW_BASE_PATH;
$cash_admin->page_data['public_url'] = CASH_PUBLIC_URL;
$cash_admin->page_data['platform_version'] = CASHRequest::$version;
// basic script vars
$pages_path = ADMIN_BASE_PATH . '/components/pages/';
$request_parameters = null;
$admin_theme = 'default';
// set AJAX or not:
$cash_admin->page_data['data_only'] = isset($_REQUEST['data_only']);
// basic rendering options based on optional constants from constants.php
$cash_admin->page_data['jquery_url'] = defined('JQUERY_URL') ? JQUERY_URL : ADMIN_WWW_BASE_PATH . '/ui/default/assets/scripts/jquery.min.js';
$cash_admin->page_data['jqueryui_url'] = defined('JQUERYUI_URL') ? JQUERYUI_URL : ADMIN_WWW_BASE_PATH . '/ui/default/assets/scripts/jquery-ui.min.js';
$cash_admin->page_data['cdn_url'] = defined('CDN_URL') ? CDN_URL : ADMIN_WWW_BASE_PATH;
$cash_admin->page_data['show_beta'] = defined('SHOW_BETA') ? SHOW_BETA : false;
Exemplo n.º 14
0
    $login_details = AdminHelper::doLogin($_POST['address'], $_POST['password']);
    if ($login_details !== false) {
        $admin_primary_cash_request->sessionSet('cash_actual_user', $login_details);
        $admin_primary_cash_request->sessionSet('cash_effective_user', $login_details);
        $admin_primary_cash_request->sessionSet('cash_effective_user_email', $_POST['address']);
        if ($include_filename == 'logout.php') {
            header('Location: ' . ADMIN_WWW_BASE_PATH);
            exit;
        }
    } else {
        $admin_primary_cash_request->sessionClearAll();
        $login_message = "Try Again";
    }
}
// make a few objects to use throughout the pages
$cash_admin = new AdminCore($admin_primary_cash_request->sessionGet('cash_effective_user'));
if (isset($_GET['hidebanner'])) {
    $current_settings = $cash_admin->getUserSettings();
    if (isset($current_settings['banners'][BASE_PAGENAME])) {
        $current_settings['banners'][BASE_PAGENAME] = false;
        $cash_admin->setUserSettings($current_settings);
    }
}
// finally, output the template and page-specific markup (checking for current login)
if ($admin_primary_cash_request->sessionGet('cash_actual_user')) {
    include $pages_path . 'definitions/' . $include_filename;
    include ADMIN_BASE_PATH . '/ui/default/top.php';
    include $pages_path . 'markup/' . $include_filename;
    include ADMIN_BASE_PATH . '/ui/default/bottom.php';
} else {
    include ADMIN_BASE_PATH . '/ui/default/login.php';
Exemplo n.º 15
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
}