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';
|
$containerClasses[] = 'info icon';
|
||||||
$iconClasses[] = 'info circle';
|
$iconClasses[] = 'info circle';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'success':
|
||||||
|
$containerClasses[] = 'success icon';
|
||||||
|
$iconClasses[] = 'check circle';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$containerClass = implode(' ', $containerClasses);
|
$containerClass = implode(' ', $containerClasses);
|
||||||
|
@ -77,6 +82,11 @@ class Page
|
||||||
return self::message($content, $header, 'info');
|
return self::message($content, $header, 'info');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function success(string $content, string $header = ''): string
|
||||||
|
{
|
||||||
|
return self::message($content, $header, 'success');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Non-Static
|
* Non-Static
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,8 +32,12 @@ $page->navigation();
|
||||||
<h1 class="ui header"><?= $page->title ?></h1>
|
<h1 class="ui header"><?= $page->title ?></h1>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (isset($success) && !$success) {
|
if (isset($success)) {
|
||||||
echo Page::error('User not found!', 'Error');
|
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