Skip to content

Commit

Permalink
Delete old http sessions before to send mail
Browse files Browse the repository at this point in the history
A solution for issu humhub#1412
  • Loading branch information
happyfredo committed Jan 13, 2016
1 parent 96666bf commit 46c0c72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion protected/humhub/modules/notification/Module.php
Expand Up @@ -3,6 +3,7 @@
namespace humhub\modules\notification;

use humhub\modules\user\models\User;
use humhub\modules\user\models\Session;
use humhub\modules\notification\models\Notification;
use humhub\modules\notification\components\BaseNotification;
use humhub\models\Setting;
Expand All @@ -21,7 +22,10 @@ public function getMailUpdate(User $user, $interval)
{
$output = "";


foreach (Session::find()->where(['<', 'expire', time()])->all() as $session) {
$session->delete();
}

$receive_email_notifications = $user->getSetting("receive_email_notifications", 'core', Setting::Get('receive_email_notifications', 'mailing'));

// Never receive notifications
Expand Down

0 comments on commit 46c0c72

Please sign in to comment.