Преглед изворни кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV пре 9 година
родитељ
комит
1cb7f98d65

+ 14 - 2
inc/classes/BxDolDb.php

@@ -148,8 +148,11 @@ class BxDolDb extends BxDolFactory implements iBxDolSingleton
 	        ));
 
 	    	$this->pdoExec("SET NAMES 'utf8'");
-	        $this->pdoExec("SET sql_mode = ''");
-			$this->pdoExec("SET default_storage_engine=" . $this->_sStorageEngine);
+            $this->pdoExec("SET sql_mode = ''");
+
+            $sVer = $this->getVersion();
+            $sStorageEngine = !$sVer || version_compare($sVer, '5.7.5', '>=') ? 'default_storage_engine' : 'storage_engine';
+            $this->pdoExec("SET $sStorageEngine=" . $this->_sStorageEngine);
 
 			self::$_aDbCacheData = array();
     	}
@@ -501,6 +504,15 @@ class BxDolDb extends BxDolFactory implements iBxDolSingleton
     	return self::$_rLink->getAttribute(PDO::ATTR_SERVER_VERSION);
     }
 
+    /**
+     * get mysql version
+     */
+    public function getVersion()
+    {
+        $s = $this->getOne("SELECT VERSION()");
+        return preg_match("/([0-9\.]+)/", $s, $m) ? $m[1] : false;
+    }
+    
     /**
      * get list of tables in database
      */

+ 16 - 0
inc/classes/BxDolProfileUndefined.php

@@ -133,6 +133,22 @@ class BxDolProfileUndefined extends BxDolFactory implements iBxDolSingleton, iBx
         return '';
     }
 
+    /**
+     * @see iBxDolProfile::checkAllowedProfileView
+     */
+    public function checkAllowedProfileView($iProfileId = 0)
+    {
+        return CHECK_ACTION_RESULT_ALLOWED;
+    }
+
+    /**
+     * @see iBxDolProfile::checkAllowedPostInProfile
+     */
+    public function checkAllowedPostInProfile($iProfileId = 0)
+    {
+        return _t('_sys_txt_access_denied');
+    }
+
     /**
      * Check if profile is active
      */

+ 4 - 3
install/sql/system.sql

@@ -794,7 +794,7 @@ CREATE TABLE `sys_accounts` (
   `email` varchar(255) NOT NULL,
   `email_confirmed` tinyint(4) NOT NULL DEFAULT '0',
   `receive_updates` tinyint(4) NOT NULL DEFAULT '1',
-  `receive_news` tinyint(4) NOT NULL DEFAULT '0',
+  `receive_news` tinyint(4) NOT NULL DEFAULT '1',
   `password` varchar(40) NOT NULL,
   `salt` varchar(10) NOT NULL,
   `role` tinyint(4) NOT NULL DEFAULT '1',
@@ -2720,8 +2720,9 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('sys_account_create', 'name', 2147483647, 1, 1),
 ('sys_account_create', 'email', 2147483647, 1, 2),
 ('sys_account_create', 'password', 2147483647, 1, 3),
-('sys_account_create', 'do_submit', 2147483647, 1, 4),
-('sys_account_create', 'agreement', 2147483647, 1, 5),
+('sys_account_create', 'receive_news', 2147483647, 1, 4),
+('sys_account_create', 'do_submit', 2147483647, 1, 5),
+('sys_account_create', 'agreement', 2147483647, 1, 7),
 
 ('sys_account_settings_email', 'email', 2147483647, 1, 1),
 ('sys_account_settings_email', 'password_current', 2147483647, 1, 2),

+ 8 - 2
modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

@@ -115,8 +115,14 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
         $CNF = &$this->_oModule->_oConfig->CNF;
 
         // check access
-        if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->_oModule->checkAllowedAdd()))
-            return MsgBox($sMsg);
+        if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->_oModule->checkAllowedAdd())) {
+            $oProfile = BxDolProfile::getInstance();
+            $aProfileInfo = $oProfile->getInfo();
+            if ($aProfileInfo['type'] == 'system' && is_subclass_of($this->_oModule, 'BxBaseModProfileModule') && $this->_oModule->serviceActAsProfile()) // special check for system profile is needed, because of incorrect error message
+                return MsgBox(_t('_sys_txt_access_denied'));
+            else
+                return MsgBox($sMsg);
+        }
 
         // check and display form
         $oForm = $this->getObjectFormAdd();

+ 1 - 1
template/layout_1_column.html

@@ -1,5 +1,5 @@
 <!-- layout 1 column [ start ] -->
-<div class="bx-layout-wrapper bx-layout-1-column bx-layout-column-fullwidth">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-1-column bx-layout-column-fullwidth">
     <bx_include_auto:_row_1_column.html />
 </div>
 <!-- layout 1 column [  end  ] -->

+ 1 - 1
template/layout_2_columns.html

@@ -1,5 +1,5 @@
 <!-- layout 2 columns [ start ] -->
