Pārlūkot izejas kodu

#35 - modules pre-installation

Alex Trofimov 12 gadi atpakaļ
vecāks
revīzija
e3533a1d65
35 mainītis faili ar 139 papildinājumiem un 136 dzēšanām
  1. 1 1
      inc/classes/BxDol.php
  2. 22 8
      inc/classes/BxDolDb.php
  3. 1 1
      inc/classes/BxDolIO.php
  4. 1 1
      inc/classes/BxDolParams.php
  5. 1 1
      inc/classes/BxDolTemplate.php
  6. 1 1
      inc/classes/BxDolXmlParser.php
  7. 3 7
      inc/design.inc.php
  8. 3 2
      inc/security.inc.php
  9. 5 1
      inc/utils.inc.php
  10. 1 1
      install/classes/BxDolInstallController.php
  11. 1 1
      install/classes/BxDolInstallLang.php
  12. 1 1
      install/classes/BxDolInstallModulesTools.php
  13. 16 2
      install/classes/BxDolInstallSiteConfig.php
  14. 1 1
      install/classes/BxDolInstallView.php
  15. 2 2
      install/index.php
  16. 8 6
      install/patterns/header.inc.php
  17. 3 1
      modules/boonex/contact/install/config.php
  18. 1 1
      modules/boonex/contact/request.php
  19. 12 20
      modules/boonex/developer/install/config.php
  20. 13 21
      modules/boonex/english/install/config.php
  21. 1 1
      modules/boonex/notes/install/config.php
  22. 1 1
      modules/boonex/persons/install/config.php
  23. 1 1
      modules/boonex/profiler/install/config.php
  24. 13 21
      modules/boonex/russian/install/config.php
  25. 1 1
      modules/boonex/sites/install/config.php
  26. 1 1
      modules/boonex/smtpmailer/install/config.php
  27. 3 1
      modules/boonex/timeline/install/config.php
  28. 12 20
      modules/boonex/uni/install/config.php
  29. 1 1
      studio/classes/BxDolStudioInstaller.php
  30. 1 1
      studio/classes/BxDolStudioTemplate.php
  31. 1 1
      studio/classes/BxDolStudioTools.php
  32. 2 2
      studio/classes/BxDolStudioToolsAudit.php
  33. 2 2
      studio/inc/utils.inc.php
  34. 1 1
      template/scripts/BxBaseConfig.php
  35. 1 1
      template/scripts/BxBasePage.php

+ 1 - 1
inc/classes/BxDol.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 22 - 8
inc/classes/BxDolDb.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -14,7 +14,6 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
     var $host, $port, $socket, $dbname, $user, $password, $link;
     var $current_res, $current_arr_type;
 
-    var $oParams = null;
     var $oDbCacheObject = null;
 
     /**
@@ -53,11 +52,6 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
         } else {
             $this->link = $GLOBALS['bx_db_link'];
         }
-
-        if (false === $aDbConf) {
-            bx_import('BxDolParams');
-            $this->oParams = BxDolParams::getInstance($this);
-        }
     }
 
     /**
@@ -68,6 +62,26 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
             trigger_error('Clone is not allowed for the class: ' . get_class($this), E_USER_ERROR);
     }
 
+    public function __get($sName)
+    {
+        if ('oParams' == $sName) {
+            bx_import('BxDolParams');
+            return BxDolParams::getInstance($this);
+        }
+
+        $aTrace = debug_backtrace();
+        trigger_error('Undefined property via __get(): ' . $sName . ' in ' . $aTrace[0]['file'] . ' on line ' . $aTrace[0]['line'], E_USER_NOTICE);
+
+        return null;
+    }
+
+    public function __isset($sName)
+    {
+        if ('oParams' == $sName)
+            return true;
+        return false;
+    }
+
     /**
      * Get singleton instance of the class
      */
