diff --git a/CoreVersions/Baikal_0.1/Frameworks/Baikal/Core/Bootstrap.php b/CoreVersions/Baikal_0.1/Frameworks/Baikal/Core/Bootstrap.php index 72336df..cf4b449 100644 --- a/CoreVersions/Baikal_0.1/Frameworks/Baikal/Core/Bootstrap.php +++ b/CoreVersions/Baikal_0.1/Frameworks/Baikal/Core/Bootstrap.php @@ -87,6 +87,10 @@ define("BAIKAL_PATH_CORE", BAIKAL_PATH_ROOT . "Core/"); define("BAIKAL_PATH_SPECIFIC", BAIKAL_PATH_ROOT . "Specific/"); define("BAIKAL_PATH_FRAMEWORKS", BAIKAL_PATH_CORE . "Frameworks/"); define("BAIKAL_PATH_WWWROOT", BAIKAL_PATH_CORE . "WWWRoot/"); + +# Define path to Baïkal SQLite file +define("BAIKAL_SQLITE_FILE", BAIKAL_PATH_SPECIFIC . "db/baikal.sqlite"); + require_once(BAIKAL_PATH_CORE . "Distrib.php"); # Determine BAIKAL_URI @@ -99,6 +103,8 @@ define("BAIKAL_BASEURI", $sBaseUrl); define("BAIKAL_URI", $sProtocol . "://" . rmEndSlash($_SERVER["HTTP_HOST"]) . $sBaseUrl); unset($sScript); unset($sDirName); unset($sBaseUrl); unset($sProtocol); unset($aParts); +# Bootstrap Flake +require_once(BAIKAL_PATH_FRAMEWORKS . "Flake/Core/Bootstrap.php"); # Check that a config file exists if( @@ -129,9 +135,6 @@ if( } \Baikal\Core\Tools::assertBaikalIsOk(); - - # Bootstrap Flake - require_once(BAIKAL_PATH_FRAMEWORKS . "Flake/Core/Bootstrap.php"); # Establishing connection with database $GLOBALS["DB"] = new \Flake\Core\Database\Sqlite(BAIKAL_SQLITE_FILE); diff --git a/CoreVersions/Baikal_0.1/Frameworks/Baikal/Model/Config/System.php b/CoreVersions/Baikal_0.1/Frameworks/Baikal/Model/Config/System.php index 859bdba..dbad902 100644 --- a/CoreVersions/Baikal_0.1/Frameworks/Baikal/Model/Config/System.php +++ b/CoreVersions/Baikal_0.1/Frameworks/Baikal/Model/Config/System.php @@ -41,9 +41,6 @@ class System extends \Baikal\Model\Config { "BAIKAL_CAL_BASEURI" => array( "type" => "litteral", ), - "BAIKAL_SQLITE_FILE" => array( - "type" => "litteral", - ), "BAIKAL_STANDALONE_ALLOWED" => array( "type" => "boolean", ), @@ -57,7 +54,6 @@ class System extends \Baikal\Model\Config { "BAIKAL_AUTH_REALM" => "", "BAIKAL_CARD_BASEURI" => "", "BAIKAL_CAL_BASEURI" => "", - "BAIKAL_SQLITE_FILE" => "", "BAIKAL_STANDALONE_ALLOWED" => "", "BAIKAL_STANDALONE_PORT" => "", ); @@ -100,14 +96,6 @@ class System extends \Baikal\Model\Config { ) ))); - $oMorpho->add(new \Formal\Element\Text(array( - "prop" => "BAIKAL_SQLITE_FILE", - "label" => "Path to SQLite DB", - "inputclass" => "input-xxlarge", - "validation" => "required", - "help" => "The absolute server path to SQLite database." - ))); - $oMorpho->add(new \Formal\Element\Text(array( "prop" => "BAIKAL_AUTH_REALM", "label" => "Auth realm", @@ -119,16 +107,18 @@ class System extends \Baikal\Model\Config { ) ))); - $oMorpho->add(new \Formal\Element\Checkbox(array( - "prop" => "BAIKAL_STANDALONE_ALLOWED", - "label" => "Allow Standalone Baïkal execution" - ))); - - $oMorpho->add(new \Formal\Element\Text(array( - "prop" => "BAIKAL_STANDALONE_PORT", - "label" => "Standalone Baïkal port" - ))); - + if(\Flake\Util\Frameworks::enabled("BaikalStandalone")) { + $oMorpho->add(new \Formal\Element\Checkbox(array( + "prop" => "BAIKAL_STANDALONE_ALLOWED", + "label" => "Allow Standalone Baïkal execution" + ))); + + $oMorpho->add(new \Formal\Element\Text(array( + "prop" => "BAIKAL_STANDALONE_PORT", + "label" => "Standalone Baïkal port" + ))); + } + return $oMorpho; } diff --git a/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Controller/Install/Initialize.php b/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Controller/Install/Initialize.php index 89fb51a..86d5246 100644 --- a/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Controller/Install/Initialize.php +++ b/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Controller/Install/Initialize.php @@ -54,8 +54,21 @@ class Initialize extends \Flake\Core\Controller { if($this->oForm->persisted()) { $sContent = file_get_contents(BAIKAL_PATH_SPECIFIC . "config.system.php"); - $sContent .= "\n\ndefine(\"BAIKAL_CONFIGURED_VERSION\", \"" . BAIKAL_VERSION . "\");\n"; - file_put_contents(BAIKAL_PATH_SPECIFIC . "config.system.php", $sContent); + + $sBaikalVersion = BAIKAL_VERSION; + $sEncryptionKey = md5(microtime() . rand()); + + # Setting "BAIKAL_CONFIGURED_VERSION" + $sNewConstants =<<aMeta[$sKey] =& $mValue; } + + $res = NULL; + return $res; # To avoid 'Notice: Only variable references should be returned by reference' } elseif( strlen($sName) > 7 && @@ -172,5 +175,7 @@ class Collection extends \Flake\Core\FLObject implements \Iterator { } else { throw new \Exception("Method " . $sName . "() not found on " . get_class($this)); } + + debug("laaaaaaaaaaaaa:" . $sName); } } \ No newline at end of file diff --git a/CoreVersions/Baikal_0.1/Frameworks/Flake/Util/Frameworks.php b/CoreVersions/Baikal_0.1/Frameworks/Flake/Util/Frameworks.php new file mode 100644 index 0000000..e6d2e30 --- /dev/null +++ b/CoreVersions/Baikal_0.1/Frameworks/Flake/Util/Frameworks.php @@ -0,0 +1,36 @@ + +* All rights reserved +* +* http://baikal.codr.fr +* +* This script is part of the Baïkal Server project. The Baïkal +* Server project 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 (at your option) any later version. +* +* The GNU General Public License can be found at +* http://www.gnu.org/copyleft/gpl.html. +* +* This script 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. +* +* This copyright notice MUST APPEAR in all copies of the script! +***************************************************************/ + +namespace Flake\Util; + +class Frameworks extends \Flake\Core\FLObject { + private function __construct() { # private constructor to force static class + } + + public static function enabled($sFramework) { + return FALSE; + } +} \ No newline at end of file diff --git a/CoreVersions/Baikal_0.1/Frameworks/Flake/Util/Tools.php b/CoreVersions/Baikal_0.1/Frameworks/Flake/Util/Tools.php index 16169d5..0a0e0e9 100755 --- a/CoreVersions/Baikal_0.1/Frameworks/Flake/Util/Tools.php +++ b/CoreVersions/Baikal_0.1/Frameworks/Flake/Util/Tools.php @@ -27,7 +27,10 @@ namespace Flake\Util; class Tools extends \Flake\Core\FLObject { - + + private function __construct() { # private constructor to force static class + } + public static function getCurrentUrl() { if(MONGOOSE_SERVER) { $sUrl = $GLOBALS["_SERVER"]["REQUEST_URI"]; diff --git a/CoreVersions/Baikal_0.1/Frameworks/Flake/config.php b/CoreVersions/Baikal_0.1/Frameworks/Flake/config.php index 4e762fa..0e23890 100644 --- a/CoreVersions/Baikal_0.1/Frameworks/Flake/config.php +++ b/CoreVersions/Baikal_0.1/Frameworks/Flake/config.php @@ -26,8 +26,14 @@ define("FLAKE_URI", BAIKAL_URI); define("FLAKE_DB_FILEPATH", BAIKAL_SQLITE_FILE); -define("FLAKE_TIMEZONE", BAIKAL_TIMEZONE); define("FLAKE_PATH_FRAMEWORKS", BAIKAL_PATH_FRAMEWORKS); define("FLAKE_PATH_WWWROOT", BAIKAL_PATH_WWWROOT); + define("FLAKE_SAFEHASH_SALT", "une-clef-super-secrete"); -define("FLAKE_LOCALE", "fr_FR.UTF-8"); \ No newline at end of file +define("FLAKE_LOCALE", "fr_FR.UTF-8"); + +if(defined("BAIKAL_TIMEZONE")) { + define("FLAKE_TIMEZONE", BAIKAL_TIMEZONE); +} else { + define("FLAKE_TIMEZONE", "Europe/Paris"); +} \ No newline at end of file