Procházet zdrojové kódy

#3750 Setting to lock site for guests

Alex Trofimov před 4 roky
rodič
revize
2e062e723e
2 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. 1 1
      inc/classes/BxDolPage.php
  2. 4 1
      install/sql/system.sql

+ 1 - 1
inc/classes/BxDolPage.php

@@ -642,7 +642,7 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
                 $sVal = trim($sVal);
                 $sVal = trim($sVal);
             });
             });
             $aI = array_combine($aURIs, array_fill(0, count($aURIs), 1));
             $aI = array_combine($aURIs, array_fill(0, count($aURIs), 1));
-            if (!preg_match('/\/oauth2\//', $_SERVER['REQUEST_URI']) && !preg_match('/searchKeyword.php$/', $_SERVER['PHP_SELF']) && !preg_match('/member.php$/', $_SERVER['PHP_SELF']) && !isset($aI[$this->_aObject['uri']])) {
+            if (!preg_match('/\/oauth2\//', $_SERVER['REQUEST_URI']) /*&& !preg_match('/searchKeyword.php$/', $_SERVER['PHP_SELF'])*/ && !preg_match('/member.php$/', $_SERVER['PHP_SELF']) && !isset($aI[$this->_aObject['uri']])) {
                 if ($bRedirectToLoginFormForUnauthenticated) {
                 if ($bRedirectToLoginFormForUnauthenticated) {
                     header("Location: " . bx_append_url_params(BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=login'), ['relocate' => bx_get_self_url()]));
                     header("Location: " . bx_append_url_params(BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=login'), ['relocate' => bx_get_self_url()]));
                     exit;
                     exit;

+ 4 - 1
install/sql/system.sql

@@ -485,7 +485,10 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 
 (@iCategoryId, 'sys_cf_enable', '_adm_stg_cpt_option_sys_cf_enable', 'on', 'checkbox', '', '', '', 40),
 (@iCategoryId, 'sys_cf_enable', '_adm_stg_cpt_option_sys_cf_enable', 'on', 'checkbox', '', '', '', 40),
 (@iCategoryId, 'sys_cf_enable_comments', '_adm_stg_cpt_option_sys_cf_enable_comments', 'on', 'checkbox', '', '', '', 41),
 (@iCategoryId, 'sys_cf_enable_comments', '_adm_stg_cpt_option_sys_cf_enable_comments', 'on', 'checkbox', '', '', '', 41),
-(@iCategoryId, 'sys_cf_prohibited', '_adm_stg_cpt_option_sys_cf_prohibited', '', 'list', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"get_options_cf_prohibited";s:6:"params";a:0:{}s:5:"class";s:13:"TemplServices";}', '', '', 42);
+(@iCategoryId, 'sys_cf_prohibited', '_adm_stg_cpt_option_sys_cf_prohibited', '', 'list', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"get_options_cf_prohibited";s:6:"params";a:0:{}s:5:"class";s:13:"TemplServices";}', '', '', 42),
+
+(@iCategoryId, 'sys_lock_from_unauthenticated', '_adm_stg_cpt_option_sys_lock_from_unauthenticated', '', 'checkbox', '', '', '', 50),
+(@iCategoryId, 'sys_lock_from_unauthenticated_exceptions', '_adm_stg_cpt_option_sys_lock_from_unauthenticated_exceptions', 'login,forgot-password,create-account,confirm-email,terms,privacy,contact,about,home', 'text', '', '', '', 52);
 
 
 --
 --
 -- CATEGORY: Site Settings
 -- CATEGORY: Site Settings