Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Commit

Permalink
Login e logout
Browse files Browse the repository at this point in the history
é necessário implementar a consulta no banco para validar o usuário
issue #2
  • Loading branch information
William Espindola committed Oct 25, 2013
1 parent d696728 commit b5e36ad
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$r->isAutoDispatched = false;

$r->any('/login', 'LigaSolidariaStorage\Storage\Controller\Login');
$r->get('/logout', 'LigaSolidariaStorage\Storage\Controller\Logout');

$r->any('/', 'LigaSolidariaStorage\Storage\Controller\HomeController')
->by($authenticated);
Expand Down
14 changes: 14 additions & 0 deletions src/LigaSolidariaStorage/Storage/Controller/Logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace LigaSolidariaStorage\Storage\Controller;

use Respect\Rest\Routable;

class Logout implements Routable
{
public function get()
{
session_destroy();
header('Location: /');
}
}
2 changes: 1 addition & 1 deletion templates/elements/navbar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a href="/contact/">Contato</a>
</li>
<li>
<a href="http://logout@liga-solidaria-storage.localhost">Logout</a>
<a href="/logout">Logout</a>
</li>
</ul>
</div><!--/.nav -->
Expand Down

0 comments on commit b5e36ad

Please sign in to comment.