Update config and header for new auth class

This commit is contained in:
Timothy Warren 2015-11-09 11:50:24 -05:00
parent a18f1926d9
commit 87f5324761
2 changed files with 19 additions and 7 deletions

View File

@ -11,21 +11,33 @@ return [
'update' => [
'path' => '/{controller}/update',
'action' => 'update',
'verb' => 'post'
'verb' => 'post',
'tokens' => [
'controller' => '[a-z_]+'
]
],
'login_form' => [
'path' => '/{controller}/login',
'action' => 'login',
'verb' => 'get'
'verb' => 'get',
'tokens' => [
'controller' => '[a-z_]+'
]
],
'login_action' => [
'path' => '/{controller}/login',
'action' => 'login_action',
'verb' => 'post'
'verb' => 'post',
'tokens' => [
'controller' => '[a-z_]+'
]
],
'logout' => [
'path' => '/{controller}/logout',
'action' => 'logout'
'action' => 'logout',
'tokens' => [
'controller' => '[a-z_]+'
]
],
],
// Routes on collection controller

View File

@ -17,11 +17,11 @@
</a> [<a href="<?= $urlGenerator->default_url($other_type) ?>"><?= ucfirst($other_type) ?> List</a>]
</span>
<span class="flex-no-wrap small-font">
<?php /*if (is_logged_in()): ?>
<?php if ($auth->is_authenticated()): ?>
[<a href="<?= $urlGenerator->url("/{$url_type}/logout", $url_type) ?>">Logout</a>]
<?php else: ?>
[<a href="<?= $urlGenerator->url("/{$url_type}/login", $url_type) ?>"><?= $config->whose_list ?>'s Login</a>]
<?php endif */ ?>
[<a href="<?= $urlGenerator->url("/{$url_type}/login", $url_type) ?>"><?= $config->get('whose_list') ?>'s Login</a>]
<?php endif ?>
</span>
</h1>
<nav>