parent
3228f1929a
commit
9a76e88902
12 changed files with 58 additions and 60 deletions
|
@ -36,7 +36,7 @@ class Tools {
|
||||||
$aUsers = array();
|
$aUsers = array();
|
||||||
|
|
||||||
# Fetching user
|
# Fetching user
|
||||||
$stmt = BaikalTools::db()->prepare("SELECT * FROM users");
|
$stmt = \Baikal\Core\Tools::db()->prepare("SELECT * FROM users");
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
while(($user = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_FIRST)) !== FALSE) {
|
while(($user = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_FIRST)) !== FALSE) {
|
||||||
$aUsers[] = $user;
|
$aUsers[] = $user;
|
||||||
|
|
|
@ -1,4 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
define("BAIKALADMIN_PATH_ROOT", dirname(dirname(__FILE__)) . "/");
|
||||||
|
|
||||||
|
# Bootstrap Baikal Core
|
||||||
|
require_once(dirname(dirname(dirname(__FILE__))) . "/Baikal/Core/Bootstrap.php"); # ../../, symlink-safe
|
||||||
|
|
||||||
|
# Bootstrap Flake
|
||||||
|
require_once(dirname(dirname(dirname(__FILE__))) . "/Flake/Core/Bootstrap.php");
|
||||||
|
|
||||||
|
# Registering BaikalAdmin classloader
|
||||||
require_once(dirname(__FILE__) . '/ClassLoader.php');
|
require_once(dirname(__FILE__) . '/ClassLoader.php');
|
||||||
\BaikalAdmin\Core\ClassLoader::register();
|
\BaikalAdmin\Core\ClassLoader::register();
|
||||||
|
|
||||||
|
# Include BaikalAdmin Framework config
|
||||||
|
require_once(BAIKALADMIN_PATH_ROOT . "config.php");
|
|
@ -1,19 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
define("BAIKALADMIN_PATH_ROOT", BAIKAL_PATH_FRAMEWORKS . "BaikalAdmin/");
|
|
||||||
define("BAIKALADMIN_PATH_TEMPLATES", BAIKALADMIN_PATH_ROOT . "Resources/Templates/");
|
define("BAIKALADMIN_PATH_TEMPLATES", BAIKALADMIN_PATH_ROOT . "Resources/Templates/");
|
||||||
|
|
||||||
define("FLAKE_DB_FILEPATH", BAIKAL_SQLITE_FILE);
|
|
||||||
define("FLAKE_TIMEZONE", BAIKAL_TIMEZONE);
|
|
||||||
define("FLAKE_PATH_FRAMEWORKS", BAIKAL_PATH_FRAMEWORKS);
|
|
||||||
define("FLAKE_PATH_ROOT", BAIKAL_PATH_FRAMEWORKS . "Flake/");
|
|
||||||
define("FLAKE_PATH_WWWROOT", BAIKAL_PATH_WWWROOT);
|
|
||||||
define("FLAKE_SAFEHASH_SALT", "une-clef-super-secrete");
|
|
||||||
define("FLAKE_LOCALE", "fr_FR.UTF-8");
|
|
||||||
|
|
||||||
# TODO: CHANGE THIS
|
|
||||||
define("FLAKE_BASEURL", "http://baikal.jeromeschneider.fr/");
|
|
||||||
|
|
||||||
$GLOBALS["ROUTES"] = array(
|
$GLOBALS["ROUTES"] = array(
|
||||||
"default" => "\BaikalAdmin\Route\User\Listing",
|
"default" => "\BaikalAdmin\Route\User\Listing",
|
||||||
);
|
);
|
|
@ -31,18 +31,9 @@ define("BAIKAL_CONTEXT", TRUE);
|
||||||
define("BAIKAL_CONTEXT_ADMIN", TRUE);
|
define("BAIKAL_CONTEXT_ADMIN", TRUE);
|
||||||
define("PATH_ENTRYDIR", dirname(__FILE__) . "/");
|
define("PATH_ENTRYDIR", dirname(__FILE__) . "/");
|
||||||
|
|
||||||
# Bootstrap Baikal Core
|
|
||||||
require_once(dirname(PATH_ENTRYDIR) . "/Baikal/Core/Bootstrap.php"); # ../, symlink-safe
|
|
||||||
|
|
||||||
# Include BaikalAdmin config files
|
|
||||||
require_once(PATH_ENTRYDIR . "config.php");
|
|
||||||
|
|
||||||
# Bootstrap BaikalAdmin
|
# Bootstrap BaikalAdmin
|
||||||
require_once(PATH_ENTRYDIR . "Core/Bootstrap.php");
|
require_once(PATH_ENTRYDIR . "Core/Bootstrap.php");
|
||||||
|
|
||||||
# Bootstrap Flake
|
|
||||||
require_once(FLAKE_PATH_ROOT . "Core/Bootstrap.php");
|
|
||||||
|
|
||||||
# Evaluate assertions
|
# Evaluate assertions
|
||||||
\BaikalAdmin\Core\Auth::assertEnabled();
|
\BaikalAdmin\Core\Auth::assertEnabled();
|
||||||
\BaikalAdmin\Core\Auth::assertAuthentified();
|
\BaikalAdmin\Core\Auth::assertAuthentified();
|
||||||
|
@ -58,9 +49,3 @@ $oPage->setBaseUrl(FLAKE_BASEURL);
|
||||||
|
|
||||||
# Render the page
|
# Render the page
|
||||||
echo $oPage->render();
|
echo $oPage->render();
|
||||||
|
|
||||||
/*require_once(BAIKAL_PATH_FRAMEWORKS . "Baikal/Includes.php");
|
|
||||||
|
|
||||||
BaikalAdmin::assertEnabled();
|
|
||||||
BaikalAdmin::assertAuthentified();
|
|
||||||
BaikalAdmin::handleRequest();*/
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
define("FLAKE_PATH_ROOT", dirname(dirname(__FILE__)) . "/"); # ../
|
||||||
|
|
||||||
// les notices PHP ne sont pas affichées
|
// les notices PHP ne sont pas affichées
|
||||||
ini_set("display_errors", 1);
|
ini_set("display_errors", 1);
|
||||||
ini_set("error_reporting", E_ALL & ~E_NOTICE);
|
ini_set("error_reporting", E_ALL & ~E_NOTICE);
|
||||||
|
@ -23,6 +25,9 @@ if(!function_exists("debug")) {
|
||||||
require_once(FLAKE_PATH_ROOT . 'Core/ClassLoader.php');
|
require_once(FLAKE_PATH_ROOT . 'Core/ClassLoader.php');
|
||||||
\Flake\Core\ClassLoader::register();
|
\Flake\Core\ClassLoader::register();
|
||||||
|
|
||||||
|
# Include Flake Framework config
|
||||||
|
require_once(FLAKE_PATH_ROOT . "config.php");
|
||||||
|
|
||||||
if(!\Flake\Util\Tools::isCliPhp()) {
|
if(!\Flake\Util\Tools::isCliPhp()) {
|
||||||
session_start();
|
session_start();
|
||||||
\Flake\Util\Tools::decode_GET();
|
\Flake\Util\Tools::decode_GET();
|
||||||
|
|
11
CoreVersions/Baikal_0.1/Frameworks/Flake/config.php
Normal file
11
CoreVersions/Baikal_0.1/Frameworks/Flake/config.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
# TODO: CHANGE THIS
|
||||||
|
define("FLAKE_BASEURL", "http://baikal.jeromeschneider.fr/");
|
|
@ -28,9 +28,8 @@
|
||||||
define("BAIKAL_CONTEXT", TRUE);
|
define("BAIKAL_CONTEXT", TRUE);
|
||||||
define("BAIKAL_CONTEXT_CLI", TRUE);
|
define("BAIKAL_CONTEXT_CLI", TRUE);
|
||||||
|
|
||||||
define("PATH_ENTRYDIR", dirname(__FILE__) . "/");
|
# Bootstraping Baikal
|
||||||
require_once(PATH_ENTRYDIR . "../Bootstrap.php");
|
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Core/Frameworks/Baikal/Core/Bootstrap.php"); # ../../../
|
||||||
require_once(BAIKAL_PATH_WWWROOT . "classes/BaikalTools.php");
|
|
||||||
|
|
||||||
$sUsername = @trim($argv[1]);
|
$sUsername = @trim($argv[1]);
|
||||||
|
|
||||||
|
@ -45,7 +44,7 @@ if(($user = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_FIRST)) === FALSE) {
|
||||||
die("User not found; aborting.\n");
|
die("User not found; aborting.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sCalendarID = BaikalTools::bashPrompt("Calendar Key (a unique, lower-case, alphanum token, like perso or sailing): ");
|
$sCalendarID = \Baikal\Core\Tools::bashPrompt("Calendar Key (a unique, lower-case, alphanum token, like 'perso' or 'sailing'): ");
|
||||||
if($sCalendarID === "") {
|
if($sCalendarID === "") {
|
||||||
die("Calendar Key cannot be empty.\n");
|
die("Calendar Key cannot be empty.\n");
|
||||||
}
|
}
|
||||||
|
@ -66,7 +65,7 @@ if(($cal = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_FIRST)) !== FALSE) {
|
||||||
die("This Calendar Key is already in use for this user; aborting.\n");
|
die("This Calendar Key is already in use for this user; aborting.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sCalendarName = BaikalTools::bashPrompt("Calendar Display Name: ");
|
$sCalendarName = \Baikal\Core\Tools::bashPrompt("Calendar Display Name: ");
|
||||||
if($sCalendarName === "") {
|
if($sCalendarName === "") {
|
||||||
die("Calendar Display Name cannot be empty.\n");
|
die("Calendar Display Name cannot be empty.\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,8 @@
|
||||||
define("BAIKAL_CONTEXT", TRUE);
|
define("BAIKAL_CONTEXT", TRUE);
|
||||||
define("BAIKAL_CONTEXT_CLI", TRUE);
|
define("BAIKAL_CONTEXT_CLI", TRUE);
|
||||||
|
|
||||||
define("PATH_ENTRYDIR", dirname(__FILE__) . "/");
|
# Bootstraping Baikal
|
||||||
require_once(PATH_ENTRYDIR . "../Bootstrap.php");
|
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Core/Frameworks/Baikal/Core/Bootstrap.php"); # ../../../
|
||||||
require_once(BAIKAL_PATH_WWWROOT . "classes/BaikalTools.php");
|
|
||||||
|
|
||||||
$sUsername = @trim($argv[1]);
|
$sUsername = @trim($argv[1]);
|
||||||
|
|
||||||
|
@ -38,8 +37,8 @@ if($sUsername === "") {
|
||||||
die("You have to provide a username; aborting.\n");
|
die("You have to provide a username; aborting.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sPassword = BaikalTools::bashPromptSilent("Password: ");
|
$sPassword = \Baikal\Core\Tools::bashPromptSilent("Password: ");
|
||||||
$sPasswordConfirm = BaikalTools::bashPromptSilent("Confirm password: ");
|
$sPasswordConfirm = \Baikal\Core\Tools::bashPromptSilent("Confirm password: ");
|
||||||
|
|
||||||
if($sPassword === "") {
|
if($sPassword === "") {
|
||||||
die("Password cannot be empty.\n");
|
die("Password cannot be empty.\n");
|
||||||
|
@ -51,8 +50,8 @@ if($sPassword !== $sPasswordConfirm) {
|
||||||
|
|
||||||
$sHash = md5($sUsername . ':' . BAIKAL_AUTH_REALM . ':' . $sPassword);
|
$sHash = md5($sUsername . ':' . BAIKAL_AUTH_REALM . ':' . $sPassword);
|
||||||
|
|
||||||
$sEmail = BaikalTools::bashPrompt("Email: ");
|
$sEmail = \Baikal\Core\Tools::bashPrompt("Email: ");
|
||||||
$sDisplayName = BaikalTools::bashPrompt("Display name: ");
|
$sDisplayName = \Baikal\Core\Tools::bashPrompt("Display name: ");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$stmt = $pdo->prepare("INSERT INTO users (username, digesta1) VALUES (?, ?)");
|
$stmt = $pdo->prepare("INSERT INTO users (username, digesta1) VALUES (?, ?)");
|
||||||
|
|
|
@ -28,10 +28,11 @@
|
||||||
define("BAIKAL_CONTEXT", TRUE);
|
define("BAIKAL_CONTEXT", TRUE);
|
||||||
define("BAIKAL_CONTEXT_CLI", TRUE);
|
define("BAIKAL_CONTEXT_CLI", TRUE);
|
||||||
|
|
||||||
define("PATH_ENTRYDIR", dirname(__FILE__) . "/");
|
# Bootstraping Baikal
|
||||||
require_once(PATH_ENTRYDIR . "../Bootstrap.php");
|
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Core/Frameworks/Baikal/Core/Bootstrap.php"); # ../../../
|
||||||
require_once(BAIKAL_PATH_WWWROOT . "classes/BaikalTools.php");
|
|
||||||
require_once(BAIKAL_PATH_WWWROOT . "classes/BaikalAdmin.php");
|
# Bootstraping BaikalAdmin
|
||||||
|
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Core/Frameworks/BaikalAdmin/Core/Bootstrap.php"); # ../../../
|
||||||
|
|
||||||
$sConfigFile = BAIKAL_PATH_SPECIFIC . "config.php";
|
$sConfigFile = BAIKAL_PATH_SPECIFIC . "config.php";
|
||||||
|
|
||||||
|
@ -52,8 +53,8 @@ if(!defined("BAIKAL_ADMIN_PASSWORDHASH")) {
|
||||||
$bFound = TRUE;
|
$bFound = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sPassword = BaikalTools::bashPromptSilent("New admin password: ");
|
$sPassword = \Baikal\Core\Tools::bashPromptSilent("New admin password: ");
|
||||||
$sPasswordConfirm = BaikalTools::bashPromptSilent("Confirm new admin password: ");
|
$sPasswordConfirm = \Baikal\Core\Tools::bashPromptSilent("Confirm new admin password: ");
|
||||||
|
|
||||||
if($sPassword === "") {
|
if($sPassword === "") {
|
||||||
die("Password cannot be empty.\n");
|
die("Password cannot be empty.\n");
|
||||||
|
@ -63,7 +64,7 @@ if($sPassword !== $sPasswordConfirm) {
|
||||||
die("Passwords don't match; aborting.\n");
|
die("Passwords don't match; aborting.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sHash = BaikalAdmin::hashAdminPassword($sPassword);
|
$sHash = \BaikalAdmin\Core\Auth::hashAdminPassword($sPassword);
|
||||||
|
|
||||||
echo ("\nNew password hash:" . $sHash . "\n");
|
echo ("\nNew password hash:" . $sHash . "\n");
|
||||||
$sFileContents = file_get_contents($sConfigFile);
|
$sFileContents = file_get_contents($sConfigFile);
|
||||||
|
|
|
@ -28,9 +28,8 @@
|
||||||
define("BAIKAL_CONTEXT", TRUE);
|
define("BAIKAL_CONTEXT", TRUE);
|
||||||
define("BAIKAL_CONTEXT_CLI", TRUE);
|
define("BAIKAL_CONTEXT_CLI", TRUE);
|
||||||
|
|
||||||
define("PATH_ENTRYDIR", dirname(__FILE__) . "/");
|
# Bootstraping Baikal
|
||||||
require_once(PATH_ENTRYDIR . "../Bootstrap.php");
|
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Core/Frameworks/Baikal/Core/Bootstrap.php"); # ../../../
|
||||||
require_once(BAIKAL_PATH_WWWROOT . "classes/BaikalTools.php");
|
|
||||||
|
|
||||||
$sUsername = @trim($argv[1]);
|
$sUsername = @trim($argv[1]);
|
||||||
|
|
||||||
|
@ -45,7 +44,7 @@ if(($user = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_FIRST)) === FALSE) {
|
||||||
die("User not found; aborting.\n");
|
die("User not found; aborting.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sCalendarID = BaikalTools::bashPrompt("Calendar Key: ");
|
$sCalendarID = \Baikal\Core\Tools::bashPrompt("Calendar Key: ");
|
||||||
if($sCalendarID === "") {
|
if($sCalendarID === "") {
|
||||||
die("Calendar Key cannot be empty.\n");
|
die("Calendar Key cannot be empty.\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,8 @@
|
||||||
define("BAIKAL_CONTEXT", TRUE);
|
define("BAIKAL_CONTEXT", TRUE);
|
||||||
define("BAIKAL_CONTEXT_CLI", TRUE);
|
define("BAIKAL_CONTEXT_CLI", TRUE);
|
||||||
|
|
||||||
define("PATH_ENTRYDIR", dirname(__FILE__) . "/");
|
# Bootstraping Baikal
|
||||||
require_once(PATH_ENTRYDIR . "../Bootstrap.php");
|
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/Core/Frameworks/Baikal/Core/Bootstrap.php"); # ../../../
|
||||||
require_once(BAIKAL_PATH_WWWROOT . "classes/BaikalTools.php");
|
|
||||||
|
|
||||||
$sUsername = isset($argv[1]) ? trim($argv[1]) : "";
|
$sUsername = isset($argv[1]) ? trim($argv[1]) : "";
|
||||||
|
|
||||||
|
@ -59,13 +58,13 @@ echo "--User found--\nid:\t\t" . $user["id"] . "\nemail:\t\t" . $principal["emai
|
||||||
|
|
||||||
echo "\n--Please enter new values--\n";
|
echo "\n--Please enter new values--\n";
|
||||||
|
|
||||||
$sPassword = BaikalTools::bashPromptSilent("Password (empty to leave untouched): ");
|
$sPassword = \Baikal\Core\Tools::bashPromptSilent("Password (empty to leave untouched): ");
|
||||||
$sHash = "";
|
$sHash = "";
|
||||||
$sEmail = "";
|
$sEmail = "";
|
||||||
$sDisplayName = "";
|
$sDisplayName = "";
|
||||||
|
|
||||||
if($sPassword !== "") {
|
if($sPassword !== "") {
|
||||||
$sPasswordConfirm = BaikalTools::bashPromptSilent("Confirm password: ");
|
$sPasswordConfirm = \Baikal\Core\Tools::bashPromptSilent("Confirm password: ");
|
||||||
if($sPassword !== $sPasswordConfirm) {
|
if($sPassword !== $sPasswordConfirm) {
|
||||||
die("Passwords don't match; aborting.\n");
|
die("Passwords don't match; aborting.\n");
|
||||||
}
|
}
|
||||||
|
@ -73,8 +72,8 @@ if($sPassword !== "") {
|
||||||
$sHash = md5($sUsername . ':' . BAIKAL_AUTH_REALM . ':' . $sPassword);
|
$sHash = md5($sUsername . ':' . BAIKAL_AUTH_REALM . ':' . $sPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sEmail = BaikalTools::bashPrompt("Email (empty to leave untouched): ");
|
$sEmail = \Baikal\Core\Tools::bashPrompt("Email (empty to leave untouched): ");
|
||||||
$sDisplayName = BaikalTools::bashPrompt("Display name (empty to leave untouched): ");
|
$sDisplayName = \Baikal\Core\Tools::bashPrompt("Display name (empty to leave untouched): ");
|
||||||
|
|
||||||
|
|
||||||
if($sHash === "" && $sEmail === "" && $sDisplayName === "") {
|
if($sHash === "" && $sEmail === "" && $sDisplayName === "") {
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue