From 61974ea048c9683a4b9910c37f133607e7139f51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Je=CC=81ro=CC=82me=20Schneider?= Baïkal is now configured. You may now Access the Baïkal admin";
+ $sHtml .= " Baïkal is now configured. You may now Access the Baïkal admin";
} else {
# Display the config form
@@ -96,25 +101,25 @@ HTML;
}
protected function tagConfiguredVersion() {
- file_put_contents(BAIKAL_PATH_SPECIFIC . "config.php", $sContent);
+ file_put_contents(PROJECT_PATH_SPECIFIC . "config.php", $sContent);
}
protected function createDefaultConfigFilesIfNeeded() {
# Create empty config.php if needed
- if(!file_exists(BAIKAL_PATH_SPECIFIC . "config.php")) {
- @touch(BAIKAL_PATH_SPECIFIC . "config.php");
+ if(!file_exists(PROJECT_PATH_SPECIFIC . "config.php")) {
+ @touch(PROJECT_PATH_SPECIFIC . "config.php");
$sContent = "getDefaultConfig();
- file_put_contents(BAIKAL_PATH_SPECIFIC . "config.php", $sContent);
+ file_put_contents(PROJECT_PATH_SPECIFIC . "config.php", $sContent);
}
# Create empty config.system.php if needed
- if(!file_exists(BAIKAL_PATH_SPECIFIC . "config.system.php")) {
- @touch(BAIKAL_PATH_SPECIFIC . "config.system.php");
+ if(!file_exists(PROJECT_PATH_SPECIFIC . "config.system.php")) {
+ @touch(PROJECT_PATH_SPECIFIC . "config.system.php");
$sContent = "getDefaultSystemConfig();
- file_put_contents(BAIKAL_PATH_SPECIFIC . "config.system.php", $sContent);
+ file_put_contents(PROJECT_PATH_SPECIFIC . "config.system.php", $sContent);
}
}
@@ -163,16 +168,16 @@ define("BAIKAL_STANDALONE_ALLOWED", FALSE);
define("BAIKAL_STANDALONE_PORT", 8888);
# PATH to SabreDAV
-define("BAIKAL_PATH_SABREDAV", BAIKAL_PATH_FRAMEWORKS . "SabreDAV/lib/Sabre/");
+define("BAIKAL_PATH_SABREDAV", PROJECT_PATH_FRAMEWORKS . "SabreDAV/lib/Sabre/");
# If you change this value, you'll have to re-generate passwords for all your users
define("BAIKAL_AUTH_REALM", "BaikalDAV");
# Should begin and end with a "/"
-define("BAIKAL_CARD_BASEURI", BAIKAL_BASEURI . "card.php/");
+define("BAIKAL_CARD_BASEURI", PROJECT_BASEURI . "card.php/");
# Should begin and end with a "/"
-define("BAIKAL_CAL_BASEURI", BAIKAL_BASEURI . "cal.php/");
+define("BAIKAL_CAL_BASEURI", PROJECT_BASEURI . "cal.php/");
CODE;
$sCode = trim($sCode);
return $sCode;
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Navigation/Topbar.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Navigation/Topbar.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Navigation/Topbar/Install.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Navigation/Topbar/Install.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Settings/Standard.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Settings/Standard.php
old mode 100644
new mode 100755
index d9c2dbc..c6271d1
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Settings/Standard.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Settings/Standard.php
@@ -30,7 +30,7 @@ class Standard extends \Flake\Core\Controller {
public function __construct() {
parent::__construct();
- $this->oModel = new \Baikal\Model\Config\Standard(BAIKAL_PATH_SPECIFIC . "config.php");
+ $this->oModel = new \Baikal\Model\Config\Standard(PROJECT_PATH_SPECIFIC . "config.php");
# Assert that config file is writable
if(!$this->oModel->writable()) {
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Settings/System.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Settings/System.php
old mode 100644
new mode 100755
index 8063a90..dd0f887
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Settings/System.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Settings/System.php
@@ -30,7 +30,7 @@ class System extends \Flake\Core\Controller {
public function __construct() {
parent::__construct();
- $this->oModel = new \Baikal\Model\Config\System(BAIKAL_PATH_SPECIFIC . "config.system.php");
+ $this->oModel = new \Baikal\Model\Config\System(PROJECT_PATH_SPECIFIC . "config.system.php");
# Assert that config file is writable
if(!$this->oModel->writable()) {
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/User/Calendars.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/User/Calendars.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Users.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Users.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/Auth.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/Auth.php
old mode 100644
new mode 100755
index 7f52b15..e23d88e
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/Auth.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/Auth.php
@@ -44,7 +44,7 @@ class Auth {
}
$bLocked = TRUE;
- $sEnableFile = BAIKAL_PATH_SPECIFIC . "ENABLE_ADMIN";
+ $sEnableFile = PROJECT_PATH_SPECIFIC . "ENABLE_ADMIN";
if(file_exists($sEnableFile)) {
clearstatcache();
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/ClassLoader.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/ClassLoader.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/View.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/View.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/Bootstrap.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Framework.php
old mode 100644
new mode 100755
similarity index 57%
rename from CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/Bootstrap.php
rename to CoreVersions/0.2.0/Frameworks/BaikalAdmin/Framework.php
index a544041..2379bb1
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Core/Bootstrap.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Framework.php
@@ -24,21 +24,23 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
-define("BAIKALADMIN_PATH_ROOT", dirname(dirname(__FILE__)) . "/");
+namespace BaikalAdmin;
-# Bootstrap Baïkal Core
-require_once(dirname(dirname(dirname(__FILE__))) . "/Baikal/Core/Bootstrap.php"); # ../../, symlink-safe
+class Framework extends \Flake\Core\Framework {
+
+ public static function bootstrap() {
+ define("BAIKALADMIN_PATH_ROOT", dirname(__FILE__) . "/"); # ./
+
+ \Baikal\Framework::bootstrap();
+ \Formal\Framework::bootstrap();
-# Bootstrap Formal
-require_once(dirname(dirname(dirname(__FILE__))) . "/Formal/Core/Bootstrap.php");
+ # Registering BaikalAdmin classloader
+ require_once(BAIKALADMIN_PATH_ROOT . '/Core/ClassLoader.php');
+ \BaikalAdmin\Core\ClassLoader::register();
+
+ $GLOBALS["ROUTER"]::setURIPath("admin/");
-# Registering BaikalAdmin classloader
-require_once(dirname(__FILE__) . '/ClassLoader.php');
-\BaikalAdmin\Core\ClassLoader::register();
-
-# Relative to BAIKAL_URI; so that BAIKAL_URI . BAIKALADMIN_URIPATH corresponds to the full URL to Baïkal admin
-define("BAIKALADMIN_URIPATH", "admin/");
-$GLOBALS["ROUTER"]::setURIPath(BAIKALADMIN_URIPATH);
-
-# Include BaikalAdmin Framework config
-require_once(BAIKALADMIN_PATH_ROOT . "config.php");
\ No newline at end of file
+ # Include BaikalAdmin Framework config
+ require_once(BAIKALADMIN_PATH_ROOT . "config.php");
+ }
+}
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Model/Install.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Model/Install.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/glyph-dark.png b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/glyph-dark.png
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/glyph2x-dark.png b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/glyph2x-dark.png
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/glyphpro-2x.css b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/glyphpro-2x.css
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/glyphpro.css b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/glyphpro.css
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/test-glyphpro2x.html b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/test-glyphpro2x.html
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Strings/EN/Exceptions.json b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Strings/EN/Exceptions.json
new file mode 100755
index 0000000..4eb7c3f
--- /dev/null
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Strings/EN/Exceptions.json
@@ -0,0 +1,3 @@
+{
+
+}
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/AddressBooks/Listing.html b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/AddressBooks/Listing.html
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Calendars/Listing.html b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Calendars/Listing.html
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Page/page-bg-light.png b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Page/page-bg-light.png
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Page/page-bg.png b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Page/page-bg.png
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Page/style.css b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Page/style.css
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Users/Listing.html b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Users/Listing.html
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Dashboard.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Dashboard.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Install.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Install.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Settings/Standard.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Settings/Standard.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Settings/System.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Settings/System.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/User/AddressBooks.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/User/AddressBooks.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/User/Calendars.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/User/Calendars.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Users.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Users.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/AddressBooks/Listing.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/AddressBooks/Listing.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Calendars/Listing.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Calendars/Listing.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Users/Listing.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Users/Listing.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/WWWRoot/index.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/WWWRoot/index.php
old mode 100644
new mode 100755
index 70d5e83..e099170
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/WWWRoot/index.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/WWWRoot/index.php
@@ -26,13 +26,16 @@
ini_set("display_errors", 1);
error_reporting(E_ALL);
-define("BAIKAL_CONTEXT_BASEURI", "/admin/");
+define("PROJECT_CONTEXT_BASEURI", "/admin/");
define("BAIKAL_CONTEXT", TRUE);
define("BAIKAL_CONTEXT_ADMIN", TRUE);
+# Bootstrap Flake
+require_once(dirname(dirname(dirname(__FILE__))) . "/Flake/Core/Bootstrap.php"); # ../../
+
# Bootstrap BaikalAdmin
-require_once(dirname(dirname(__FILE__)) . "/Core/Bootstrap.php"); # ../
+\BaikalAdmin\Framework::bootstrap();
# Evaluate assertions
\BaikalAdmin\Core\Auth::assertEnabled();
@@ -42,7 +45,7 @@ require_once(dirname(dirname(__FILE__)) . "/Core/Bootstrap.php"); # ../
$oPage = new \Flake\Controller\Page(BAIKALADMIN_PATH_TEMPLATES . "Page/index.html");
$oPage->injectHTTPHeaders();
$oPage->setTitle("Baïkal Web Admin");
-$oPage->setBaseUrl(BAIKAL_URI);
+$oPage->setBaseUrl(PROJECT_URI);
$oPage->zone("navbar")->addBlock(new \BaikalAdmin\Controller\Navigation\Topbar());
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/WWWRoot/install/index.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/WWWRoot/install/index.php
old mode 100644
new mode 100755
index 21c5f60..a610846
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/WWWRoot/install/index.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/WWWRoot/install/index.php
@@ -26,13 +26,16 @@
ini_set("display_errors", 1);
error_reporting(E_ALL);
-define("BAIKAL_CONTEXT_BASEURI", "/admin/install/");
+define("PROJECT_CONTEXT_BASEURI", "/admin/install/");
define("BAIKAL_CONTEXT", TRUE);
define("BAIKAL_CONTEXT_INSTALL", TRUE);
+# Bootstrap Flake
+require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Flake/Core/Bootstrap.php"); # ../../../
+
# Bootstrap BaikalAdmin
-require_once(dirname(dirname(dirname(__FILE__))) . "/Core/Bootstrap.php"); # ../../
+\BaikalAdmin\Framework::bootstrap();
# Evaluate assertions
\BaikalAdmin\Core\Auth::assertUnlocked();
@@ -41,7 +44,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/Core/Bootstrap.php"); # ../
$oPage = new \Flake\Controller\Page(BAIKALADMIN_PATH_TEMPLATES . "Page/index.html");
$oPage->injectHTTPHeaders();
$oPage->setTitle("Baïkal Maintainance");
-$oPage->setBaseUrl(BAIKAL_URI);
+$oPage->setBaseUrl(PROJECT_URI);
$oPage->zone("navbar")->addBlock(new \BaikalAdmin\Controller\Navigation\Topbar\Install());
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/config.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/config.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Core/Bootstrap.php b/CoreVersions/0.2.0/Frameworks/Flake/Core/Bootstrap.php
index 9f12d54..4f65cd5 100755
--- a/CoreVersions/0.2.0/Frameworks/Flake/Core/Bootstrap.php
+++ b/CoreVersions/0.2.0/Frameworks/Flake/Core/Bootstrap.php
@@ -24,6 +24,14 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+# Asserting PHP 5.3.0+
+if(version_compare(PHP_VERSION, '5.3.0', '<')) {
+ die('Flake Fatal Error: Flake requires PHP 5.3.0+ to run properly. Your version is: ' . PHP_VERSION . '.');
+}
+
+# Define absolute server path to Flake Framework
+define("FLAKE_PATH_ROOT", dirname(dirname(__FILE__)) . "/"); # ../
+
if(!defined('LF')) {
define('LF', chr(10));
}
@@ -38,28 +46,77 @@ if(array_key_exists("SERVER_NAME", $_SERVER) && $_SERVER["SERVER_NAME"] === "mon
define("MONGOOSE_SERVER", FALSE);
}
-define("FLAKE_PATH_ROOT", dirname(dirname(__FILE__)) . "/"); # ../
-
# Display errors messages, except notices
#ini_set("display_errors", 1);
#ini_set("error_reporting", E_ALL & ~E_NOTICE);
-if(!function_exists("appendSlash")) {
- function appendSlash($sPath) {
- if($sPath{strlen($sPath) - 1} !== "/") {
- $sPath .= "/";
- }
-
- return $sPath;
+function rmBeginSlash($sString) {
+ if(substr($sString, 0, 1) === "/") {
+ $sString = substr($sString, 1);
}
+
+ return $sString;
}
+function rmEndSlash($sString) {
+ if(substr($sString, -1) === "/") {
+ $sString = substr($sString, 0, -1);
+ }
+
+ return $sString;
+}
+
+function appendSlash($sString) {
+ if(substr($sString, -1) !== "/") {
+ $sString .= "/";
+ }
+
+ return $sString;
+}
+
+function prependSlash($sString) {
+ if(substr($sString, 0, 1) !== "/") {
+ $sString = "/" . $sString;
+ }
+
+ return $sString;
+}
if(!function_exists("debug")) {
function debug($mVar, $sHeader=0) {
\Flake\Util\Tools::debug($mVar, $sHeader);
}
}
+#################################################################################################
+
+# determine Flake install root path
+# not using realpath here to avoid symlinks resolution
+
+define("PROJECT_PATH_ROOT", dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . "/"); # ../../../../../
+define("PROJECT_PATH_CORE", PROJECT_PATH_ROOT . "Core/");
+define("PROJECT_PATH_SPECIFIC", PROJECT_PATH_ROOT . "Specific/");
+define("PROJECT_PATH_FRAMEWORKS", PROJECT_PATH_CORE . "Frameworks/");
+define("PROJECT_PATH_WWWROOT", PROJECT_PATH_CORE . "WWWRoot/");
+
+# Define path to Baïkal SQLite file
+define("PROJECT_SQLITE_FILE", PROJECT_PATH_SPECIFIC . "db/baikal.sqlite");
+
+define("PROJECT_SAFEHASH_SALT", "une-clef-super-secrete");
+
+require_once(PROJECT_PATH_CORE . "Distrib.php");
+
+# Determine PROJECT_URI
+$sScript = substr($_SERVER["SCRIPT_FILENAME"], strlen($_SERVER["DOCUMENT_ROOT"]));
+$sDirName = appendSlash(dirname($sScript));
+$sBaseUrl = appendSlash(substr($sDirName, 0, -1 * strlen(PROJECT_CONTEXT_BASEURI)));
+$aParts = explode("/", $_SERVER["SERVER_PROTOCOL"]);
+$sProtocol = strtolower(array_shift($aParts));
+define("PROJECT_BASEURI", $sBaseUrl);
+define("PROJECT_URI", $sProtocol . "://" . rmEndSlash($_SERVER["HTTP_HOST"]) . $sBaseUrl);
+unset($sScript); unset($sDirName); unset($sBaseUrl); unset($sProtocol); unset($aParts);
+
+#################################################################################################
+
require_once(FLAKE_PATH_ROOT . 'Core/ClassLoader.php');
\Flake\Core\ClassLoader::register();
@@ -77,13 +134,13 @@ if(!\Flake\Util\Tools::isCliPhp()) {
setlocale(LC_ALL, FLAKE_LOCALE);
date_default_timezone_set(FLAKE_TIMEZONE);
-if(defined("FLAKE_DB_FILEPATH") && file_exists(FLAKE_DB_FILEPATH) && is_readable(FLAKE_DB_FILEPATH) && !isset($GLOBALS["DB"])) {
- $GLOBALS["DB"] = new \Flake\Core\Database\Sqlite(FLAKE_DB_FILEPATH);
+if(defined("PROJECT_SQLITE_FILE") && file_exists(PROJECT_SQLITE_FILE) && is_readable(PROJECT_SQLITE_FILE) && !isset($GLOBALS["DB"])) {
+ $GLOBALS["DB"] = new \Flake\Core\Database\Sqlite(PROJECT_SQLITE_FILE);
}
$GLOBALS["TEMPLATESTACK"] = array();
-$aUrlInfo = parse_url(FLAKE_URI);
+$aUrlInfo = parse_url(PROJECT_URI);
define("FLAKE_DOMAIN", $_SERVER["HTTP_HOST"]);
define("FLAKE_URIPATH", \Flake\Util\Tools::stripBeginSlash($aUrlInfo["path"]));
unset($aUrlInfo);
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Core/ClassLoader.php b/CoreVersions/0.2.0/Frameworks/Flake/Core/ClassLoader.php
index 12d70b9..55a5b30 100755
--- a/CoreVersions/0.2.0/Frameworks/Flake/Core/ClassLoader.php
+++ b/CoreVersions/0.2.0/Frameworks/Flake/Core/ClassLoader.php
@@ -34,34 +34,50 @@ class ClassLoader {
public static function loadClass($sFullClassName) {
+ $sClassPath = FALSE;
+
$aParts = explode("\\", $sFullClassName);
if(count($aParts) === 1) {
return;
}
- if($aParts[0] !== "Flake" && $aParts[0] !== "Specific" && $aParts[0] !== "Frameworks") {
+ # Extracting the Radical
+ $sRadical = $aParts[0];
+
+ if(in_array($sRadical, array("Flake", "Specific", "Frameworks"))) {
+
+ if($sRadical === "Flake") {
+ $sRootPath = FLAKE_PATH_ROOT;
+ } elseif($sRadical === "Specific") {
+ $sRootPath = FLAKE_PATH_SPECIFIC;
+ } else {
+ $sRootPath = PROJECT_PATH_FRAMEWORKS;
+ }
+
+ # Stripping radical
+ array_shift($aParts);
+
+ # Classname is the last part
+ $sClassName = array_pop($aParts);
+
+ # Path to class
+ $sClassPath = $sRootPath . implode("/", $aParts) . "/" . $sClassName . ".php";
+
+ } elseif(count($aParts) > 1) {
+ if($aParts[1] === "Framework") {
+ # It must be a Flake Framework
+ $sClassPath = PROJECT_PATH_FRAMEWORKS . $sRadical . "/Framework.php";
+ }
+ }
+
+ if($sClassPath === FALSE) {
return;
}
-
- // ejecting the Radical
- $sRadical = array_shift($aParts);
-
- if($sRadical === "Flake") {
- $sRootPath = FLAKE_PATH_ROOT;
- } elseif($sRadical === "Specific") {
- $sRootPath = FLAKE_PATH_SPECIFIC; # When prefix does not point another namespaced framework, we use "Specific"
- } elseif($sRadical === "Frameworks") {
- $sRootPath = FLAKE_PATH_FRAMEWORKS;
- }
-
- $sClassName = array_pop($aParts);
- $sBasePath = $sRootPath . implode("/", $aParts) . "/";
- $sClassPath = $sBasePath . $sClassName . ".php";
if(file_exists($sClassPath) && is_readable($sClassPath)) {
require_once($sClassPath);
} else {
- echo '
- This is the Baïkal Install Tool.PHP Autoload Error. Cannot find ' . $sFullClassName . '
';
+ echo 'PHP Autoload Error. Cannot find ' . $sFullClassName . ' in ' . $sClassPath . '
';
echo "" . print_r(debug_backtrace(), TRUE) . "
";
die();
}
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Core/DocumentedException.php b/CoreVersions/0.2.0/Frameworks/Flake/Core/DocumentedException.php
new file mode 100755
index 0000000..f31be68
--- /dev/null
+++ b/CoreVersions/0.2.0/Frameworks/Flake/Core/DocumentedException.php
@@ -0,0 +1,83 @@
+
+* 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\Core;
+
+class DocumentedException extends \Exception {
+
+ protected $aMarkers = array();
+
+ # Redefine the exception signature
+ public function __construct($message, $aMarkers = array()) {
+ $this->aMarkers = $aMarkers;
+ parent::__construct($message, 0, null);
+ }
+
+ # custom string representation of object
+ public function __toString() {
+ $aDoc = $this->getDocumentation();
+ debug($aDoc);
+ return "" . htmlspecialchars($this->message) . "";
+ }
+
+ protected function getSoftrefPath() {
+ $sSoftRef = $this->getMessage();
+ $aTrace = $this->getTrace();
+
+ if($sSoftRef{0} === "\\") {
+ # An absolute softref has been given
+ return $sSoftRef;
+ }
+
+ if(isset($aTrace[0]["class"])) {
+ return "\\" . $aTrace[0]["class"] . "#" . $sSoftRef;
+ }
+
+ return $sSoftRef;
+ }
+
+ protected function getDocumentation() {
+ # Determine the documentation softref
+ $sSoftRefPath = $this->getSoftrefPath();
+ return $sSoftRefPath;
+
+ /*
+ $aParts = explode("#", \Flake\Util\Tools::trimStrings($sSoftRefPath, "\\"));
+
+ $aSegments = explode("\\", $aParts[0]);
+ $sKey = $aParts[1];
+
+ # Is it a Framework ?
+ if(\Flake\Util\Frameworks::isAFramework($aSegments[0])) {
+ $sPath = \Flake\Util\Frameworks::getPath($aSegments[0]);
+ die($sPath);
+ }
+
+ debug($aParts);
+ return $sSoftRefPath;
+ */
+ }
+}
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Core/Bootstrap.php b/CoreVersions/0.2.0/Frameworks/Flake/Core/Framework.php
old mode 100644
new mode 100755
similarity index 83%
rename from CoreVersions/0.2.0/Frameworks/Formal/Core/Bootstrap.php
rename to CoreVersions/0.2.0/Frameworks/Flake/Core/Framework.php
index ed02d22..8816fea
--- a/CoreVersions/0.2.0/Frameworks/Formal/Core/Bootstrap.php
+++ b/CoreVersions/0.2.0/Frameworks/Flake/Core/Framework.php
@@ -24,8 +24,8 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
-define("FORMAL_PATH_ROOT", dirname(dirname(__FILE__)) . "/");
+namespace Flake\Core;
-# Registering BaikalAdmin classloader
-require_once(dirname(__FILE__) . '/ClassLoader.php');
-\Formal\Core\ClassLoader::register();
\ No newline at end of file
+class Framework extends \Flake\Core\FLObject {
+
+}
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Core/Requester.php b/CoreVersions/0.2.0/Frameworks/Flake/Core/Requester.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Util/Frameworks.php b/CoreVersions/0.2.0/Frameworks/Flake/Util/Frameworks.php
old mode 100644
new mode 100755
index e6d2e30..170b93f
--- a/CoreVersions/0.2.0/Frameworks/Flake/Util/Frameworks.php
+++ b/CoreVersions/0.2.0/Frameworks/Flake/Util/Frameworks.php
@@ -30,7 +30,26 @@ class Frameworks extends \Flake\Core\FLObject {
private function __construct() { # private constructor to force static class
}
+ public function isAFramework($sName) {
+ $sName = trim(\Flake\Util\Tools::trimSlashes($sName));
+ if($sName === "" || $sName === "." || $sName === "..") {
+ return FALSE;
+ }
+
+ $sFrameworkPath = PROJECT_PATH_FRAMEWORKS . $sName;
+ return file_exists($sFrameworkPath) && is_dir($sFrameworkPath);
+ }
+
public static function enabled($sFramework) {
return FALSE;
}
+
+ # TODO: Create a 'Framework' Model
+ public function getPath($sName) {
+ if(self::isAFramework($sName)) {
+ throw new \Flake\Core\DocumentedException("notaframework", $sName);
+ }
+
+ return \Flake\Util\Tools::appendSlash(PROJECT_PATH_FRAMEWORKS . $sName);
+ }
}
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Util/Router/QuestionMarkRewrite.php b/CoreVersions/0.2.0/Frameworks/Flake/Util/Router/QuestionMarkRewrite.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Util/Tools.php b/CoreVersions/0.2.0/Frameworks/Flake/Util/Tools.php
index 0a0e0e9..0620df4 100755
--- a/CoreVersions/0.2.0/Frameworks/Flake/Util/Tools.php
+++ b/CoreVersions/0.2.0/Frameworks/Flake/Util/Tools.php
@@ -65,7 +65,7 @@ class Tools extends \Flake\Core\FLObject {
}
public static function serverToRelativeWebPath($sAbsPath) {
- return "/" . str_replace(FLAKE_PATH_WWWROOT, "", $sAbsPath);
+ return "/" . str_replace(PROJECT_PATH_WWWROOT, "", $sAbsPath);
}
public static function view_array($array_in) {
@@ -192,7 +192,7 @@ class Tools extends \Flake\Core\FLObject {
}
public static function safelock($sString) {
- return substr(md5(FLAKE_SAFEHASH_SALT . ":" . $sString), 0, 5);
+ return substr(md5(PROJECT_SAFEHASH_SALT . ":" . $sString), 0, 5);
}
public static function redirect($sUrl) {
@@ -568,42 +568,65 @@ TEST;
return $_SERVER['HTTP_USER_AGENT'];
}
+ ###########
public static function appendSlash($sString) {
- if(substr($sString, -1) !== "/") {
- $sString .= "/";
- }
-
- return $sString;
+ return self::appendString($sString, "/");
}
public static function prependSlash($sString) {
- if(substr($sString, 0, 1) !== "/") {
- $sString = "/" . $sString;
- }
-
- return $sString;
+ return self::prependString($sString, "/");
}
public static function stripBeginSlash($sString) {
- if(substr($sString, 0, 1) === "/") {
- $sString = substr($sString, 1);
- }
-
- return $sString;
+ return self::stripBeginString($sString, "/");
}
public static function stripEndSlash($sString) {
- if(substr($sString, -1) === "/") {
- $sString = substr($sString, 0, -1);
- }
-
- return $sString;
+ return self::stripEndString($sString, "/");
}
public static function trimSlashes($sString) {
return self::stripBeginSlash(self::stripEndSlash($sString));
}
+ ###########
+ public static function appendString($sString, $sAppend) {
+ if(substr($sString, -1 * strlen($sAppend)) !== $sAppend) {
+ $sString .= $sAppend;
+ }
+
+ return $sString;
+ }
+
+ public static function prependString($sString, $sAppend) {
+ if(substr($sString, 0, 1 * strlen($sAppend)) !== $sAppend) {
+ $sString = $sAppend . $sString;
+ }
+
+ return $sString;
+ }
+
+ public static function stripBeginString($sString, $sAppend) {
+ if(substr($sString, 0, 1 * strlen($sAppend)) === $sAppend) {
+ $sString = substr($sString, strlen($sAppend));
+ }
+
+ return $sString;
+ }
+
+ public static function stripEndString($sString, $sAppend) {
+ if(substr($sString, -1 * strlen($sAppend)) === $sAppend) {
+ $sString = substr($sString, 0, -1 * strlen($sAppend));
+ }
+
+ return $sString;
+ }
+
+ public static function trimStrings($sString, $sAppend) {
+ return self::stripBeginString(self::stripEndString($sString, $sAppend), $sAppend);
+ }
+ ###########
+
public static function router() {
return "\Flake\Util\Router\QuestionMarkRewrite";
}
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/config.php b/CoreVersions/0.2.0/Frameworks/Flake/config.php
old mode 100644
new mode 100755
index 0e23890..67ab3ca
--- a/CoreVersions/0.2.0/Frameworks/Flake/config.php
+++ b/CoreVersions/0.2.0/Frameworks/Flake/config.php
@@ -24,12 +24,6 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
-define("FLAKE_URI", BAIKAL_URI);
-define("FLAKE_DB_FILEPATH", BAIKAL_SQLITE_FILE);
-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");
if(defined("BAIKAL_TIMEZONE")) {
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Core/ClassLoader.php b/CoreVersions/0.2.0/Frameworks/Formal/Core/ClassLoader.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Core/Message.php b/CoreVersions/0.2.0/Frameworks/Formal/Core/Message.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Element.php b/CoreVersions/0.2.0/Frameworks/Formal/Element.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Element/Checkbox.php b/CoreVersions/0.2.0/Frameworks/Formal/Element/Checkbox.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Element/Listbox.php b/CoreVersions/0.2.0/Frameworks/Formal/Element/Listbox.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Element/Password.php b/CoreVersions/0.2.0/Frameworks/Formal/Element/Password.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Element/Text.php b/CoreVersions/0.2.0/Frameworks/Formal/Element/Text.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Form.php b/CoreVersions/0.2.0/Frameworks/Formal/Form.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Form/Morphology.php b/CoreVersions/0.2.0/Frameworks/Formal/Form/Morphology.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Formal/Framework.php b/CoreVersions/0.2.0/Frameworks/Formal/Framework.php
new file mode 100755
index 0000000..ce34fd4
--- /dev/null
+++ b/CoreVersions/0.2.0/Frameworks/Formal/Framework.php
@@ -0,0 +1,37 @@
+
+* 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 Formal;
+
+class Framework extends \Flake\Core\Framework {
+
+ public static function bootstrap() {
+ define("FORMAL_PATH_ROOT", dirname(__FILE__) . "/");
+
+ require_once(dirname(__FILE__) . '/Core/ClassLoader.php');
+ \Formal\Core\ClassLoader::register();
+ }
+}
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/Colorize.php b/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/Colorize.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/Tabulator.cli.php b/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/Tabulator.cli.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/Tabulator.html.php b/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/Tabulator.html.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/Tabulator.php b/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/Tabulator.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/TabulatorColumn.php b/CoreVersions/0.2.0/Frameworks/Versions/Tabulator.0.0.1/TabulatorColumn.php
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/css/bootstrap-responsive.css b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/css/bootstrap-responsive.css
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/css/bootstrap-responsive.min.css b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/css/bootstrap-responsive.min.css
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/css/bootstrap.css b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/css/bootstrap.css
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/css/bootstrap.min.css b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/css/bootstrap.min.css
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/img/glyphicons-halflings-orig.png b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/img/glyphicons-halflings-orig.png
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/img/glyphicons-halflings-white.png b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/img/glyphicons-halflings-white.png
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/img/glyphicons-halflings.png b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/img/glyphicons-halflings.png
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/bootstrap-popover.js b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/bootstrap-popover.js
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/bootstrap-tooltip.js b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/bootstrap-tooltip.js
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/bootstrap.js b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/bootstrap.js
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/bootstrap.min.js b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/bootstrap.min.js
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/jquery-1.7.1.min.js b/CoreVersions/0.2.0/Frameworks/Versions/TwitterBootstrap.2.0.2/js/jquery-1.7.1.min.js
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Resources/Web/README.md b/CoreVersions/0.2.0/Resources/Web/README.md
old mode 100644
new mode 100755
diff --git a/CoreVersions/0.2.0/Scripts/adminpassword.php b/CoreVersions/0.2.0/Scripts/adminpassword.php
index dab0494..961ddb1 100755
--- a/CoreVersions/0.2.0/Scripts/adminpassword.php
+++ b/CoreVersions/0.2.0/Scripts/adminpassword.php
@@ -34,7 +34,7 @@ require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Core/Frameworks/Ba
# Bootstraping BaikalAdmin
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Core/Frameworks/BaikalAdmin/Core/Bootstrap.php"); # ../../../
-$sConfigFile = BAIKAL_PATH_SPECIFIC . "config.php";
+$sConfigFile = PROJECT_PATH_SPECIFIC . "config.php";
if(!file_exists($sConfigFile)) {
die("Specific/config.php is does not exist. Aborting, cannot modify admin password.");
diff --git a/CoreVersions/0.2.0/WWWRoot/cal.php b/CoreVersions/0.2.0/WWWRoot/cal.php
index 4b03ef0..a5077ed 100755
--- a/CoreVersions/0.2.0/WWWRoot/cal.php
+++ b/CoreVersions/0.2.0/WWWRoot/cal.php
@@ -25,7 +25,7 @@
***************************************************************/
define("BAIKAL_CONTEXT", TRUE);
-define("BAIKAL_CONTEXT_BASEURI", "/");
+define("PROJECT_CONTEXT_BASEURI", "/");
# Bootstraping Baikal
require_once(dirname(dirname(__FILE__)) . "/Frameworks/Baikal/Core/Bootstrap.php");
diff --git a/CoreVersions/0.2.0/WWWRoot/card.php b/CoreVersions/0.2.0/WWWRoot/card.php
index 701cbe7..bdb7282 100755
--- a/CoreVersions/0.2.0/WWWRoot/card.php
+++ b/CoreVersions/0.2.0/WWWRoot/card.php
@@ -25,7 +25,7 @@
***************************************************************/
define("BAIKAL_CONTEXT", TRUE);
-define("BAIKAL_CONTEXT_BASEURI", "/");
+define("PROJECT_CONTEXT_BASEURI", "/");
# Bootstraping Baikal
require_once(dirname(dirname(__FILE__)) . "/Frameworks/Baikal/Core/Bootstrap.php");
diff --git a/CoreVersions/0.2.0/WWWRoot/index.php b/CoreVersions/0.2.0/WWWRoot/index.php
index a7a64fc..bc3cec0 100755
--- a/CoreVersions/0.2.0/WWWRoot/index.php
+++ b/CoreVersions/0.2.0/WWWRoot/index.php
@@ -24,7 +24,7 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
define("BAIKAL_CONTEXT", TRUE);
-define("BAIKAL_CONTEXT_BASEURI", "/");
+define("PROJECT_CONTEXT_BASEURI", "/");
# Bootstraping Baikal
require_once(dirname(dirname(__FILE__)) . "/Frameworks/Baikal/Core/Bootstrap.php");
diff --git a/Specific/db/baikal.sqlite b/Specific/db/baikal.sqlite
index 32253c211271b12aeda6437c6ce26441f51fe683..a27278539ac7ea2f56ff09de8e0ebaccdc2a9e9a 100755
GIT binary patch
delta 387
zcmZoDXegK<%~(58#+kL2LHCi*_ujY>dns7??L~7Gzn*9N@>u&Y*27?ao_Jl$n>D
zS&*1htY4B^T;h_NmROooqTra4Qj}U;tl*TNpPd2`!zQJWmS3a*(zl6)g#*n3ZU${#
zX+~XMUS3rkmLw" . $exception . "
";
}
public static function assertBaikalIsOk() {
diff --git a/CoreVersions/0.2.0/Frameworks/Baikal/Framework.php b/CoreVersions/0.2.0/Frameworks/Baikal/Framework.php
index 5959680..c4a5fad 100755
--- a/CoreVersions/0.2.0/Frameworks/Baikal/Framework.php
+++ b/CoreVersions/0.2.0/Frameworks/Baikal/Framework.php
@@ -30,8 +30,10 @@ class Framework extends \Flake\Core\Framework {
public static function installTool() {
if(defined("BAIKAL_CONTEXT_INSTALL") && BAIKAL_CONTEXT_INSTALL === TRUE) {
+ # Install tool has been launched and we're already on the install page
return;
} else {
+ # Install tool has been launched; redirecting user
$sInstallToolUrl = PROJECT_URI . "admin/install/";
header("Location: " . $sInstallToolUrl);
exit(0);
@@ -79,9 +81,7 @@ class Framework extends \Flake\Core\Framework {
\Baikal\Core\Tools::assertBaikalIsOk();
set_error_handler("\Baikal\Framework::exception_error_handler");
-
- unset($bShouldCheckEnv);
-
+
# SabreDAV Autoloader
require_once(BAIKAL_PATH_SABREDAV . 'autoload.php');
}
@@ -91,7 +91,7 @@ class Framework extends \Flake\Core\Framework {
}
# Mapping PHP errors to exceptions; needed by SabreDAV
- function exception_error_handler($errno, $errstr, $errfile, $errline) {
+ public static function exception_error_handler($errno, $errstr, $errfile, $errline) {
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
}
}
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/Baikal/Model/Config/Standard.php b/CoreVersions/0.2.0/Frameworks/Baikal/Model/Config/Standard.php
index 8b91cf5..f1058ff 100755
--- a/CoreVersions/0.2.0/Frameworks/Baikal/Model/Config/Standard.php
+++ b/CoreVersions/0.2.0/Frameworks/Baikal/Model/Config/Standard.php
@@ -32,13 +32,13 @@ class Standard extends \Baikal\Model\Config {
"BAIKAL_TIMEZONE" => array(
"type" => "string",
),
- "BAIKAL_CARD_ENABLED" => array(
+ "BAIKAL_ADMIN_ENABLED" => array(
"type" => "boolean",
),
"BAIKAL_CAL_ENABLED" => array(
"type" => "boolean",
),
- "BAIKAL_ADMIN_ENABLED" => array(
+ "BAIKAL_CARD_ENABLED" => array(
"type" => "boolean",
),
"BAIKAL_ADMIN_PASSWORDHASH" => array(
@@ -69,8 +69,12 @@ class Standard extends \Baikal\Model\Config {
)));
$oMorpho->add(new \Formal\Element\Checkbox(array(
- "prop" => "BAIKAL_CARD_ENABLED",
- "label" => "Enable CardDAV"
+ "prop" => "BAIKAL_ADMIN_ENABLED",
+ "label" => "Enable Web Admin",
+ "popover" => array(
+ "title" => "Warning !",
+ "content" => "If disabled, you'll lose access to this very admin interface !",
+ ),
)));
$oMorpho->add(new \Formal\Element\Checkbox(array(
@@ -79,12 +83,8 @@ class Standard extends \Baikal\Model\Config {
)));
$oMorpho->add(new \Formal\Element\Checkbox(array(
- "prop" => "BAIKAL_ADMIN_ENABLED",
- "label" => "Enable Web Admin",
- "popover" => array(
- "title" => "Warning !",
- "content" => "If disabled, you'll lose access to this very admin interface !",
- ),
+ "prop" => "BAIKAL_CARD_ENABLED",
+ "label" => "Enable CardDAV"
)));
$oMorpho->add(new \Formal\Element\Password(array(
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Dashboard.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Dashboard.php
index 9a42c37..b21807c 100755
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Dashboard.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Dashboard.php
@@ -32,17 +32,47 @@ class Dashboard extends \Flake\Core\Controller {
}
public function render() {
- $sLinkUsers = \BaikalAdmin\Controller\Users::link();
+ $oView = new \BaikalAdmin\View\Dashboard();
+ $oView->setData("BAIKAL_VERSION", BAIKAL_VERSION);
- $sMessage =<<
-* Nombre de calendriers
-* Nombre d'évènements
-* Version + Mise à jour de baikal
-* Lien vers liste des utilisateurs
-* Lien vers paramétrage
-MESSAGE;
- return $sMessage;
+ # Services status
+ $oView->setData("BAIKAL_CAL_ENABLED", BAIKAL_CAL_ENABLED);
+ $oView->setData("BAIKAL_CARD_ENABLED", BAIKAL_CARD_ENABLED);
+
+ # Statistics: Users
+ $iNbUsers = \Baikal\Model\User::getBaseRequester()->count();
+ $oView->setData("nbusers", $iNbUsers);
+
+ # Statistics: CalDAV
+ $iNbCalendars = \Baikal\Model\Calendar::getBaseRequester()->count();
+ $oView->setData("nbcalendars", $iNbCalendars);
+
+ $iNbEvents = \Baikal\Model\Calendar\Event::getBaseRequester()->count();
+ $oView->setData("nbevents", $iNbEvents);
+
+ if($iNbCalendars > 0) {
+ $fEventsPerCalendarAvg = $iNbEvents / $iNbCalendars;
+ } else {
+ $fEventsPerCalendarAvg = 0;
+ }
+
+ $oView->setData("eventspercalendaravg", $fEventsPerCalendarAvg);
+
+ # Statistics: CardDAV
+ $iNbBooks = \Baikal\Model\AddressBook::getBaseRequester()->count();
+ $oView->setData("nbbooks", $iNbBooks);
+
+ $iNbContacts = \Baikal\Model\AddressBook\Contact::getBaseRequester()->count();
+ $oView->setData("nbcontacts", $iNbEvents);
+
+ if($iNbBooks > 0) {
+ $fContactsPerBookAvg = $iNbContacts / $iNbBooks;
+ } else {
+ $fContactsPerBookAvg = 0;
+ }
+
+ $oView->setData("contactsperbookavg", $fContactsPerBookAvg);
+
+ return $oView->render();
}
}
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/Initialize.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/Initialize.php
index 2dc0192..29e33ec 100755
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/Initialize.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/Initialize.php
@@ -79,7 +79,7 @@ PHP;
}
public function render() {
- $sBigIcon = \BaikalAdmin\Model\Install::bigicon();
+ $sBigIcon = "glyph2x-magic";
$sBaikalVersion = BAIKAL_VERSION;
$sHtml = <<
HTML;
-/* $sHtml .= <<What is this ?
-
- It's displayed because you just installed or upgraded your Baïkal installation.
- Baïkal requires some maintenance in order to ensure everything works as expected.
-