-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4eb190
commit 5a5b211
Showing
2 changed files
with
32 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,34 @@ | ||
<?php | ||
|
||
<?php /* vim: set colorcolumn= expandtab shiftwidth=2 softtabstop=2 tabstop=4 smarttab: */ | ||
namespace BNETDocs\Templates\User; | ||
|
||
use \CarlBennett\MVC\Libraries\Pair; | ||
|
||
$title = "Logout"; | ||
$description = "Log out of the BNETDocs website"; | ||
$this->opengraph->attach(new Pair("url", "/user/logout")); | ||
|
||
switch ($this->getContext()->error) { | ||
case "NOT_LOGGED_IN": | ||
$message = "You were not logged in to begin with."; | ||
break; | ||
default: | ||
$message = $this->getContext()->error; | ||
$title = 'Logout'; | ||
$description = 'Log out of the BNETDocs website'; | ||
$this->opengraph->attach(new Pair('url', '/user/logout')); | ||
$error = $this->getContext()->error; | ||
switch ($error) | ||
{ | ||
case 'NOT_LOGGED_IN': $message = 'You were not logged in to begin with.'; break; | ||
default: $message = $error; | ||
} | ||
|
||
require("./header.inc.phtml"); | ||
?> | ||
<article> | ||
<?php if (is_null($this->getContext()->error)) { ?> | ||
<header>Account Logout</header> | ||
<form method="POST" action="?"> | ||
<section> | ||
<p>If you are sure you wish to log out, press the button below.</p> | ||
<p><input type="submit" value="Log Out"/></p> | ||
</section> | ||
</form> | ||
<?php } else if ($this->getContext()->error === false) { ?> | ||
<header class="green">Logged Out</header> | ||
<section class="green"> | ||
<p>You have been successfully logged out!</p> | ||
<p>Use the navigation to the left to move to another page.</p> | ||
</section> | ||
<?php } else { ?> | ||
<header class="red">Log out failure</header> | ||
<section class="red"> | ||
<p>An error occurred while attempting to log out.</p> | ||
<p><?php echo $message; ?></p> | ||
<p>Use the navigation to the left to move to another page.</p> | ||
</section> | ||
<?php } ?> | ||
</article> | ||
<?php require("./footer.inc.phtml"); ?> | ||
require('./header.inc.phtml'); ?> | ||
<div class="container"> | ||
<? if (is_null($error)) { ?> | ||
<h1 class="text-danger"><?=$title?></h1> | ||
<p class="text-danger">If you are sure you wish to log out, press the button below.</p> | ||
<form method="POST" action="?"> | ||
<input class="btn btn-danger" type="submit" value="Log Out"/> | ||
</form> | ||
<? } else if ($this->getContext()->error === false) { ?> | ||
<h1 class="text-success">Logged Out</h1> | ||
<div class="alert alert-success"> | ||
<p class="mb-0">You have been successfully logged out!</p> | ||
</div> | ||
<? } else { ?> | ||
<h1 class="text-danger">Log out failure</h1> | ||
<div class="alert alert-danger"> | ||
<p>An error occurred while attempting to log out.</p> | ||
<p class="mb-0"><?=$message?></p> | ||
</secton> | ||
<? } ?> | ||
</div> | ||
<? require('./footer.inc.phtml'); ?> |