Skip to content

Commit

Permalink
Dev: Restore old notification system for ComfortUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Dec 4, 2017
1 parent 1fb93bb commit 588ef92
Showing 1 changed file with 3 additions and 40 deletions.
43 changes: 3 additions & 40 deletions application/core/Survey_Common_Action.php
Expand Up @@ -398,46 +398,9 @@ protected function _updatenotification()
if (!Yii::app()->user->isGuest && Yii::app()->getConfig('updatable')) {
$updateModel = new UpdateForm();
$updateNotification = $updateModel->updateNotification;
$urlUpdate = Yii::app()->createUrl("admin/update");
$currentVersion = Yii::app()->getConfig("buildnumber");
$superadmins = User::model()->getSuperAdmins();

if ($updateNotification->result) {
if ($updateNotification->security_update) {
UniqueNotification::broadcast(
array(
'title' => gT('Security update!')." (".gT("Current version: ")
. $currentVersion.")",
'message' => gT('A security update is available.')." <a href=".$urlUpdate.">"
. gT('Click here to use ComfortUpdate.')."</a>",
'importance' => Notification::HIGH_IMPORTANCE
),
$superadmins
);
} elseif (Yii::app()->session['unstable_update']) {
UniqueNotification::broadcast(
array(
'title' => gT('New UNSTABLE update available')." ("
. gT("Current version: ").$currentVersion.")",
'markAsNew' => false,
'message' => gT('New UNSTABLE update available:')."<a href=".$urlUpdate.">"
. gT('Click here to use ComfortUpdate.')."</a>",
'importance' => Notification::HIGH_IMPORTANCE
),
$superadmins
);
} else {
UniqueNotification::broadcast(
array(
'title' => gT('New update available')." (".gT("Current version: ").$currentVersion.")",
'markAsNew' => false,
'message' => gT('A security update is available.')."<a href=".$urlUpdate.">"
. gT('Click here to use ComfortUpdate.')."</a>",
'importance' => Notification::HIGH_IMPORTANCE
),
$superadmins
);
}

if($updateNotification->result) {
return $this->getController()->renderPartial("/admin/update/_update_notification", array('security_update_available'=>$updateNotification->security_update));
}
}
}
Expand Down

0 comments on commit 588ef92

Please sign in to comment.