diff --git a/module/Application/src/Application/View/Helper/UpdateAlert.php b/module/Application/src/Application/View/Helper/UpdateAlert.php
index 6bc85926..27fd1ce1 100644
--- a/module/Application/src/Application/View/Helper/UpdateAlert.php
+++ b/module/Application/src/Application/View/Helper/UpdateAlert.php
@@ -32,11 +32,17 @@ class UpdateAlert extends AbstractHelper
protected $value;
protected $result;
- public function __invoke($value)
+ public function __invoke($a=null,$b=null)
{
- if($value) {
- $this->result = '';
- return $this->result;
+ if($a) {
+ if($b) {
+ $this->result = '';
+ return $this->result;
+ }
+ }
+ else {
+ $this->result = '';
+ return $this->result;
}
}
}
diff --git a/module/Application/view/layout/layout.phtml b/module/Application/view/layout/layout.phtml
index 2efb0947..765b2bcc 100644
--- a/module/Application/view/layout/layout.phtml
+++ b/module/Application/view/layout/layout.phtml
@@ -81,7 +81,7 @@ echo $this->doctype();
navigation('navigation')->menu()->setMinDepth(0)->setMaxDepth(0)->setUlClass('nav navbar-nav'); ?>
-
- UpdateAlert($_SESSION['bareos']['dird-update-available']); ?>
+ UpdateAlert($_SESSION['bareos']['product-updates-status'],$_SESSION['bareos']['dird-update-available']); ?>
-
diff --git a/module/Auth/src/Auth/Controller/AuthController.php b/module/Auth/src/Auth/Controller/AuthController.php
index fcfb8c1f..1a1f1e6d 100644
--- a/module/Auth/src/Auth/Controller/AuthController.php
+++ b/module/Auth/src/Auth/Controller/AuthController.php
@@ -86,7 +86,8 @@ public function loginAction()
$_SESSION['bareos']['product-updates'] = $bareos_updates;
$_SESSION['bareos']['dird-update-available'] = false;
- if(isset($bareos_updates) && $bareos_updates != NULL) {
+ if(isset($bareos_updates) && $bareos_updates != false) {
+ $_SESSION['bareos']['product-updates-status'] = true;
$updates = json_decode($bareos_updates, true);
try {
@@ -126,6 +127,10 @@ public function loginAction()
}
}
}
+ else {
+ // updates could not be retrieved by ajax call
+ $_SESSION['bareos']['product-updates-status'] = false;
+ }
// Get the config.
$configuration = $this->getServiceLocator()->get('configuration');
diff --git a/module/Storage/src/Storage/Controller/StorageController.php b/module/Storage/src/Storage/Controller/StorageController.php
index 812cf104..8e7967ce 100644
--- a/module/Storage/src/Storage/Controller/StorageController.php
+++ b/module/Storage/src/Storage/Controller/StorageController.php
@@ -152,7 +152,7 @@ public function detailsAction()
}
elseif($action == "release") {
$storage = $this->params()->fromQuery('storage');
- $drive = $this->params()->fromQuery('drive');
+ $drive = $this->params()->fromQuery('srcslots');
try {
$result = $this->getStorageModel()->releaseSlot($this->bsock, $storage, $drive);
diff --git a/packaging/obs/bareos-webui.spec b/packaging/obs/bareos-webui.spec
index b9372a07..fa7f4f85 100644
--- a/packaging/obs/bareos-webui.spec
+++ b/packaging/obs/bareos-webui.spec
@@ -1,7 +1,7 @@
Name: bareos-webui
#Provides:
-Version: 15.2.1
+Version: 16.2.0
Release: 0%{?dist}
Summary: Bareos Web User Interface
@@ -15,7 +15,11 @@ BuildArch: noarch
BuildRequires: autoconf automake bareos-common
-Requires: php >= 5.3.3
+# ZendFramework 2.4 says it required php >= 5.3.23.
+# However, it works on SLES 11 with php 5.3.17
+# while it does not work with php 5.3.3 (RHEL6).
+Requires: php >= 5.3.17
+
Requires: php-bz2
Requires: php-ctype
Requires: php-curl
@@ -60,8 +64,6 @@ BuildRequires: mod_php_any
%define daemon_group www
Requires: apache
Requires: mod_php_any
-#Recommends: php-pgsql php-mysql php-sqlite
-#Suggests: postgresql-server mysql sqlite3
%else
#if 0#{?fedora} || 0#{?rhel_version} || 0#{?centos_version}
BuildRequires: httpd
@@ -116,6 +118,7 @@ echo %version | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' > %{buildroo
# if the old config file don't exists but we have created a backup before,
# restore the old config file.
# Remove our backup, if it exists.
+# This update helper should be removed wih bareos-17.x.
%define post_backup_file() \
if [ -f %1 ]; then \
@@ -134,14 +137,23 @@ fi; \
%post
%post_backup_file /etc/bareos/bareos-dir.d/webui-consoles.conf
-%posttrans_restore_file /etc/bareos/bareos-dir.d/webui-consoles.conf
%post_backup_file /etc/bareos/bareos-dir.d/webui-profiles.conf
-%posttrans_restore_file /etc/bareos/bareos-dir.d/webui-profiles.conf
a2enmod setenv &> /dev/null || true
a2enmod rewrite &> /dev/null || true
-%if 0%{?suse_version} >= 1215
-a2enmod php7 &> /dev/null || true
+%posttrans
+%posttrans_restore_file /etc/bareos/bareos-dir.d/webui-consoles.conf
+%posttrans_restore_file /etc/bareos/bareos-dir.d/webui-profiles.conf
+
+%if 0%{?suse_version} >= 1315
+# 1315:
+# SLES12 (PHP 7)
+# openSUSE Leap 42.1 (PHP 5)
+if php -v | grep -q "PHP 7"; then
+ a2enmod php7 &> /dev/null || true
+else
+ a2enmod php5 &> /dev/null || true
+fi
%else
a2enmod php5 &> /dev/null || true
%endif