Commit e0fa8dff authored by Guinness's avatar Guinness
Browse files

Add a logoout button for the admin.

Fixes #99
parent 35e0b626
...@@ -100,6 +100,12 @@ class Admin extends Controller ...@@ -100,6 +100,12 @@ class Admin extends Controller
$f3->clear('SESSION.error'); $f3->clear('SESSION.error');
} }
public function logout($f3, $args)
{
$f3->clear('SESSION');
$f3->reroute('/');
}
public static function hash_password($password) public static function hash_password($password)
{ {
......
...@@ -24,6 +24,7 @@ GET /cron/piplome/@id=Controller\Cron->piplome ...@@ -24,6 +24,7 @@ GET /cron/piplome/@id=Controller\Cron->piplome
; Pages d'administration ; Pages d'administration
GET|POST @admin:/admin=Controller\Admin->show GET|POST @admin:/admin=Controller\Admin->show
GET|POST @admin_logout:/admin/logout=Controller\Admin->logout
GET @add_support:/admin/support/add=Controller\Admin->support GET @add_support:/admin/support/add=Controller\Admin->support
GET @edit_support:/admin/support/edit/@id=Controller\Admin->support GET @edit_support:/admin/support/edit/@id=Controller\Admin->support
POST @modify_support:/admin/support/edit=Controller\Admin->support POST @modify_support:/admin/support/edit=Controller\Admin->support
......
...@@ -9,5 +9,6 @@ ...@@ -9,5 +9,6 @@
<li><a href="{{ 'users' | alias }}">Gestion des utilisateurs</a></li> <li><a href="{{ 'users' | alias }}">Gestion des utilisateurs</a></li>
<li><a href="{{ 'stats' | alias }}">Statistiques</a></li> <li><a href="{{ 'stats' | alias }}">Statistiques</a></li>
<li><a href="{{ 'admin_accounts' | alias }}">Administrateurs</a></li> <li><a href="{{ 'admin_accounts' | alias }}">Administrateurs</a></li>
<li><a href="{{ 'admin_logout' | alias }}">Déconnexion</a></li>
</ul> </ul>
</section> </section>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment