Skip to content

Commit

Permalink
Dev: Use notification for password nag
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Aug 23, 2016
1 parent b216e7a commit 17fb1bc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 8 additions & 2 deletions application/core/LSUserIdentity.php
Expand Up @@ -127,8 +127,14 @@ protected function postLogin()

// Check for default password
if ($this->password === 'password') {
App()->user->setFlash('warning', gT('Warning: You are still using the default password (\'password\'). Please change your password and re-login again.'));
//App()->user->setFlash('pwdnotify', gT('Warning: You are still using the default password (\'password\'). Please change your password and re-login again.'));
$not = new UniqueNotification(array(
'user_id' => App()->user->id,
'importance' => Notification::HIGH_IMPORTANCE,
'title' => 'Password warning',
'message' => '<span class="fa fa-exclamation-circle text-warning"></span>&nbsp;' .
gT("Warning: You are still using the default password ('password'). Please change your password and re-login again.")
));
$not->save();
}

// Do session setup
Expand Down
9 changes: 8 additions & 1 deletion application/core/Survey_Common_Action.php
Expand Up @@ -458,7 +458,14 @@ public function _showadminmenu($aData)
// Default password notification
if (Yii::app()->session['pw_notify'] && Yii::app()->getConfig("debug") < 2)
{
Yii::app()->session['flashmessage'] = gT("Warning: You are still using the default password ('password'). Please change your password and re-login again.");
$not = new UniqueNotification(array(
'user_id' => App()->user->id,
'importance' => Notification::HIGH_IMPORTANCE,
'title' => 'Password warning',
'message' => '<span class="fa fa-exclamation-circle text-warning"></span>&nbsp;' .
gT("Warning: You are still using the default password ('password'). Please change your password and re-login again.")
));
$not->save();
}

// Count active survey
Expand Down

0 comments on commit 17fb1bc

Please sign in to comment.