Renvoi de la bonne config
This commit is contained in:
parent
0222bac963
commit
529b80375f
|
@ -1,6 +1,7 @@
|
||||||
config/config.php
|
config/config.php
|
||||||
config/conf.php
|
|
||||||
.idea
|
.idea
|
||||||
/public/uploads
|
/public/uploads
|
||||||
/tmp
|
/tmp
|
||||||
|
vendor
|
||||||
|
composer.json
|
||||||
composer.lock
|
composer.lock
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
$host = 'localhost';
|
$host = 'localhost';
|
||||||
//$username = 'guser';
|
$username = 'guser';
|
||||||
$username = 'root';
|
$password = 'kptgT81U7nzYWHBdQ9';
|
||||||
//$password = 'kptgT81U7nzYWHBdQ9';
|
|
||||||
$password = 'root';
|
|
||||||
$database_name = 'gmarche';
|
$database_name = 'gmarche';
|
||||||
|
|
|
@ -22,7 +22,8 @@ use Middlewares\Whoops;
|
||||||
chdir(dirname(__DIR__));
|
chdir(dirname(__DIR__));
|
||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
$chemin = $_SERVER['DOCUMENT_ROOT'];
|
$chemin = $_SERVER['DOCUMENT_ROOT'];
|
||||||
$chemin_new = substr($chemin,0,-7);
|
$chemin_new = substr($chemin,0,-6);
|
||||||
|
|
||||||
$app = (new \Framework\App( $chemin_new .'/config/config.php'))
|
$app = (new \Framework\App( $chemin_new .'/config/config.php'))
|
||||||
//$app = (new \Framework\App( '../config/config.php'))
|
//$app = (new \Framework\App( '../config/config.php'))
|
||||||
->addModule(AdminModule::class)
|
->addModule(AdminModule::class)
|
||||||
|
|
|
@ -5,8 +5,13 @@ use App\Auth\DatabaseAuth;
|
||||||
use Framework\Renderer\RendererInterface;
|
use Framework\Renderer\RendererInterface;
|
||||||
use Framework\Response\RedirectResponse;
|
use Framework\Response\RedirectResponse;
|
||||||
use Framework\Session\FlashService;
|
use Framework\Session\FlashService;
|
||||||
|
use Psr\Container\ContainerInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class LogoutAction
|
||||||
|
* @package App\Auth\Action
|
||||||
|
*/
|
||||||
class LogoutAction
|
class LogoutAction
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -23,17 +28,22 @@ class LogoutAction
|
||||||
*/
|
*/
|
||||||
private $flashService;
|
private $flashService;
|
||||||
|
|
||||||
public function __construct(RendererInterface $renderer, DatabaseAuth $auth, FlashService $flashService)
|
private $container;
|
||||||
|
|
||||||
|
public function __construct(RendererInterface $renderer, DatabaseAuth $auth, FlashService $flashService
|
||||||
|
, ContainerInterface $container)
|
||||||
{
|
{
|
||||||
$this->renderer = $renderer;
|
$this->renderer = $renderer;
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->flashService = $flashService;
|
$this->flashService = $flashService;
|
||||||
|
$this->container = $container;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __invoke(ServerRequestInterface $request)
|
public function __invoke(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
$gmarchePrefix = $this->container->get('gmarche.prefix');
|
||||||
$this->auth->logout();
|
$this->auth->logout();
|
||||||
$this->flashService->success('Vous êtes maintenant déconnecté');
|
$this->flashService->success('Vous êtes maintenant déconnecté');
|
||||||
return new RedirectResponse('/gmarche');
|
return new RedirectResponse("$gmarchePrefix");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue