Skip to content

Commit

Permalink
add logout link to showLogin.html template
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterTheOne committed May 10, 2012
1 parent 1fa0e28 commit 1eb2d68
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
5 changes: 4 additions & 1 deletion Classes/Controller/UserController.php
Expand Up @@ -107,6 +107,9 @@ public function showStatusAction() {
* @return string
*/
public function showLoginAction() {
$loggedIn = $this->loginService->isLoggedIn();
$this->view->assign('loggedIn', $loggedIn);

return $this->view->render();
}

Expand Down Expand Up @@ -260,7 +263,7 @@ public function googleReturnAction() {
public function logoutAction() {
$this->loginService->logout();

//todo: view or redirect
$this->redirect('showLogin');
}

}
Expand Down
44 changes: 27 additions & 17 deletions Resources/Private/Templates/User/showLogin.html
@@ -1,17 +1,27 @@
<ul>
<li>
<f:link.action action="facebookLogin" title="login with facebook">
login with facebook
</f:link.action>
</li>
<li>
<f:link.action action="twitterLogin" title="login with twitter">
login with twitter
</f:link.action>
</li>
<li>
<f:link.action action="googleSignIn" title="login with google">
login with google
</f:link.action>
</li>
</ul>
<f:if condition="{loggedIn}">
<f:then>
<p>
You are allready logged in, do you what to
<f:link.action action="logout" title="log out">log out</f:link.action>?
</p>
</f:then>
<f:else>
<ul>
<li>
<f:link.action action="facebookLogin" title="login with facebook">
login with facebook
</f:link.action>
</li>
<li>
<f:link.action action="twitterLogin" title="login with twitter">
login with twitter
</f:link.action>
</li>
<li>
<f:link.action action="googleSignIn" title="login with google">
login with google
</f:link.action>
</li>
</ul>
</f:else>
</f:if>

0 comments on commit 1eb2d68

Please sign in to comment.