diff --git a/CoreVersions/Baikal_0.1/Frameworks/Baikal/Includes.php b/CoreVersions/Baikal_0.1/Frameworks/Baikal/Includes.php
deleted file mode 100644
index 77b90ed..0000000
--- a/CoreVersions/Baikal_0.1/Frameworks/Baikal/Includes.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-* 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!
-***************************************************************/
-
-define("BAIKAL_FRAMEWORK_ROOT", dirname(__FILE__) . "/");
-define("BAIKAL_FRAMEWORK_LIBDIR", BAIKAL_FRAMEWORK_ROOT . "lib/");
-define("BAIKAL_FRAMEWORK_RESDIR", BAIKAL_FRAMEWORK_ROOT . "res/");
-
-require_once(BAIKAL_FRAMEWORK_LIBDIR . "BaikalTemplate.php");
-require_once(BAIKAL_FRAMEWORK_LIBDIR . "BaikalAdmin.php");
-require_once(BAIKAL_FRAMEWORK_LIBDIR . "BaikalTools.php");
\ No newline at end of file
diff --git a/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalAdmin.php b/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalAdmin.php
deleted file mode 100644
index b2daa1a..0000000
--- a/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalAdmin.php
+++ /dev/null
@@ -1,120 +0,0 @@
-
-* 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!
-***************************************************************/
-
-require_once(BAIKAL_PATH_FRAMEWORKS . "Tabulator/Tabulator.html.php");
-
-class BaikalAdmin {
-
- static function assertEnabled() {
- if(!defined("BAIKAL_ADMIN_ENABLED") || BAIKAL_ADMIN_ENABLED !== TRUE) {
- die("
Baïkal Admin is disabled.
To enable it, set BAIKAL_ADMIN_ENABLED to TRUE in Specific/config.php");
- }
-
- $bLocked = TRUE;
- $sEnableFile = BAIKAL_PATH_SPECIFIC . "ENABLE_ADMIN";
- if(file_exists($sEnableFile)) {
-
- clearstatcache();
- $iTime = intval(filemtime($sEnableFile));
- if((time() - $iTime) < 3600) {
- // file has been created more than an hour ago
- // delete and declare locked
-
- $bLocked = FALSE;
- } else {
- if(!@unlink($sEnableFile)) {
- die("
Baïkal Admin is locked.
To unlock it, delete and re-create an empty file named ENABLE_ADMIN in Specific/config.php");
- }
- }
- }
-
- if($bLocked) {
- die("
Baïkal Admin is locked.
To unlock it, create an empty file named ENABLE_ADMIN in Specific/");
- } else {
- // update filemtime
- @touch($sEnableFile);
- }
- }
-
- static function assertAuthentified() {
- if(!self::isAuthentified()) {
- header(utf8_decode('WWW-Authenticate: Basic realm="Baïkal admin"'));
- header('HTTP/1.0 401 Unauthorized');
- die("Please authenticate.");
- }
-
- return TRUE;
- }
-
- static function isAuthentified() {
-
- if(array_key_exists("PHP_AUTH_USER", $_SERVER)) {
- $sUser = $_SERVER["PHP_AUTH_USER"];
- } else {
- $sUser = FALSE;
- }
-
- if(array_key_exists("PHP_AUTH_PW", $_SERVER)) {
- $sPass = $_SERVER["PHP_AUTH_PW"];
- } else {
- $sPass = FALSE;
- }
-
- $sPassHash = self::hashAdminPassword($sPass);
-
- if($sUser === "admin" && $sPassHash === BAIKAL_ADMIN_PASSWORDHASH) {
- return TRUE;
- }
-
- return FALSE;
- }
-
- static function hashAdminPassword($sPassword) {
- return md5('admin:' . BAIKAL_AUTH_REALM . ':' . $sPassword);
- }
-
- static function wrapWithInterface($sHtml) {
- $oTemplate = new BaikalTemplate(BAIKAL_FRAMEWORK_RESDIR . "template.html");
- return $oTemplate->parse(array(
- "pagetitle" => "Users",
- "pagecontent" => $sHtml
- ));
- }
-
- static function displayUsers() {
- $aUsers = BaikalTools::getUsers();
-
- $oTabulator = new TabulatorHtml("table table-bordered");
- $oTabulator->addColumn(self::makeColumn("id", "Id", "numeric"));
- $oTabulator->addColumn(self::makeColumn("username", "Username"));
- return $oTabulator->render($aUsers);
- }
-
- static function &makeColumn($sName, $sHeader = "", $sType = "text") {
- $oColumn = new TabulatorColumnHtml($sName, $sHeader, $sType);
- return $oColumn;
- }
-}
\ No newline at end of file
diff --git a/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalTemplate.php b/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalTemplate.php
deleted file mode 100644
index 6a310f6..0000000
--- a/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalTemplate.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
-* 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!
-***************************************************************/
-
-class BaikalTemplate {
-
- private $sAbsPath = "";
- private $sHtml = "";
-
- public function __construct($sAbsPath) {
- $this->sAbsPath = $sAbsPath;
- $this->sHtml = self::getTemplateFile(
- $this->sAbsPath
- );
- }
-
- public function parse($aMarkers = array()) {
- return self::parseTemplateCodePhp(
- $this->sHtml,
- $aMarkers
- );
- }
-
- protected static function getTemplateFile($sAbsPath) {
- return file_get_contents($sAbsPath);
- }
-
- protected static function parseTemplateCodePhp($sCode, $aMarkers) {
- extract($aMarkers);
- ob_start();
- echo eval('?>' . $sCode . '');
- $sHtml = ob_get_contents();
- ob_end_clean();
-
- return $sHtml;
- }
-}
\ No newline at end of file
diff --git a/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalTools.php b/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalTools.php
deleted file mode 100644
index da1e295..0000000
--- a/CoreVersions/Baikal_0.1/Frameworks/Baikal/lib/BaikalTools.php
+++ /dev/null
@@ -1,71 +0,0 @@
-
-* 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!
-***************************************************************/
-
-class BaikalTools {
- public static function &db() {
- return $GLOBALS["pdo"];
- }
-
- public static function getUsers() {
-
- $aUsers = array();
-
- # Fetching user
- $stmt = BaikalTools::db()->prepare("SELECT * FROM users");
- $stmt->execute();
- while(($user = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_FIRST)) !== FALSE) {
- $aUsers[] = $user;
- }
-
- reset($aUsers);
- return $aUsers;
- }
-
- static function bashPrompt($prompt) {
- print $prompt;
- @flush();
- @ob_flush();
- $confirmation = @trim(fgets(STDIN));
- return $confirmation;
- }
-
- static function bashPromptSilent($prompt = "Enter Password:") {
- $command = "/usr/bin/env bash -c 'echo OK'";
-
- if(rtrim(shell_exec($command)) !== 'OK') {
- trigger_error("Can't invoke bash");
- return;
- }
-
- $command = "/usr/bin/env bash -c 'read -s -p \""
- . addslashes($prompt)
- . "\" mypassword && echo \$mypassword'";
-
- $password = rtrim(shell_exec($command));
- echo "\n";
- return $password;
- }
-}
\ No newline at end of file
diff --git a/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Controler/User/Listing.php b/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Controler/User/Listing.php
new file mode 100644
index 0000000..7569834
--- /dev/null
+++ b/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Controler/User/Listing.php
@@ -0,0 +1,19 @@
+execute();
+ $oView = new \BaikalAdmin\View\User\Listing();
+ $oView->setData("users", $oUsers);
+
+ return $oView->render();
+ }
+}
\ No newline at end of file
diff --git a/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Core/Auth.php b/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Core/Auth.php
new file mode 100644
index 0000000..55830e3
--- /dev/null
+++ b/CoreVersions/Baikal_0.1/Frameworks/BaikalAdmin/Core/Auth.php
@@ -0,0 +1,73 @@
+Baïkal Admin is disabled.To enable it, set BAIKAL_ADMIN_ENABLED to TRUE in Specific/config.php");
+ }
+
+ $bLocked = TRUE;
+ $sEnableFile = BAIKAL_PATH_SPECIFIC . "ENABLE_ADMIN";
+ if(file_exists($sEnableFile)) {
+
+ clearstatcache();
+ $iTime = intval(filemtime($sEnableFile));
+ if((time() - $iTime) < 3600) {
+ // file has been created more than an hour ago
+ // delete and declare locked
+
+ $bLocked = FALSE;
+ } else {
+ if(!@unlink($sEnableFile)) {
+ die("
Baïkal Admin is locked.
To unlock it, delete and re-create an empty file named ENABLE_ADMIN in Specific/config.php");
+ }
+ }
+ }
+
+ if($bLocked) {
+ die("