Пример #1
0
 public function __construct()
 {
     parent::__construct();
     /***** Securing the server for DDoS attack only! Not for the attacks DoS *****/
     if (!isDebug() && M\DbConfig::getSetting('DDoS')) {
         $oDDoS = new Stop();
         if ($oDDoS->cookie() || $oDDoS->session()) {
             sleep(PH7_DDOS_DELAY_SLEEP);
         }
         unset($oDDoS);
     }
     /*
     if ($this->browser->isMobile())
     {
         \PH7\Framework\Url\HeaderUrl::redirect('mobile');
     }
     */
     /***** Assign the values for Registry Class *****/
     // URL
     $this->registry->site_url = PH7_URL_ROOT;
     $this->registry->url_relative = PH7_RELATIVE;
     $this->registry->page_ext = PH7_PAGE_EXT;
     // Site Name
     $this->registry->site_name = M\DbConfig::getSetting('siteName');
     /***** Internationalization *****/
     // Default path language
     $this->lang->load('global', PH7_PATH_APP_LANG);
     /***** PH7Tpl Template Engine initialization *****/
     /*** Assign the global variables ***/
     /*** Objects ***/
     $this->view->config = $this->config;
     $this->view->design = $this->design;
     /***** Info *****/
     $oInfo = M\DbConfig::getMetaMain(PH7_LANG_NAME);
     $aMetaVars = ['site_name' => $this->registry->site_name, 'page_title' => $oInfo->pageTitle, 'slogan' => $oInfo->slogan, 'meta_description' => $oInfo->metaDescription, 'meta_keywords' => $oInfo->metaKeywords, 'meta_author' => $oInfo->metaAuthor, 'meta_robots' => $oInfo->metaRobots, 'meta_copyright' => $oInfo->metaCopyright, 'meta_rating' => $oInfo->metaRating, 'meta_distribution' => $oInfo->metaDistribution, 'meta_category' => $oInfo->metaCategory, 'header' => 0];
     $this->view->assigns($aMetaVars);
     unset($oInfo);
     /**
      * This test is not necessary because if there is no session,
      * the get() method of the \PH7\Framework\Session\Session object an empty value and revisit this avoids having undefined variables in some modules (such as the "connect" module).
      */
     //if (\PH7\UserCore::auth()) {
     $this->view->count_unread_mail = \PH7\MailCoreModel::countUnreadMsg($this->session->get('member_id'));
     $this->view->count_pen_friend_request = \PH7\FriendCoreModel::getPenFd($this->session->get('member_id'));
     //}
     /***** Display *****/
     $this->view->setTemplateDir($this->registry->path_module_views . PH7_TPL_MOD_NAME);
     /***** End Template Engine PH7Tpl *****/
     // For permission the modules
     if (is_file($this->registry->path_module_config . 'Permission.php')) {
         require $this->registry->path_module_config . 'Permission.php';
         new \PH7\Permission();
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->_ddosProtection();
     /***** Assign the values for Registry Class *****/
     // URL
     $this->registry->site_url = PH7_URL_ROOT;
     $this->registry->url_relative = PH7_RELATIVE;
     $this->registry->page_ext = PH7_PAGE_EXT;
     // Site Name
     $this->registry->site_name = M\DbConfig::getSetting('siteName');
     /***** Internationalization *****/
     // Default path language
     $this->lang->load('global', PH7_PATH_APP_LANG);
     /***** PH7Tpl Template Engine initialization *****/
     /*** Assign the global variables ***/
     /*** Objects ***/
     $this->view->config = $this->config;
     $this->view->design = $this->design;
     /***** Info *****/
     $oInfo = M\DbConfig::getMetaMain(PH7_LANG_NAME);
     $aMetaVars = ['site_name' => $this->registry->site_name, 'page_title' => $oInfo->pageTitle, 'slogan' => $oInfo->slogan, 'meta_description' => $oInfo->metaDescription, 'meta_keywords' => $oInfo->metaKeywords, 'meta_author' => $oInfo->metaAuthor, 'meta_robots' => $oInfo->metaRobots, 'meta_copyright' => $oInfo->metaCopyright, 'meta_rating' => $oInfo->metaRating, 'meta_distribution' => $oInfo->metaDistribution, 'meta_category' => $oInfo->metaCategory, 'header' => 0, 'is_disclaimer' => (bool) M\DbConfig::getSetting('disclaimer'), 'is_cookie_consent_bar' => (bool) M\DbConfig::getSetting('cookieConsentBar'), 'country' => Geo::getCountry(), 'city' => Geo::getCity()];
     $this->view->assigns($aMetaVars);
     $aModsEnabled = ['is_connect_enabled' => SysMod::isEnabled('connect'), 'is_affiliate_enabled' => SysMod::isEnabled('affiliate'), 'is_game_enabled' => SysMod::isEnabled('game'), 'is_chat_enabled' => SysMod::isEnabled('chat'), 'is_chatroulette_enabled' => SysMod::isEnabled('chatroulette'), 'is_picture_enabled' => SysMod::isEnabled('picture'), 'is_video_enabled' => SysMod::isEnabled('video'), 'is_hotornot_enabled' => SysMod::isEnabled('hotornot'), 'is_forum_enabled' => SysMod::isEnabled('forum'), 'is_note_enabled' => SysMod::isEnabled('note'), 'is_blog_enabled' => SysMod::isEnabled('blog'), 'is_newsletter_enabled' => SysMod::isEnabled('newsletter'), 'is_invite_enabled' => SysMod::isEnabled('invite'), 'is_webcam_enabled' => SysMod::isEnabled('webcam')];
     $this->view->assigns($aModsEnabled);
     unset($oInfo, $aMetaVars, $aModsEnabled);
     /**
      * This below PHP condition is not necessary because if there is no session,
      * the get() method of the \PH7\Framework\Session\Session object an empty value and revisit this avoids having undefined variables in some modules (such as the "connect" module).
      */
     //if (\PH7\UserCore::auth()) {
     $this->view->count_unread_mail = \PH7\MailCoreModel::countUnreadMsg($this->session->get('member_id'));
     $this->view->count_pen_friend_request = \PH7\FriendCoreModel::getPending($this->session->get('member_id'));
     //}
     /***** Display *****/
     $this->view->setTemplateDir($this->registry->path_module_views . PH7_TPL_MOD_NAME);
     /***** End Template Engine PH7Tpl *****/
     $this->_checkPerms();
     $this->_checkModStatus();
     $this->_checkBanStatus();
     $this->_checkSiteStatus();
 }
 public function __construct()
 {
     parent::__construct();
     $this->group = UserCoreModel::checkGroup();
 }
Пример #4
0
 public function __construct()
 {
     parent::__construct();
     $this->iTime = time();
     $this->_oUri = Uri::getInstance();
 }
Пример #5
0
 public function __construct()
 {
     $this->sDir = PH7_PATH_LOG . static::LOG_DIR;
     $this->sFileName = 'pH7log-' . date('d_m_Y');
     parent::__construct();
 }