diff --git a/public_html/index.php b/public_html/index.php
index e40804a..1076bc3 100755
--- a/public_html/index.php
+++ b/public_html/index.php
@@ -81,6 +81,11 @@
if( $auth == 2 ){
+ // logout from admin
+ $R->get('logout/?', function(){
+ (new ModuleRequest('authentificationDefault/admin', ['username' => '0', 'password' => '']))->dispatch();
+ header('Location: /');
+ });
// nomPage/arg1/arg2 -> inclusion de la page
$R->get('(.*)', function($m){
@@ -98,6 +103,14 @@
/* (3) Si on est pas authentifié */
}else if( $auth == 1 ){
+ // warehouse logout
+ $R->get('logout/?', function(){
+ (new ModuleRequest('authentificationDefault/warehouse', ['name' => '000', 'password' => '']))->dispatch();
+ header('Location: /');
+ });
+
+
+ // admin login page
$R->get('(.*)', function($m){
if( !preg_match('#^admin/$#', $m[0]) ) header(__REDIRECT__);
else include __PUBLIC__.'/view/admin.php';
@@ -116,7 +129,7 @@
/* (4) api/module/method -> Api */
- $R->post('api(?:/(.*))/??', function($url){
+ $R->post('api(?:/(.*))/?', function($url){
$request = ModuleRequest::fromPost($url, $_POST);
$answer = $request->dispatch();
@@ -128,7 +141,7 @@
});
- /* (5) N'importe -> page d'accueil */
+ /* (6) N'importe -> page d'accueil */
$R->get('.+', function(){ header(__REDIRECT__); });
$R->post('.+', function(){ header(__REDIRECT__); });