public function rating() { /*** JS File Only to Members. For its part, the Rating System will redirect the visitors who are not connected to the registration form. ***/ if (UserCore::auth()) { $this->design->addJs(PH7_LAYOUT . PH7_SYS . PH7_MOD . $this->registry->module . PH7_SH . PH7_TPL . PH7_TPL_MOD_NAME . PH7_SH . PH7_JS, 'script.js'); } /*** Meta Tags ***/ /** * @internal We can include HTML tags in the title since the template will erase them before display. */ $sMenDesc = t('You men!') . '<br />' . t('Vote for the most beautiful women, the sexiest and hottest online dating free site!'); $sWomenDesc = t('You women!') . '<br />' . t('Vote for the best men, the sexiest and hottest free online dating site!'); $this->view->page_title = t('Hot On Not - Free Online Dating Site'); $this->view->meta_description = $sMenDesc . ' ' . $sWomenDesc; $this->view->meta_keywords = t('hot, hot or not, hotornot, sexy, rate, rating, voting, women, free, dating, speed dating, flirt'); $this->view->desc_for_man = $sMenDesc; $this->view->desc_for_woman = $sWomenDesc; /*** Display ***/ // If the user is connected, we do not display its own avarar since this user can not vote for himself. $iProfileId = UserCore::auth() ? $this->session->get('member_id') : null; $oData = $this->oHoNModel->getPicture($iProfileId); if (empty($oData)) { Framework\Http\Http::setHeadersByCode(404); $this->view->error = t('Sorry, We did not find the photo to Hot Or Not Party.'); } else { $this->view->avatarDesign = new AvatarDesignCore(); // Avatar Design Class $this->view->data = $oData; } $this->output(); }
public function __construct() { parent::__construct(); if (!UserCore::auth()) { $this->signUpRedirect(); } elseif (!$this->checkMembership() || !$this->group->love_calculator) { $this->paymentRedirect(); } }
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'); } }
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'); } }
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(); } } }
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(); } } }
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'); } }
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'); } }
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'); } }
public function index() { // Display home page of web site // We must not put the title as this is the home page, so this is the default title is used. /**** BEGIN Style sheet and JS files ****/ // Only visitors if (!UserCore::auth()) { $this->view->is_splash_page = Framework\Mvc\Model\DbConfig::getSetting('splashPage'); $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'splash.css,tooltip.css,js/jquery/carousel.css'); $this->design->addJs(PH7_DOT, PH7_STATIC . PH7_JS . 'jquery/carouFredSel.js,' . PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_JS . 'splash.js'); } // Only Members if (UserCore::auth()) { $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'zoomer.css'); $this->design->addJs(PH7_STATIC . PH7_JS, 'zoomer.js,Wall.js'); $this->view->first_name = $this->session->get('member_first_name'); // First Name for the welcome message. } /**** END Style sheet and JS files ****/ // For Profiles Carousel $this->view->userDesignModel = new UserDesignCoreModel(); $this->view->userDesign = new UserDesignCore(); $this->output(); }
<?php /** * @author Pierre-Henry Soria <*****@*****.**> * @copyright (c) 2012-2016, 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 / User */ namespace PH7; defined('PH7') or die('Restricted access'); // Automatic connection if (!UserCore::auth() && Framework\Registry\Registry::getInstance()->action != 'soon') { $oCookie = new Framework\Cookie\Cookie(); if ($oCookie->exists(array('member_remember', 'member_id'))) { if ((new ExistsCoreModel())->id($oCookie->get('member_id'))) { $oUserModel = new UserCoreModel(); $oUser = $oUserModel->readProfile($oCookie->get('member_id')); if ($oCookie->get('member_remember') === Framework\Security\Security::hashCookie($oUser->password)) { (new UserCore())->setAuth($oUser, $oUserModel, new Framework\Session\Session()); } } } unset($oCookie); }
<?php /** * @title Set User Last Activity * * @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 / User / Asset / Ajax * @version 1.0 */ namespace PH7; defined('PH7') or exit('Restricted access'); // Only for members if (UserCore::auth()) { (new UserCoreModel())->setLastActivity((new Framework\Session\Session())->get('member_id')); }