Skip to content

Commit

Permalink
Dev: Restore old notification system for ComfortUpdate
Browse files Browse the repository at this point in the history
Conflicts:
	application/core/Survey_Common_Action.php
  • Loading branch information
olleharstedt committed Dec 4, 2017
1 parent b1a69f9 commit 224a528
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions application/core/Survey_Common_Action.php
Expand Up @@ -389,46 +389,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('A security update is 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
);
}
return $this->getController()->renderPartial("/admin/update/_update_notification", array('security_update_available'=>$updateNotification->security_update));
}
}
}
Expand Down

0 comments on commit 224a528

Please sign in to comment.