Skip to content
Browse files

Merge pull request #113 from kenjis/fix_welcome_message

fix admin template files to show welcome message at login
  • Loading branch information...
2 parents 60368f5 + f0b3025 commit bb7f6995ba3cefbe6d320da04306d3788ce37082 @philsturgeon philsturgeon committed
Showing with 6 additions and 4 deletions.
  1. +2 −1 views/admin/crud/controllers/admin.php
  2. +2 −1 views/admin/orm/controllers/admin.php
  3. +2 −2 views/admin/template.php
View
3 views/admin/crud/controllers/admin.php
@@ -38,7 +38,8 @@ public function action_login()
if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
{
// credentials ok, go right in
- Session::set_flash('notice', 'Welcome, '.$current_user->username);
+ $current_user = Model_User::find_by_username(Auth::get_screen_name());
+ Session::set_flash('success', 'Welcome, '.$current_user->username);
Response::redirect('admin');
}
else
View
3 views/admin/orm/controllers/admin.php
@@ -36,7 +36,8 @@ public function action_login()
if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
{
// credentials ok, go right in
- Session::set_flash('notice', 'Welcome, '.$current_user->username);
+ $current_user = Model_User::find_by_username(Auth::get_screen_name());
+ Session::set_flash('success', 'Welcome, '.$current_user->username);
Response::redirect('admin');
}
else
View
4 views/admin/template.php
@@ -61,14 +61,14 @@
<?php if (Session::get_flash('success')): ?>
<div class="alert-message success">
<p>
- <?php echo implode('</p><p>', (array) Session::get_flash('success')); ?>
+ <?php echo implode('</p><p>', e((array) Session::get_flash('success'))); ?>
</p>
</div>
<?php endif; ?>
<?php if (Session::get_flash('error')): ?>
<div class="alert-message error">
<p>
- <?php echo implode('</p><p>', (array) Session::get_flash('error')); ?>
+ <?php echo implode('</p><p>', e((array) Session::get_flash('error'))); ?>
</p>
</div>
<?php endif; ?>

0 comments on commit bb7f699

Please sign in to comment.
Something went wrong with that request. Please try again.