Update config and header for new auth class

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

View File

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

View File

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