Add success message for login
This commit is contained in:
parent
0dace7a404
commit
088c2f99cc
2 changed files with 16 additions and 2 deletions
|
@ -37,6 +37,11 @@ class Page
|
|||
$containerClasses[] = 'info icon';
|
||||
$iconClasses[] = 'info circle';
|
||||
break;
|
||||
|
||||
case 'success':
|
||||
$containerClasses[] = 'success icon';
|
||||
$iconClasses[] = 'check circle';
|
||||
break;
|
||||
}
|
||||
|
||||
$containerClass = implode(' ', $containerClasses);
|
||||
|
@ -77,6 +82,11 @@ class Page
|
|||
return self::message($content, $header, 'info');
|
||||
}
|
||||
|
||||
public static function success(string $content, string $header = ''): string
|
||||
{
|
||||
return self::message($content, $header, 'success');
|
||||
}
|
||||
|
||||
/**
|
||||
* Non-Static
|
||||
*/
|
||||
|
|
|
@ -32,8 +32,12 @@ $page->navigation();
|
|||
<h1 class="ui header"><?= $page->title ?></h1>
|
||||
|
||||
<?php
|
||||
if (isset($success) && !$success) {
|
||||
echo Page::error('User not found!', 'Error');
|
||||
if (isset($success)) {
|
||||
if ($success) {
|
||||
echo Page::success('Successfully logged in as ' . $_SESSION['user']['email'] . '.', 'Success');
|
||||
} else {
|
||||
echo Page::error('User not found!', 'Error');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
Loading…
Reference in a new issue