Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Merge branch 'bareos-16.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Oct 7, 2016
2 parents 4a8039f + cbcc032 commit 52dcde0
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 15 deletions.
14 changes: 10 additions & 4 deletions module/Application/src/Application/View/Helper/UpdateAlert.php
Expand Up @@ -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 = '<a data-toggle="tooltip" data-placement="bottom" href="http://download.bareos.com/" target="_blank"title="Updates available"><span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span></a>';
return $this->result;
if($a) {
if($b) {
$this->result = '<a data-toggle="tooltip" data-placement="bottom" href="http://download.bareos.com/" target="_blank"title="Updates available"><span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span></a>';
return $this->result;
}
}
else {
$this->result = '<a data-toggle="tooltip" data-placement="bottom" href="http://download.bareos.com/" target="_blank"title="Update informaton could not be retrieved"><span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span></a>';
return $this->result;
}
}
}
2 changes: 1 addition & 1 deletion module/Application/view/layout/layout.phtml
Expand Up @@ -81,7 +81,7 @@ echo $this->doctype();
<?php echo $this->navigation('navigation')->menu()->setMinDepth(0)->setMaxDepth(0)->setUlClass('nav navbar-nav'); ?>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<?php echo $this->UpdateAlert($_SESSION['bareos']['dird-update-available']); ?>
<?php echo $this->UpdateAlert($_SESSION['bareos']['product-updates-status'],$_SESSION['bareos']['dird-update-available']); ?>
</li>
<li class="dropdown">
<a href="#"><span class="glyphicon glyphicon-th"></span>&nbsp;<?php echo $_SESSION['bareos']['director']; ?></a>
Expand Down
7 changes: 6 additions & 1 deletion module/Auth/src/Auth/Controller/AuthController.php
Expand Up @@ -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 {
Expand Down Expand Up @@ -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');
Expand Down
Expand Up @@ -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);
Expand Down
28 changes: 20 additions & 8 deletions 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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit 52dcde0

Please sign in to comment.