-<div class="bx-layout-wrapper bx-layout-2-columns">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-2-columns">
     <div class="bx-layout-row bx-clearfix">
         <div class="bx-layout-col bx-layout-2-columns-column1 bx-layout-column-half">
             <div class="bx-layout-cell bx-def-padding-sec-right" id="bx-layout-cell-1">

+ 1 - 1
template/layout_3_columns.html

@@ -1,5 +1,5 @@
 <!-- layout 3 columns [ start ] -->
-<div class="bx-layout-wrapper bx-layout-3-columns">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-3-columns">
     <div class="bx-layout-row bx-clearfix">
         <div class="bx-layout-col bx-layout-3-columns-column1 bx-layout-column-thin">
             <div class="bx-layout-cell bx-def-padding-sec-right" id="bx-layout-cell-1">

+ 1 - 1
template/layout_bar_left.html

@@ -1,5 +1,5 @@
 <!-- layout bar left [ start ] -->
-<div class="bx-layout-wrapper bx-layout-bar-left">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-bar-left">
     <div class="bx-layout-row bx-clearfix">
         <div class="bx-layout-col bx-layout-bar-left-bar bx-layout-column-thin">
             <div class="bx-layout-cell bx-def-padding-sec-right" id="bx-layout-cell-1">

+ 1 - 1
template/layout_bar_right.html

@@ -1,5 +1,5 @@
 <!-- layout bar right [ start ] -->
-<div class="bx-layout-wrapper bx-layout-bar-right">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-bar-right">
     <div class="bx-layout-row bx-clearfix">
         <div class="bx-layout-col bx-layout-bar-right-content bx-layout-column-wide">
             <div class="bx-layout-cell bx-def-padding-sec-right" id="bx-layout-cell-1">

+ 1 - 1
template/layout_bottom_area_2_columns.html

@@ -1,5 +1,5 @@
 <!-- layout top area 2 columns [ start ] -->
-<div class="bx-layout-wrapper bx-layout-top-area-2-columns">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-top-area-2-columns">
 
     <div class="bx-layout-row bx-clearfix">
         <div class="bx-layout-col bx-layout-2-columns-column1 bx-layout-column-half">

+ 1 - 1
template/layout_top_area_2_columns.html

@@ -1,5 +1,5 @@
 <!-- layout top area 2 columns [ start ] -->
-<div class="bx-layout-wrapper bx-layout-top-area-2-columns">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-top-area-2-columns">
 
     <bx_include_auto:_row_1_column.html />
 

+ 1 - 1
template/layout_top_area_3_columns.html

@@ -1,5 +1,5 @@
 <!-- layout top area 3 columns [ start ] -->
-<div class="bx-layout-wrapper bx-layout-top-area-3-columns">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-top-area-3-columns">
 
     <bx_include_auto:_row_1_column.html />
 

+ 1 - 1
template/layout_top_area_bar_left.html

@@ -1,5 +1,5 @@
 <!-- layout top area bar left [ start ] -->
-<div class="bx-layout-wrapper bx-layout-top-area-bar-left">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-top-area-bar-left">
 
     <bx_include_auto:_row_1_column.html />
 

+ 1 - 1
template/layout_top_area_bar_right.html

@@ -1,5 +1,5 @@
 <!-- layout top area bar right [ start ] -->
-<div class="bx-layout-wrapper bx-layout-top-area-bar-right">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-top-area-bar-right">
 
     <bx_include_auto:_row_1_column.html />
 

+ 1 - 1
template/layout_topbottom_area_2_columns.html

@@ -1,5 +1,5 @@
 <!-- layout top area 2 columns [ start ] -->
-<div class="bx-layout-wrapper bx-layout-top-area-2-columns">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-top-area-2-columns">
 
     <bx_include_auto:_row_1_column.html />
 

+ 1 - 1
template/layout_topbottom_area_bar_left.html

@@ -1,5 +1,5 @@
 <!-- layout top & bottom areas bar left [ start ] -->
-<div class="bx-layout-wrapper bx-layout-topbottom-area-bar-left">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-topbottom-area-bar-left">
 
     <bx_include_auto:_row_1_column.html />
 

+ 1 - 1
template/layout_topbottom_area_bar_right.html

@@ -1,5 +1,5 @@
 <!-- layout top & bottom areas bar right [ start ] -->
-<div class="bx-layout-wrapper bx-layout-topbottom-area-bar-right">
+<div id="__page_id__" class="bx-layout-wrapper bx-layout-topbottom-area-bar-right">
 
     <bx_include_auto:_row_1_column.html />
 

+ 3 - 1
template/scripts/BxBasePage.php

@@ -166,7 +166,9 @@ class BxBasePage extends BxDolPage
 			pow(2, BX_DB_HIDDEN_DESKTOP - 1) => 'bx-def-media-desktop-hide'
 		);
 
-        $aVars = array ();
+        $aVars = array (
+            'page_id' => 'bx-page-' . $this->_aObject['uri'],
+        );
         $aBlocks = $this->_oQuery->getPageBlocks();
         foreach ($aBlocks as $sKey => $aCell) {
             $sCell = '';