@@ -579,7 +593,7 @@ EOJ;
     }
 
     function genDbCacheKey ($sName) {
-        return 'db_' . $sName . '_' . md5(BX_DOL_VERSION . BX_DOL_BUILD . BX_DOL_URL_ROOT) . '.php';
+        return 'db_' . $sName . '_' . bx_site_hash() . '.php';
     }
 
     function fromCache ($sName, $sFunc) {

+ 1 - 1
inc/classes/BxDolIO.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 1 - 1
inc/classes/BxDolParams.php

@@ -27,7 +27,7 @@ class BxDolParams extends BxDol {
         $this->_oDb = $oDb;
         $this->_oCache = new BxDolCacheFile(); // feel free to change to another cache system if you are sure that it is available
 
-        $this->_sCacheFile = 'sys_options_' . md5(BX_DOL_VERSION . BX_DOL_BUILD . BX_DOL_URL_ROOT) . '.php';
+        $this->_sCacheFile = 'sys_options_' . bx_site_hash('', true) . '.php';
 
         $this->_aParams = $this->_oCache->getData($this->_sCacheFile);
         if(empty($this->_aParams) && $this->_oDb != null)

+ 1 - 1
inc/classes/BxDolTemplate.php

@@ -1806,7 +1806,7 @@ class BxDolTemplate extends BxDol implements iBxDolSingleton {
      * @return string the result of operation.
      */
     function _getCacheFileName($sType, $sAbsolutePath) {
-        $sResult = md5($sAbsolutePath . BX_DOL_VERSION . BX_DOL_BUILD . BX_DOL_URL_ROOT);
+        $sResult = bx_site_hash($sAbsolutePath);
         switch($sType) {
             case 'html':
                 $sResult = $this->_sCacheFilePrefix . bx_lang_name() . '_' . $this->_sCode .  '_' . $sResult;

+ 1 - 1
inc/classes/BxDolXmlParser.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 3 - 7
inc/design.inc.php

@@ -191,7 +191,7 @@ function getTemplateImage( $sFileName ) {
 }
 
 function getVersionComment() {
-    $aVer = explode( '.', BX_DOL_VERSION );
+    $aVer = explode('.', getParam('sys_version'));
 
     // version output made for debug possibilities.
     // randomizing made for security issues. do not change it...
@@ -199,13 +199,9 @@ function getVersionComment() {
     $aVerR[1] = rand( 0, 100 );
     $aVerR[2] = $aVer[1];
     $aVerR[3] = rand( 0, 100 );
-    $aVerR[4] = BX_DOL_BUILD;
+    $aVerR[4] = $aVer[2];
 
-    //remove leading zeros
-    while( $aVerR[4][0] === '0' )
-        $aVerR[4] = substr( $aVerR[4], 1 );
-
-    return '<!-- ' . implode( ' ', $aVerR ) . ' -->';
+    return '<!-- ' . implode(' ', $aVerR) . ' -->';
 }
 
 // ----------------------------------- site statistick functions --------------------------------------//

+ 3 - 2
inc/security.inc.php

@@ -99,7 +99,7 @@ function bx_sys_security_get_fields ($sType) {
         return array();
     }
 
-    $sCacheFile = BX_DIRECTORY_PATH_CACHE . 'sys_options_' . md5(BX_DOL_VERSION . BX_DOL_BUILD . BX_DOL_URL_ROOT) . '.php';
+    $sCacheFile = BX_DIRECTORY_PATH_CACHE . 'sys_options_' . bx_site_hash() . '.php';
     if (!file_exists($sCacheFile)) {
         require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
         require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );
@@ -121,7 +121,8 @@ function bx_sys_security_get_fields ($sType) {
 }
 
 function bx_sys_security_get_impact_threshold () {
-    $sCacheFile = BX_DIRECTORY_PATH_CACHE . 'sys_options_' . md5(BX_DOL_VERSION . BX_DOL_BUILD . BX_DOL_URL_ROOT) . '.php';
+    // TODO: remake security to check in bx_process_input function only
+    $sCacheFile = BX_DIRECTORY_PATH_CACHE . 'sys_options_' . bx_site_hash('', true) . '.php';
     if (!file_exists($sCacheFile)) {
         require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
         require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );

+ 5 - 1
inc/utils.inc.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -1452,5 +1452,9 @@ function bx_replace_markers($mixed, $aMarkers) {
     return $mixed;
 }
 
+function bx_site_hash($sSalt = '', $isSkipVersion = false) {
+    return md5($sSalt . ($isSkipVersion ? '' : getParam('sys_version')) . BX_DOL_SECRET . BX_DOL_URL_ROOT);
+}
+
 /** @} */ 
 

+ 1 - 1
install/classes/BxDolInstallController.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 1 - 1
install/classes/BxDolInstallLang.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 1 - 1
install/classes/BxDolInstallModulesTools.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 16 - 2
install/classes/BxDolInstallSiteConfig.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -318,7 +318,21 @@ EOF;
 
     public function processModules ($a) 
     {
-        return array(BX_INSTALL_ERR_GENERAL => 'TODO:<br />Language to install: ' . $a['language'] . '<br />Template to install: ' . $a['template']);
+        $oModulesTools = new BxDolInstallModulesTools();
+        $aModules = $oModulesTools->getModules();
+        require_once(BX_INSTALL_PATH_HEADER);
+        $aModules = array();
+        foreach ($aModules as $sKey) {
+            if (!isset($a[$sKey]))
+                continue;
+            $aModuleConfig = $oModulesTools->getModuleConfigByUri($a[$sKey], $aModules);
+            bx_import('BxDolStudioInstallerUtils');
+            $aResult = BxDolStudioInstallerUtils::getInstance()->perform($aModuleConfig['home_dir'], 'install');
+            if (!$aResult['result'] && !empty($aResult['message']))
+                return array(BX_INSTALL_ERR_GENERAL => $aResult['message']);
+        }
+            
+        return array();
     }
 
     protected function dbErrors2ErrorFields ($a) 

+ 1 - 1
install/classes/BxDolInstallView.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 2 - 2
install/index.php

@@ -7,8 +7,8 @@
  * @{
  */
 
-define ('BX_DOL', 1);
-define ('BX_DOL_INSTALL', 1);
+define ('BX_DOL_INSTALL',  true);
+define ('BX_SKIP_INSTALL_CHECK', true);
 
 define ('BX_DOL_VER', '8.0.0');
 

+ 8 - 6
install/patterns/header.inc.php

@@ -48,9 +48,11 @@ define('BX_DOL_TRANSCODER_OBJ_ICON_FAVICON', 'sys_icon_favicon');
 define('BX_DOL_TRANSCODER_OBJ_CMTS_IMAGE_PREVIEW', 'sys_cmts_images_preview');
 
 //--- Module types ---//
-define('BX_DOL_MODULE_TYPE_MODULE', 'module');
-define('BX_DOL_MODULE_TYPE_LANGUAGE', 'language');
-define('BX_DOL_MODULE_TYPE_TEMPLATE', 'template');
+if (!defined('BX_DOL_MODULE_TYPE_MODULE')) {
+    define('BX_DOL_MODULE_TYPE_MODULE', 'module');
+    define('BX_DOL_MODULE_TYPE_LANGUAGE', 'language');
+    define('BX_DOL_MODULE_TYPE_TEMPLATE', 'template');
+}
 
 //--- Studio settings ---//
 define('BX_DOL_STUDIO_FOLDER', 'studio');
@@ -94,13 +96,13 @@ if (defined('CHECK_DOLPHIN_REQUIREMENTS')) {
     $aErrors[] = (ini_get('register_globals') == 0) ? '' : '<font color="red">register_globals is On (warning, you should have this param in Off state, or your site will unsafe)</font>';
     $aErrors[] = (ini_get('safe_mode') == 0) ? '' : '<font color="red">safe_mode is On, disable it</font>';
     //$aErrors[] = (ini_get('allow_url_fopen') == 0) ? 'Off (warning, better keep this parameter in On to able register Dolphin' : '';
-    $aErrors[] = (version_compare(PHP_VERSION, '5.2.0', '<')) ? '<font color="red">PHP version too old, please update to PHP 5.2.0 at least</font>' : '';
+//    $aErrors[] = (version_compare(PHP_VERSION, '5.2.0', '<')) ? '<font color="red">PHP version too old, please update to PHP 5.2.0 at least</font>' : '';
     $aErrors[] = (!extension_loaded( 'mbstring')) ? '<font color="red">mbstring extension not installed. <b>Warning!</b> Dolphin cannot work without <b>mbstring</b> extension.</font>' : '';
-
+/*
     if (version_compare(phpversion(), "5.2", ">") == 1) {
         $aErrors[] = (ini_get('allow_url_include') == 0) ? '' : '<font color="red">allow_url_include is On (warning, you should have this param in Off state, or your site will unsafe)</font>';
     };
-
+*/
     $aErrors = array_diff($aErrors, array('')); //delete empty
     if (count($aErrors)) {
         $sErrors = implode(" <br /> ", $aErrors);

+ 3 - 1
modules/boonex/contact/install/config.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php 
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -84,3 +84,5 @@ $aConfig = array(
         'conclusion' => 'uninst_concl.html'
     )
 );
+
+/** @} */

+ 1 - 1
modules/boonex/contact/request.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  * 
- * @defgroup    Persons Persons
+ * @defgroup    Contact Contact
  * @ingroup     DolphinModules
  *
  * @{

+ 12 - 20
modules/boonex/developer/install/config.php

@@ -1,23 +1,13 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
+<?php 
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ * 
+ * @defgroup    Developer Developer
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
 
 $aConfig = array(
     /**
@@ -122,3 +112,5 @@ $aConfig = array(
         'conclusion' => 'uninst_concl.html'
     )
 );
+
+/** @} */

+ 13 - 21
modules/boonex/english/install/config.php

@@ -1,23 +1,13 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
+<?php 
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ * 
+ * @defgroup    English English language
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
 
 $aConfig = array(
     /**
@@ -94,4 +84,6 @@ $aConfig = array(
         'introduction' => 'uninst_intro.html',
         'conclusion' => 'uninst_concl.html'
     )
-);
+);
+
+/** @} */

+ 1 - 1
modules/boonex/notes/install/config.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php 
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 1 - 1
modules/boonex/persons/install/config.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php 
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 1 - 1
modules/boonex/profiler/install/config.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php 
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 13 - 21
modules/boonex/russian/install/config.php

@@ -1,23 +1,13 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
+<?php 
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ * 
+ * @defgroup    Russian Russian language
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
 
 $aConfig = array(
     /**
@@ -94,4 +84,6 @@ $aConfig = array(
         'introduction' => 'uninst_intro.html',
         'conclusion' => 'uninst_concl.html'
     )
-);
+);
+
+/** @} */

+ 1 - 1
modules/boonex/sites/install/config.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php 
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 1 - 1
modules/boonex/smtpmailer/install/config.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php 
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 3 - 1
modules/boonex/timeline/install/config.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php 
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -90,3 +90,5 @@ $aConfig = array(
         'conclusion' => 'uninst_concl.html'
     )
 );
+
+/** @} */

+ 12 - 20
modules/boonex/uni/install/config.php

@@ -1,23 +1,13 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
+<?php 
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ * 
+ * @defgroup    Uni Uni template
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
 
 $aConfig = array(
     /**
@@ -101,3 +91,5 @@ $aConfig = array(
         'conclusion' => 'uninst_concl.html'
     )
 );
+
+/** @} */

+ 1 - 1
studio/classes/BxDolStudioInstaller.php

@@ -183,7 +183,7 @@ class BxDolStudioInstaller extends BxDolInstallerUtils {
         if(isset($this->_aConfig['compatible_with']) && is_array($this->_aConfig['compatible_with']))
             foreach($this->_aConfig['compatible_with'] as $iKey => $sVersion) {
                 $sVersion = '/^' . str_replace(array('.', 'x'), array('\.', '[0-9]+'), $sVersion) . '$/is';
-                $bCompatible = $bCompatible || (preg_match($sVersion, BX_DOL_VERSION . '.' . BX_DOL_BUILD) > 0);
+                $bCompatible = $bCompatible || (preg_match($sVersion, getParam('sys_version')) > 0);
             }
         if(!$bCompatible)
             return array(

+ 1 - 1
studio/classes/BxDolStudioTemplate.php

@@ -84,7 +84,7 @@ class BxDolStudioTemplate extends BxDolTemplate implements iBxDolSingleton {
         $sRet = '';
         switch( $sKey ) {
             case 'version':
-                $sRet = BX_DOL_VERSION;
+                $sRet = getParam('sys_version');
                 break;
             case 'page_charset':
                 $sRet = 'UTF-8';

+ 1 - 1
studio/classes/BxDolStudioTools.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 2 - 2
studio/classes/BxDolStudioToolsAudit.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -311,7 +311,7 @@ class BxDolStudioToolsAudit extends BxDol
         else
             $sLatestDolphinVer = 'undefined';
        
-        $sDolphinVer = BX_DOL_VERSION . '.' . BX_DOL_BUILD;
+        $sDolphinVer = getParam('sys_version');
         $aMessage = array('type' => BX_DOL_AUDIT_OK);
         if (!version_compare($sDolphinVer, $sLatestDolphinVer, '>='))
             $aMessage = array('type' => BX_DOL_AUDIT_WARN, 'msg' => _t('_sys_audit_msg_version_is_outdated', $sLatestDolphinVer));

+ 2 - 2
studio/inc/utils.inc.php

@@ -12,7 +12,7 @@ defined('BX_DOL') or die('hack attempt');
  * @see BxDolStudioStore  -> checkoutCart and BxDolStudioOAuth -> authorize
  */
 function generateSid() {
-	return md5(BX_DOL_URL_ROOT . '_' . BX_DOL_VERSION . '.' . BX_DOL_BUILD);
+	return md5(BX_DOL_URL_ROOT . '_' . getParam('sys_version')); // TODO: maybe change to bx_site_hash() ?
 }
 
 function bx_array_insert_before($aInsert, $aSource, $sKey) {
@@ -34,4 +34,4 @@ function bx_array_insert($aInsert, $aSource, $sKey, $iDirection = 1) {
 
 	return array_slice($aSource, 0, $iPosition, true) + $aInsert + array_slice($aSource, $iPosition, NULL, true); 
 }
-/** @} */
+/** @} */

+ 1 - 1
template/scripts/BxBaseConfig.php

@@ -1,4 +1,4 @@
-<?php defined('BX_DOL') or die('hack attempt');
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/

+ 1 - 1
template/scripts/BxBasePage.php

@@ -339,7 +339,7 @@ class BxBasePage extends BxDolPage {
         if ($isPrefixOnly)
             return $s;
         $s .= $this->_getPageCacheParams ();
-        $s .= md5(BX_DOL_VERSION . BX_DOL_BUILD . BX_DOL_URL_ROOT) . '.php';
+        $s .= bx_site_hash() . '.php';
         return $s;
     }