Răsfoiți Sursa

#53 - make logs folder writable, add param for adding nofollow attr

Alex Trofimov 12 ani în urmă
părinte
comite
115e0fabc4

+ 7 - 0
build.xml

@@ -128,6 +128,7 @@
 
         <chmod file="${deploy_path}/cache" mode="0777" />
         <chmod file="${deploy_path}/cache_public" mode="0777" />
+        <chmod file="${deploy_path}/logs" mode="0777" />
         <chmod file="${deploy_path}/tmp" mode="0777" />
         <chmod file="${deploy_path}/storage" mode="0777" />
 
@@ -157,6 +158,12 @@
                 <exclude name=".htaccess" />
             </fileset>
         </delete>
+        <delete includeemptydirs="true">
+            <fileset dir="${project.basedir}/logs">
+                <include name="**/*" />
+                <exclude name=".htaccess" />
+            </fileset>
+        </delete>
         <delete includeemptydirs="true">
             <fileset dir="${project.basedir}/tmp">
                 <include name="**/*" />

+ 2 - 6
inc/classes/BxDolConfig.php

@@ -65,13 +65,9 @@ class BxDolConfig extends BxDol implements iBxDolSingleton
 
     function init() 
     {
-        $this->aUrlDynamic = array(
-            'tmp' => BX_DOL_URL_ROOT . 'tmp/',
-        );
+        $this->aUrlDynamic = array();
 
-        $this->aPathDynamic = array(
-            'tmp' => BX_DIRECTORY_PATH_ROOT . 'tmp/',
-        );
+        $this->aPathDynamic = array();
 
         $this->aDb = array(
             'visual_processing' => true,

+ 1 - 1
inc/classes/BxDolDb.php

@@ -807,7 +807,7 @@ EOJ;
 
     function log ($s) 
     {
-        return file_put_contents(BX_DIRECTORY_PATH_ROOT . 'tmp/db.err.log', date('Y-m-d H:i:s') . "\t" . $s . "\n", FILE_APPEND);
+        return file_put_contents(BX_DIRECTORY_PATH_ROOT . 'logs/db.err.log', date('Y-m-d H:i:s') . "\t" . $s . "\n", FILE_APPEND);
     }
 
     function executeSQL($sPath, $aReplace = array (), $isBreakOnError = true) 

+ 1 - 1
inc/utils.inc.php

@@ -451,7 +451,7 @@ function clear_xss($val) {
         $oConfig->set('Output.FlashCompat', 'true');
         $oConfig->set('HTML.FlashAllowFullScreen', 'true');
 
-        if (getParam('sys_add_nofollow')) { // TODO: add to  "Security" settings
+        if (getParam('sys_add_nofollow')) {
             $sHost = parse_url(BX_DOL_URL_ROOT, PHP_URL_HOST);
             $oConfig->set('URI.Host', $sHost);
             $oConfig->set('HTML.Nofollow', 'true');

+ 5 - 5
install/sql/system.sql

@@ -327,11 +327,11 @@ INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `or
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'sys_security_form_token_enable', '_adm_stg_cpt_option_sys_security_form_token_enable', 'on', 'checkbox', '', '', '', 6),
-(@iCategoryId, 'sys_security_form_token_lifetime', '_adm_stg_cpt_option_sys_security_form_token_lifetime', '86400', 'digit', '', '', '', 7),
-(@iCategoryId, 'sys_recaptcha_key_public', '_adm_stg_cpt_option_sys_recaptcha_key_public', '', 'digit', '', '', '', 14),
-(@iCategoryId, 'sys_recaptcha_key_private', '_adm_stg_cpt_option_sys_recaptcha_key_private', '', 'digit', '', '', '', 15);
-
+(@iCategoryId, 'sys_security_form_token_enable', '_adm_stg_cpt_option_sys_security_form_token_enable', 'on', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'sys_security_form_token_lifetime', '_adm_stg_cpt_option_sys_security_form_token_lifetime', '86400', 'digit', '', '', '', 11),
+(@iCategoryId, 'sys_recaptcha_key_public', '_adm_stg_cpt_option_sys_recaptcha_key_public', '', 'digit', '', '', '', 20),
+(@iCategoryId, 'sys_recaptcha_key_private', '_adm_stg_cpt_option_sys_recaptcha_key_private', '', 'digit', '', '', '', 21),
+(@iCategoryId, 'sys_add_nofollow', '_adm_stg_cpt_option_sys_add_nofollow', 'on', 'checkbox', '', '', '', 30);
 
 --
 -- CATEGORY: Site Settings

+ 1 - 0
modules/boonex/english/data/langs/system.xml

@@ -1099,6 +1099,7 @@
 	<string name="_adm_stg_cpt_option_site_title"><![CDATA[Site title]]></string>
 	<string name="_adm_stg_cpt_option_sys_account_autoapproval"><![CDATA[Automatic account activation after creation]]></string>
 	<string name="_adm_stg_cpt_option_sys_account_default_acl_level"><![CDATA[Default member's level to assign after account creation]]></string>
+	<string name="_adm_stg_cpt_option_sys_add_nofollow"><![CDATA[Add "nofollow" attribute for external links]]></string>
 	<string name="_adm_stg_cpt_option_sys_cache_memcache_host"><![CDATA[Memcached server host]]></string>
 	<string name="_adm_stg_cpt_option_sys_cache_memcache_port"><![CDATA[Memcached server port]]></string>
 	<string name="_adm_stg_cpt_option_sys_db_cache_enable"><![CDATA[Enable DB cache]]></string>

+ 1 - 1
studio/classes/BxDolStudioTools.php

@@ -32,9 +32,9 @@ class BxDolStudioTools extends BxDolIO
             'inc',
             'cache',
             'cache_public',
+            'logs',
             'tmp',
             'storage',
-//            'plugins/ffmpeg/ffmpeg.exe',
         );
 
         $this->aPostInstallPermissions = array(

+ 1 - 1
template/scripts/BxBaseFormView.php

@@ -1178,7 +1178,7 @@ BLAH;
 
             $aUiLangs = array ('af' => 1, 'ar-DZ' => 1, 'ar' => 1, 'az' => 1, 'be' => 1, 'bg' => 1, 'bs' => 1, 'ca' => 1, 'cs' => 1, 'cy-GB' => 1, 'da' => 1, 'de' => 1, 'el' => 1, 'en-AU' => 1, 'en-GB' => 1, 'en-NZ' => 1, 'en' => 1, 'eo' => 1, 'es' => 1, 'et' => 1, 'eu' => 1, 'fa' => 1, 'fi' => 1, 'fo' => 1, 'fr-CA' => 1, 'fr-CH' => 1, 'fr' => 1, 'gl' => 1, 'he' => 1, 'hi' => 1, 'hr' => 1, 'hu' => 1, 'hy' => 1, 'id' => 1, 'is' => 1, 'it' => 1, 'ja' => 1, 'ka' => 1, 'kk' => 1, 'km' => 1, 'ko' => 1, 'ky' => 1, 'lb' => 1, 'lt' => 1, 'lv' => 1, 'mk' => 1, 'ml' => 1, 'ms' => 1, 'nb' => 1, 'nl-BE' => 1, 'nl' => 1, 'nn' => 1, 'no' => 1, 'pl' => 1, 'pt-BR' => 1, 'pt' => 1, 'rm' => 1, 'ro' => 1, 'ru' => 1, 'sk' => 1, 'sl' => 1, 'sq' => 1, 'sr-SR' => 1, 'sr' => 1, 'sv' => 1, 'ta' => 1, 'th' => 1, 'tj' => 1, 'tr' => 1, 'uk' => 1, 'vi' => 1, 'zh-CN' => 1, 'zh-HK' => 1, 'zh-TW' => 1);
 
-            $aCalendarLangs = array ('af' => 1, 'bg' => 1, 'ca' => 1, 'cs' => 1, 'da' => 1, 'de' => 1, 'el' => 1, 'es' => 1, 'et' => 1, 'eu' => 1, 'fi' => 1, 'fr' => 1, 'gl' => 1, 'he' => 1, 'hr' => 1, 'hu' => 1, 'id' => 1, 'it' => 1, 'ja' => 1, 'ko' => 1, 'lt' => 1, 'nl' => 1, 'no' => 1, 'pl' => 1, 'pt-BR' => 1, 'pt' => 1, 'ro' => 1, 'ru' => 1, 'sk' => 1, 'sv' => 1, 'th' => 1, 'tr' => 1, 'uk' => 1, 'vi' => 1, 'zh-CN' => 1, 'zh-TW' => 1);
+            $aCalendarLangs = array ('af' => 1, 'am' => 1, 'bg' => 1, 'ca' => 1, 'cs' => 1, 'da' => 1, 'de' => 1, 'el' => 1, 'es' => 1, 'et' => 1, 'eu' => 1, 'fi' => 1, 'fr' => 1, 'gl' => 1, 'he' => 1, 'hr' => 1, 'hu' => 1, 'id' => 1, 'it' => 1, 'ja' => 1, 'ko' => 1, 'lt' => 1, 'nl' => 1, 'no' => 1, 'pl' => 1, 'pt-BR' => 1, 'pt' => 1, 'ro' => 1, 'ru' => 1, 'sk' => 1, 'sr-RS' => 1, 'sr-YU' => 1, 'sv' => 1, 'th' => 1, 'tr' => 1, 'uk' => 1, 'vi' => 1, 'zh-CN' => 1, 'zh-TW' => 1);
 
             bx_import('BxDolLanguages');
             $sCalendarLang = BxDolLanguages::getInstance()->detectLanguageFromArray ($aCalendarLangs);