fixed my incorrect use of notif settings array

This commit is contained in:
xisi 2014-01-15 14:50:45 -05:00
parent f3a6d65eab
commit 8ed8338b3e

View File

@ -141,16 +141,12 @@ class User extends Base {
$notifs->setSetting($this->setting); $notifs->setSetting($this->setting);
$notifs->setErrorCodes($this->aErrorCodes); $notifs->setErrorCodes($this->aErrorCodes);
$ndata = $notifs->getNotificationSettings($uid); $ndata = $notifs->getNotificationSettings($uid);
if (is_array($ndata)) { if ($ndata['success_login'] == 1) {
foreach ($ndata as $nd) { // seems to be active, let's send it
if ($nd['type'] == 'success_login' && $nd['active'] == 1) { $aDataN['username'] = $username;
// seems to be active, let's send it $aDataN['email'] = $this->getUserEmail($username);
$aDataN['username'] = $username; $aDataN['subject'] = 'Successful login notification';
$aDataN['email'] = $this->getUserEmail($username); $notifs->sendNotification($uid, 'success_login', $aDataN);
$aDataN['subject'] = 'Successful login notification';
$notifs->sendNotification($uid, 'success_login', $aDataN);
}
}
} }
return true; return true;
} }