show login form on introduction page only when user is not logged in

This commit is contained in:
coderkun 2014-04-05 13:47:15 +02:00
commit 2204289c4d
2 changed files with 4 additions and 0 deletions

View file

@ -28,6 +28,8 @@
*/ */
public function index() public function index()
{ {
// Pass data to view
$this->set('userId', $this->Auth->getUserId());
} }
} }

View file

@ -1,6 +1,7 @@
<h1><?=_('Introduction')?></h1> <h1><?=_('Introduction')?></h1>
<p>Ein Projekt zum Thema „Gamification im Lehrumfeld“ basierend auf <a href="http://legende-von-zyren.de">Die Legende von Zyren</a>.</p> <p>Ein Projekt zum Thema „Gamification im Lehrumfeld“ basierend auf <a href="http://legende-von-zyren.de">Die Legende von Zyren</a>.</p>
<?php if(is_null($userId)) : ?>
<h2><?=_('Login')?></h2> <h2><?=_('Login')?></h2>
<form method="post" action="<?=$linker->link(array('users','login'))?>"> <form method="post" action="<?=$linker->link(array('users','login'))?>">
<fieldset> <fieldset>
@ -12,6 +13,7 @@
<input type="submit" name="login" value="<?=_('Login')?>" /> <input type="submit" name="login" value="<?=_('Login')?>" />
<?=_('or')?> <a href="<?=$linker->link(array('users','register'))?>"><?=_('register yourself')?></a> <?=_('or')?> <a href="<?=$linker->link(array('users','register'))?>"><?=_('register yourself')?></a>
</form> </form>
<?php endif ?>
<h2>Entwickler</h2> <h2>Entwickler</h2>
<ul> <ul>