Working on web admin
This commit is contained in:
parent
09e58888bb
commit
545876ec4f
38 changed files with 520 additions and 176 deletions
|
@ -50,14 +50,6 @@ class Dashboard extends \Flake\Core\Controller {
|
|||
$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);
|
||||
|
@ -65,14 +57,6 @@ class Dashboard extends \Flake\Core\Controller {
|
|||
$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();
|
||||
}
|
||||
}
|
|
@ -81,23 +81,22 @@ PHP;
|
|||
public function render() {
|
||||
$sBigIcon = "glyph2x-magic";
|
||||
$sBaikalVersion = BAIKAL_VERSION;
|
||||
|
||||
$sHtml = <<<HTML
|
||||
<header class="jumbotron subhead" id="overview">
|
||||
<h1><i class="{$sBigIcon}"></i>Baïkal initialization wizard</h1>
|
||||
<p class="lead">Configure your new Baïkal <strong>{$sBaikalVersion}</strong> installation.</p>
|
||||
</header>
|
||||
HTML;
|
||||
|
||||
$oView = new \BaikalAdmin\View\Install\Initialize();
|
||||
$oView->setData("baikalversion", BAIKAL_VERSION);
|
||||
|
||||
if($this->oForm->persisted()) {
|
||||
$sHtml .= "<p>Baïkal is now configured. You may now <a class='btn btn-success' href='" . PROJECT_URI . "admin/'>Access the Baïkal admin</a></h2>";
|
||||
|
||||
$sMessage = "<p>Baïkal is now configured. You may now <a class='btn btn-success' href='" . PROJECT_URI . "admin/'>Access the Baïkal admin</a></h2>";
|
||||
$sForm = "";
|
||||
} else {
|
||||
# Display the config form
|
||||
$sHtml .= $this->oForm->render();
|
||||
$sMessage = "";
|
||||
$sForm = $this->oForm->render();
|
||||
}
|
||||
|
||||
return $sHtml;
|
||||
|
||||
$oView->setData("message", $sMessage);
|
||||
$oView->setData("form", $sForm);
|
||||
|
||||
return $oView->render();
|
||||
}
|
||||
|
||||
protected function tagConfiguredVersion() {
|
||||
|
|
|
@ -34,38 +34,43 @@ class Login extends \Flake\Core\Controller {
|
|||
public function render() {
|
||||
$sActionUrl = \Flake\Util\Tools::getCurrentUrl();
|
||||
$sSubmittedFlagName = "auth";
|
||||
|
||||
if(self::isSubmitted() && !\BaikalAdmin\Core\Auth::isAuthenticated()) {
|
||||
$sMessage = \Formal\Core\Message::error(
|
||||
"The login/password you provided is invalid. Please retry.",
|
||||
"Authentication error"
|
||||
);
|
||||
} elseif(self::justLoggedOut()) {
|
||||
$sMessage = \Formal\Core\Message::notice(
|
||||
"You have been disconnected from your session.",
|
||||
"Session ended",
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
|
||||
$sLogin = htmlspecialchars(\Flake\Util\Tools::POST("login"));
|
||||
$sPassword = htmlspecialchars(\Flake\Util\Tools::POST("password"));
|
||||
|
||||
if(trim($sLogin) === "") {
|
||||
$sLogin = "admin";
|
||||
}
|
||||
|
||||
$sForm =<<<FORM
|
||||
|
||||
<header class="jumbotron subhead" id="overview">
|
||||
<h1><i class="glyph2x-lock"></i>Authentication</h1>
|
||||
<p class="lead">Please authenticate to access Baïkal Web Admin.</p>
|
||||
</header>
|
||||
|
||||
<form class="form-horizontal" action="{$sActionUrl}" method="post" enctype="multipart/formdata">
|
||||
<input type="hidden" name="{$sSubmittedFlagName}" value="1" />
|
||||
<fieldset>
|
||||
<p>
|
||||
<label for="login">Login</label>
|
||||
<input type="text" name="login" value="{$sLogin}" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" value="{$sPassword}" />
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">Authenticate</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
FORM;
|
||||
return $sForm;
|
||||
$oView = new \BaikalAdmin\View\Login();
|
||||
$oView->setData("message", $sMessage);
|
||||
$oView->setData("actionurl", $sActionUrl);
|
||||
$oView->setData("submittedflagname", $sSubmittedFlagName);
|
||||
$oView->setData("login", $sLogin);
|
||||
$oView->setData("password", $sPassword);
|
||||
|
||||
return $oView->render();
|
||||
}
|
||||
|
||||
protected static function isSubmitted() {
|
||||
return (intval(\Flake\Util\Tools::POST("auth")) === 1);
|
||||
}
|
||||
|
||||
protected static function justLoggedOut() {
|
||||
$aParams = $GLOBALS["ROUTER"]::getURLParams();
|
||||
return (!empty($aParams) && $aParams[0] === "loggedout");
|
||||
}
|
||||
}
|
43
CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Logout.php
Executable file
43
CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Logout.php
Executable file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\Controller;
|
||||
|
||||
class Logout extends \Flake\Core\Controller {
|
||||
|
||||
public function execute() {
|
||||
\BaikalAdmin\Core\Auth::unAuthenticate();
|
||||
|
||||
$sControllerForDefaultRoute = $GLOBALS["ROUTER"]::getControllerForRoute("default");
|
||||
# debug($sControllerForDefaultRoute);
|
||||
# die();
|
||||
$sLink = $GLOBALS["ROUTER"]::buildRouteForController($sControllerForDefaultRoute, "loggedout");
|
||||
\Flake\Util\Tools::redirect($sLink);
|
||||
}
|
||||
|
||||
public function render() {
|
||||
}
|
||||
}
|
|
@ -33,6 +33,8 @@ class Topbar extends \Flake\Core\Controller {
|
|||
|
||||
public function render() {
|
||||
|
||||
$oView = new \BaikalAdmin\View\Navigation\Topbar();
|
||||
|
||||
$sCurrentRoute = $GLOBALS["ROUTER"]::getCurrentRoute();
|
||||
$sActiveHome = $sActiveUsers = $sActiveSettingsStandard = $sActiveSettingsSystem = "";
|
||||
|
||||
|
@ -41,6 +43,7 @@ class Topbar extends \Flake\Core\Controller {
|
|||
$sUsersLink = \BaikalAdmin\Controller\Users::link();
|
||||
$sSettingsStandardLink = \BaikalAdmin\Controller\Settings\Standard::link();
|
||||
$sSettingsSystemLink = \BaikalAdmin\Controller\Settings\System::link();
|
||||
$sLogoutLink = \BaikalAdmin\Controller\Logout::link();
|
||||
|
||||
if($sCurrentRoute === "default") {
|
||||
$sActiveHome = "active";
|
||||
|
@ -61,28 +64,16 @@ class Topbar extends \Flake\Core\Controller {
|
|||
$sActiveSettingsSystem = "active";
|
||||
}
|
||||
|
||||
$sHtml =<<<HTML
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<a class="brand" href="{$sHomeLink}">Baïkal Web Admin</a>
|
||||
<div class="nav-collapse">
|
||||
<ul class="nav">
|
||||
<li class="{$sActiveHome}"> <a href="{$sHomeLink}">Dashboard</a></li>
|
||||
<li class="{$sActiveUsers}"> <a href="{$sUsersLink}">Users and resources</a></li>
|
||||
<li class="{$sActiveSettingsStandard}"> <a href="{$sSettingsStandardLink}">Settings</a></li>
|
||||
<li class="{$sActiveSettingsSystem}"> <a href="{$sSettingsSystemLink}">System settings</a></li>
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
return $sHtml;
|
||||
$oView->setData("activehome", $sActiveHome);
|
||||
$oView->setData("activeusers", $sActiveUsers);
|
||||
$oView->setData("activesettingsstandard", $sActiveSettingsStandard);
|
||||
$oView->setData("activesettingssystem", $sActiveSettingsSystem);
|
||||
$oView->setData("homelink", $sHomeLink);
|
||||
$oView->setData("userslink", $sUsersLink);
|
||||
$oView->setData("settingsstandardlink", $sSettingsStandardLink);
|
||||
$oView->setData("settingssystemlink", $sSettingsSystemLink);
|
||||
$oView->setData("logoutlink", $sLogoutLink);
|
||||
|
||||
return $oView->render();
|
||||
}
|
||||
}
|
|
@ -32,16 +32,7 @@ class Anonymous extends \Flake\Core\Controller {
|
|||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
$sHtml =<<<HTML
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand">Baïkal Web Admin</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
return $sHtml;
|
||||
$oView = new \BaikalAdmin\View\Navigation\Topbar\Anonymous();
|
||||
return $oView->render();
|
||||
}
|
||||
}
|
|
@ -32,16 +32,7 @@ class Install extends \Flake\Core\Controller {
|
|||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
$sHtml =<<<HTML
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand">Baïkal Install Tool</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
return $sHtml;
|
||||
$oView = new \BaikalAdmin\View\Navigation\Topbar\Install();
|
||||
return $oView->render();
|
||||
}
|
||||
}
|
|
@ -50,11 +50,9 @@ class Standard extends \Flake\Core\Controller {
|
|||
|
||||
public function render() {
|
||||
|
||||
$sHeader =<<<FORM
|
||||
<header class="jumbotron subhead" id="overview">
|
||||
<h1><i class="glyph2x-adjust"></i>Baïkal settings</h1>
|
||||
</header>
|
||||
FORM;
|
||||
return $sHeader . $this->oForm->render();
|
||||
$oView = new \BaikalAdmin\View\Settings\Standard();
|
||||
$oView->setData("form", $this->oForm->render());
|
||||
|
||||
return $oView->render();
|
||||
}
|
||||
}
|
|
@ -50,17 +50,15 @@ class System extends \Flake\Core\Controller {
|
|||
|
||||
public function render() {
|
||||
|
||||
$sHeader =<<<FORM
|
||||
<header class="jumbotron subhead" id="overview">
|
||||
<h1><i class="glyph2x-adjust"></i>Baïkal system settings</h1>
|
||||
</header>
|
||||
FORM;
|
||||
|
||||
$sMessage = \Formal\Core\Message::notice(
|
||||
$oView = new \BaikalAdmin\View\Settings\System();
|
||||
$oView->setData("message", \Formal\Core\Message::notice(
|
||||
"Do not change anything on this page unless you really know what you are doing.<br />You might break Baïkal if you misconfigure something here.",
|
||||
"Warning !",
|
||||
FALSE
|
||||
);
|
||||
return $sHeader . $sMessage . $this->oForm->render();
|
||||
));
|
||||
|
||||
$oView->setData("form", $this->oForm->render());
|
||||
|
||||
return $oView->render();
|
||||
}
|
||||
}
|
|
@ -118,29 +118,28 @@ class AddressBooks extends \Flake\Core\Controller {
|
|||
|
||||
public function render() {
|
||||
|
||||
$sHtml = "";
|
||||
$oView = new \BaikalAdmin\View\User\AddressBooks();
|
||||
|
||||
# Render list of users
|
||||
$oAddressBooks = $this->oUser->getAddressBooksBaseRequester()->execute();
|
||||
|
||||
$oView = new \BaikalAdmin\View\AddressBooks\Listing();
|
||||
# User
|
||||
$oView->setData("user", $this->oUser);
|
||||
$oView->setData("addressbooks", $oAddressBooks);
|
||||
$sHtml .= $oView->render();
|
||||
|
||||
# Render form
|
||||
$sHtml .= "<a id='form'></a>";
|
||||
# Render list of address books
|
||||
$oAddressBooks = $this->oUser->getAddressBooksBaseRequester()->execute();
|
||||
$oView->setData("addressbooks", $oAddressBooks);
|
||||
|
||||
# Messages
|
||||
$sMessages = implode("\n", $this->aMessages);
|
||||
$oView->setData("messages", $sMessages);
|
||||
|
||||
if(self::newRequested() || self::editRequested()) {
|
||||
# We have to display the User form
|
||||
$sHtml .= $this->oForm->render();
|
||||
$sForm = $this->oForm->render();
|
||||
} else {
|
||||
# No form is displayed; simply display messages, if any
|
||||
$sHtml .= $sMessages;
|
||||
$sForm = "";
|
||||
}
|
||||
|
||||
$oView->setData("form", $sForm);
|
||||
|
||||
return $sHtml;
|
||||
return $oView->render();
|
||||
}
|
||||
|
||||
protected function initForm() {
|
||||
|
|
|
@ -123,29 +123,28 @@ class Calendars extends \Flake\Core\Controller {
|
|||
|
||||
public function render() {
|
||||
|
||||
$sHtml = "";
|
||||
$oView = new \BaikalAdmin\View\User\Calendars();
|
||||
|
||||
# Render list of users
|
||||
$oCalendars = $this->oUser->getCalendarsBaseRequester()->execute();
|
||||
|
||||
$oView = new \BaikalAdmin\View\Calendars\Listing();
|
||||
# User
|
||||
$oView->setData("user", $this->oUser);
|
||||
$oView->setData("calendars", $oCalendars);
|
||||
$sHtml .= $oView->render();
|
||||
|
||||
# Render form
|
||||
$sHtml .= "<a id='form'></a>";
|
||||
# List of calendars
|
||||
$oCalendars = $this->oUser->getCalendarsBaseRequester()->execute();
|
||||
$oView->setData("calendars", $oCalendars);
|
||||
|
||||
# Messages
|
||||
$sMessages = implode("\n", $this->aMessages);
|
||||
$oView->setData("messages", $sMessages);
|
||||
|
||||
if(self::newRequested() || self::editRequested()) {
|
||||
# We have to display the User form
|
||||
$sHtml .= $this->oForm->render();
|
||||
$sForm = $this->oForm->render();
|
||||
} else {
|
||||
# No form is displayed; simply display messages, if any
|
||||
$sHtml .= $sMessages;
|
||||
$sForm = "";
|
||||
}
|
||||
|
||||
$oView->setData("form", $sForm);
|
||||
|
||||
return $sHtml;
|
||||
return $oView->render();
|
||||
}
|
||||
|
||||
protected function initForm() {
|
||||
|
|
|
@ -98,28 +98,27 @@ class Users extends \Flake\Core\Controller {
|
|||
}
|
||||
|
||||
public function render() {
|
||||
$sHtml = "";
|
||||
|
||||
# Render list of users
|
||||
$oView = new \BaikalAdmin\View\Users();
|
||||
|
||||
# List of users
|
||||
$oUsers = \Baikal\Model\User::getBaseRequester()->execute();
|
||||
$oView = new \BaikalAdmin\View\Users\Listing();
|
||||
$oView->setData("users", $oUsers);
|
||||
$sHtml .= $oView->render();
|
||||
|
||||
|
||||
# Render form
|
||||
$sHtml .= "<a id='form'></a>";
|
||||
# Messages
|
||||
$sMessages = implode("\n", $this->aMessages);
|
||||
|
||||
$oView->setData("messages", $sMessages);
|
||||
|
||||
# Form
|
||||
if(self::newRequested() || self::editRequested()) {
|
||||
# We have to display the User form
|
||||
$sHtml .= $this->oForm->render();
|
||||
$sForm = $this->oForm->render();
|
||||
} else {
|
||||
# No form is displayed; simply display messages, if any
|
||||
$sHtml .= $sMessages;
|
||||
$sForm = "";
|
||||
}
|
||||
|
||||
return $sHtml;
|
||||
$oView->setData("form", $sForm);
|
||||
|
||||
return $oView->render();
|
||||
}
|
||||
|
||||
protected function initForm() {
|
||||
|
|
|
@ -74,6 +74,11 @@ class Auth {
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public static function authenticate() {
|
||||
|
||||
if(intval(\Flake\Util\Tools::POST("auth")) !== 1) {
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -89,6 +94,11 @@ class Auth {
|
|||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
public static function unAuthenticate() {
|
||||
unset($_SESSION["baikaladminauth"]);
|
||||
}
|
||||
|
||||
public static function hashAdminPassword($sPassword) {
|
||||
|
|
|
@ -89,10 +89,6 @@
|
|||
<td>Number of events</td>
|
||||
<td><span class="badge"><?= $nbevents ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Events per calendar avg.</td>
|
||||
<td><span class="badge"><?= $eventspercalendaravg ?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -108,10 +104,6 @@
|
|||
<td>Number of contacts</td>
|
||||
<td><span class="badge"><?= $nbcontacts ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Contacts per book avg.</td>
|
||||
<td><span class="badge"><?= $contactsperbookavg ?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<header class="jumbotron subhead" id="overview">
|
||||
<h1><i class="glyph2x-magic"></i>Baïkal initialization wizard</h1>
|
||||
<p class="lead">Configure your new Baïkal <strong><?= $baikalversion ?></strong> installation.</p>
|
||||
</header>
|
||||
|
||||
<a id="formid"></a>
|
||||
<?= $message ?>
|
||||
<?= $form ?>
|
25
CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Login.html
Executable file
25
CoreVersions/0.2.0/Frameworks/BaikalAdmin/Resources/Templates/Login.html
Executable file
|
@ -0,0 +1,25 @@
|
|||
<header class="jumbotron subhead" id="overview">
|
||||
<h1><i class="glyph2x-lock"></i>Authentication</h1>
|
||||
<p class="lead">Please authenticate to access Baïkal Web Admin.</p>
|
||||
</header>
|
||||
|
||||
<?= $message ?>
|
||||
|
||||
<form class="form-horizontal" action="<?= $actionurl ?>" method="post" enctype="multipart/formdata">
|
||||
<input type="hidden" name="<?= $submittedflagname ?>" value="1" />
|
||||
<fieldset>
|
||||
<p>
|
||||
<label for="login">Login</label>
|
||||
<input type="text" name="login" value="<?= $login ?>" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" value="<?= $password ?>" />
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">Authenticate</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
|
@ -0,0 +1,21 @@
|
|||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<a class="brand" href="<?= $homelink ?>">Baïkal Web Admin</a>
|
||||
<div class="nav-collapse">
|
||||
<ul class="nav">
|
||||
<li class="<?= $activehome ?>"> <a href="<?= $homelink ?>">Dashboard</a></li>
|
||||
<li class="<?= $activeusers ?>"> <a href="<?= $userslink ?>">Users and resources</a></li>
|
||||
<li class="<?= $activesettingsstandard ?>"> <a href="<?= $settingsstandardlink ?>">Settings</a></li>
|
||||
<li class="<?= $activesettingssystem ?>"> <a href="<?= $settingssystemlink ?>">System settings</a></li>
|
||||
<li> <a href="<?= $logoutlink ?>"><i class="icon-eject icon-white"></i> Logout</a></li>
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,7 @@
|
|||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand">Baïkal Web Admin</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,7 @@
|
|||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand">Baïkal Install Tool</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,5 @@
|
|||
<header class="jumbotron subhead" id="overview">
|
||||
<h1><i class="glyph2x-adjust"></i>Baïkal settings</h1>
|
||||
</header>
|
||||
|
||||
<?= $form ?>
|
|
@ -0,0 +1,6 @@
|
|||
<header class="jumbotron subhead" id="overview">
|
||||
<h1><i class="glyph2x-adjust"></i>Baïkal system settings</h1>
|
||||
</header>
|
||||
|
||||
<?= $message ?>
|
||||
<?= $form ?>
|
|
@ -33,4 +33,8 @@
|
|||
|
||||
<? endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<a id='form'></a>
|
||||
<?= $messages ?>
|
||||
<?= $form ?>
|
|
@ -33,4 +33,8 @@
|
|||
|
||||
<? endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<a id='form'></a>
|
||||
<?= $messages ?>
|
||||
<?= $form ?>
|
|
@ -31,4 +31,8 @@
|
|||
</tr>
|
||||
|
||||
<? endforeach ?>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<a id='form'></a>
|
||||
<?= $messages ?>
|
||||
<?= $form ?>
|
34
CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Logout.php
Executable file
34
CoreVersions/0.2.0/Frameworks/BaikalAdmin/Route/Logout.php
Executable file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\Route;
|
||||
|
||||
class Logout {
|
||||
|
||||
public static function execute(\Flake\Core\Render\Container &$oRenderContainer) {
|
||||
$oRenderContainer->zone("Payload")->addBlock(new \BaikalAdmin\Controller\Logout());
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
namespace BaikalAdmin\View\AddressBooks;
|
||||
namespace BaikalAdmin\View\Install;
|
||||
|
||||
class Listing extends \BaikalAdmin\Core\View {
|
||||
class Initialize extends \BaikalAdmin\Core\View {
|
||||
}
|
|
@ -24,7 +24,8 @@
|
|||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
namespace BaikalAdmin\View\Users;
|
||||
namespace BaikalAdmin\View;
|
||||
|
||||
class Listing extends \BaikalAdmin\Core\View {
|
||||
class Login extends \BaikalAdmin\Core\View {
|
||||
|
||||
}
|
31
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Navigation/Topbar.php
Executable file
31
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Navigation/Topbar.php
Executable file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\View\Navigation;
|
||||
|
||||
class Topbar extends \BaikalAdmin\Core\View {
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\View\Navigation\Topbar;
|
||||
|
||||
class Anonymous extends \BaikalAdmin\Core\View {
|
||||
|
||||
}
|
31
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Navigation/Topbar/Install.php
Executable file
31
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Navigation/Topbar/Install.php
Executable file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\View\Navigation\Topbar;
|
||||
|
||||
class Install extends \BaikalAdmin\Core\View {
|
||||
|
||||
}
|
31
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Settings/Standard.php
Executable file
31
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Settings/Standard.php
Executable file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\View\Settings;
|
||||
|
||||
class Standard extends \BaikalAdmin\Core\View {
|
||||
|
||||
}
|
|
@ -24,7 +24,8 @@
|
|||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
namespace BaikalAdmin\View\Calendars;
|
||||
namespace BaikalAdmin\View\Settings;
|
||||
|
||||
class Listing extends \BaikalAdmin\Core\View {
|
||||
class System extends \BaikalAdmin\Core\View {
|
||||
|
||||
}
|
30
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/User/AddressBooks.php
Executable file
30
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/User/AddressBooks.php
Executable file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\View\User;
|
||||
|
||||
class AddressBooks extends \BaikalAdmin\Core\View {
|
||||
}
|
30
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/User/Calendars.php
Executable file
30
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/User/Calendars.php
Executable file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\View\User;
|
||||
|
||||
class Calendars extends \BaikalAdmin\Core\View {
|
||||
}
|
30
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Users.php
Executable file
30
CoreVersions/0.2.0/Frameworks/BaikalAdmin/View/Users.php
Executable file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2012 Jérôme Schneider <mail@jeromeschneider.fr>
|
||||
* 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 BaikalAdmin\View;
|
||||
|
||||
class Users extends \BaikalAdmin\Core\View {
|
||||
}
|
|
@ -47,7 +47,10 @@ $oPage->setTitle("Baïkal Web Admin");
|
|||
$oPage->setBaseUrl(PROJECT_URI);
|
||||
|
||||
# Authentication
|
||||
if(\BaikalAdmin\Core\Auth::isAuthenticated() === FALSE) {
|
||||
if(
|
||||
\BaikalAdmin\Core\Auth::isAuthenticated() === FALSE &&
|
||||
\BaikalAdmin\Core\Auth::authenticate() === FALSE
|
||||
) {
|
||||
$oPage->zone("navbar")->addBlock(new \BaikalAdmin\Controller\Navigation\Topbar\Anonymous());
|
||||
$oPage->zone("Payload")->addBlock(new \BaikalAdmin\Controller\Login());
|
||||
} else {
|
||||
|
|
|
@ -33,5 +33,6 @@ $GLOBALS["ROUTES"] = array(
|
|||
"users/addressbooks" => "\BaikalAdmin\Route\User\AddressBooks",
|
||||
"install" => "\BaikalAdmin\Route\Install",
|
||||
"settings/standard" => "\BaikalAdmin\Route\Settings\Standard",
|
||||
"settings/system" => "\BaikalAdmin\Route\Settings\System"
|
||||
"settings/system" => "\BaikalAdmin\Route\Settings\System",
|
||||
"logout" => "\BaikalAdmin\Route\Logout"
|
||||
);
|
Binary file not shown.
Loading…
Reference in a new issue