Skip to content

Commit

Permalink
Merge branch 'branch-7.5' of github.com:wanderleihuttel/webacula
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderleihuttel committed Dec 5, 2018
2 parents 8166dcd + 083a272 commit 8b58cfd
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 40 deletions.
14 changes: 10 additions & 4 deletions html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

define('WEBACULA_VERSION', '7.5.3' . ' build 07Nov2017');
define('WEBACULA_VERSION', '7.5.4' . ' build 05Dec2018');

define('ROOT_DIR', dirname(dirname(__FILE__)) );
define('CACHE_DIR', ROOT_DIR.'/data/cache' );
Expand Down Expand Up @@ -113,6 +113,12 @@

// setup database bacula
Zend_Registry::set('DB_ADAPTER', strtoupper($config->general->db->adapter) );
if($config->general->db->adapter == "PDO_PGSQL"){
$db_name = "PostgreSQL";
} else {
$db_name = "MySQL/MariaDB";
}

$params = $config->general->db->config->toArray();
// for cross database compatibility with PDO, MySQL, PostgreSQL
$params['options'] = array(Zend_Db::CASE_FOLDING => Zend_Db::CASE_LOWER, Zend_DB::AUTO_QUOTE_IDENTIFIERS => FALSE);
Expand Down Expand Up @@ -214,16 +220,16 @@
} catch (Zend_Db_Adapter_Exception $e) {
echo '<pre>';
// possible database is not running
throw new Zend_Exception("Fatal error: Can't connect to SQL server.");
throw new Zend_Exception("Fatal error: Can't connect to Database " . $db_name. "\n" . $e);
}
/*
* Check Bacula Catalog version
*/
$ver = new Version();
if ( !$ver->checkVersion(BACULA_VERSION) ) {
echo '<pre>';
throw new Zend_Exception("Bacula version mismatch for the Catalog database.".
"Wanted ".BACULA_VERSION.", got ". $ver->getVersion().". ");
throw new Zend_Exception("Bacula version mismatch for the Catalog database. ". "Wanted ".BACULA_VERSION." got ". $ver->getVersion().".\n" .
"Update your webacula tables and modify the 'catalog.version' in application/config.ini.");
}
/*
* Check CACHE_DIR is writable
Expand Down
Binary file modified languages/pt/webacula_pt_BR.mo
Binary file not shown.
8 changes: 4 additions & 4 deletions languages/pt/webacula_pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: webacula\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-07 09:29-0200\n"
"PO-Revision-Date: 2017-11-07 09:35-0200\n"
"POT-Creation-Date: 2018-12-05 14:15-0200\n"
"PO-Revision-Date: 2018-12-05 14:15-0200\n"
"Last-Translator: Wanderlei Hüttel <[email protected]>\n"
"Language-Team: Samuel Rios Carvalho <[email protected]>, "
"Wanderlei Hüttel <[email protected]>\n"
Expand All @@ -15,7 +15,7 @@ msgstr ""
"X-Poedit-KeywordsList: $this->translate->_;$this_view->translate->_;$this-"
">view->translate->_\n"
"X-Poedit-Basepath: Y:/webacula\n"
"X-Generator: Poedit 2.0.4\n"
"X-Generator: Poedit 2.0.8\n"
"X-Poedit-SearchPath-0: application\n"
"X-Poedit-SearchPath-1: html\n"
"X-Poedit-SearchPath-2: library/MyClass\n"
Expand Down Expand Up @@ -1129,7 +1129,7 @@ msgstr "Cliente de restauração"
#: application/forms/FormRestoreOptions.php:153
#: application/views/scripts/decorators/formRestoreoptions.phtml:129
msgid "Restore Job Resource"
msgstr "Restaurar Job Resource"
msgstr "Job de Restauração"

#: application/forms/FormRestoreOptions.php:174
#: application/views/scripts/admin/role-main-form.phtml:68
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(array $options = array())
public function setDirectives($directives)
{
if (!is_array($directives)) Zend_Cache::throwException('Directives parameter must be an array');
while (list($name, $value) = each($directives)) {
foreach ($directives as $name => $value) {
if (!is_string($name)) {
Zend_Cache::throwException("Incorrect option name : $name");
}
Expand Down
14 changes: 8 additions & 6 deletions library/Zend/Config/Yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function __construct($yaml, $section = null, $options = false)
if (!isset($config[$sectionName])) {
require_once 'Zend/Config/Exception.php';
throw new Zend_Config_Exception(sprintf(
'Section "%s" cannot be found',
'Section "%s" cannot be found',
implode(' ', (array)$section)
));
}
Expand All @@ -214,7 +214,7 @@ public function __construct($yaml, $section = null, $options = false)
if (!isset($config[$section])) {
require_once 'Zend/Config/Exception.php';
throw new Zend_Config_Exception(sprintf(
'Section "%s" cannot be found',
'Section "%s" cannot be found',
implode(' ', (array)$section)
));
}
Expand Down Expand Up @@ -289,8 +289,10 @@ protected static function _decodeYaml($currentIndent, &$lines)
{
$config = array();
$inIndent = false;
while (list($n, $line) = each($lines)) {
$lineno = $n + 1;
while (key($lines) !== null) {
$line = current($lines);
$lineno = key($lines) + 1;
next($lines);

$line = rtrim(preg_replace("/#.*$/", "", $line));
if (strlen($line) == 0) {
Expand Down Expand Up @@ -363,10 +365,10 @@ protected static function _parseValue($value)

// remove quotes from string.
if ('"' == $value['0']) {
if ('"' == $value[count($value) -1]) {
if ('"' == $value[strlen($value) -1]) {
$value = substr($value, 1, -1);
}
} elseif ('\'' == $value['0'] && '\'' == $value[count($value) -1]) {
} elseif ('\'' == $value['0'] && '\'' == $value[strlen($value) -1]) {
$value = strtr($value, array("''" => "'", "'" => ''));
}

Expand Down
8 changes: 4 additions & 4 deletions library/Zend/Date/DateObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ protected function date($format, $timestamp = null, $gmt = false)

if (abs($timestamp) <= 0x7FFFFFFF) {
// See ZF-11992
// "o" will sometimes resolve to the previous year (see
// http://php.net/date ; it's part of the ISO 8601
// standard). However, this is not desired, so replacing
// all occurrences of "o" not preceded by a backslash
// "o" will sometimes resolve to the previous year (see
// http://php.net/date ; it's part of the ISO 8601
// standard). However, this is not desired, so replacing
// all occurrences of "o" not preceded by a backslash
// with "Y"
$format = preg_replace('/(?<!\\\\)o/', 'Y', $format);
$result = ($gmt) ? @gmdate($format, $timestamp) : @date($format, $timestamp);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Table/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1304,13 +1304,13 @@ public function find()
$whereList = array();
$numberTerms = 0;
foreach ($args as $keyPosition => $keyValues) {
$keyValuesCount = count($keyValues);
// Coerce the values to an array.
// Don't simply typecast to array, because the values
// might be Zend_Db_Expr objects.
if (!is_array($keyValues)) {
$keyValues = array($keyValues);
}
$keyValuesCount = count($keyValues);
if ($numberTerms == 0) {
$numberTerms = $keyValuesCount;
} else if ($keyValuesCount != $numberTerms) {
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Reader/Entry/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function getAuthors()
);
}

if (count($authors) == 0) {
if ($authors !== null && count($authors) == 0) {
$authors = null;
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Reader/Feed/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function getAuthors()
);
}

if (count($authors) == 0) {
if ($authors !== null && count($authors) == 0) {
$authors = null;
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function getAllCapabilities(TeraWurfl $wurflObj)
if (!is_array($group)) {
continue;
}
while (list ($key, $value) = each($group)) {
foreach ($group as $key => $value) {
if (is_bool($value)) {
// to have the same type than the official WURFL API
$features[$key] = ($value ? 'true' : 'false');
Expand Down
22 changes: 14 additions & 8 deletions library/Zend/Mail/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface, Countable
{
/**
* headers of part as array
Expand Down Expand Up @@ -96,10 +96,10 @@ class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
* @var int
*/
protected $_messageNum = 0;

/**
* Class to use when creating message parts
* @var string
* @var string
*/
protected $_partClass;

Expand Down Expand Up @@ -138,7 +138,7 @@ public function __construct(array $params)
$this->_mail = $params['handler'];
$this->_messageNum = $params['id'];
}

if (isset($params['partclass'])) {
$this->setPartClass($params['partclass']);
}
Expand All @@ -162,7 +162,7 @@ public function __construct(array $params)
}
}
}

/**
* Set name pf class used to encapsulate message parts
* @param string $class
Expand All @@ -184,14 +184,14 @@ public function setPartClass($class)
require_once 'Zend/Mail/Exception.php';
throw new Zend_Mail_Exception("Class '{$class}' must implement Zend_Mail_Part_Interface");
}

$this->_partClass = $class;
return $this;
}

/**
* Retrieve the class name used to encapsulate message parts
* @return string
* @return string
*/
public function getPartClass()
{
Expand All @@ -201,6 +201,12 @@ public function getPartClass()
return $this->_partClass;
}

public function count()
{
return $this->countParts();
}


/**
* Check if part is a multipart message
*
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Oauth/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct(
if ($response !== null) {
$this->_response = $response;
$params = $this->_parseParameters($response);
if (count($params) > 0) {
if ($params !== null && count($params) > 0) {
$this->setParams($params);
}
}
Expand Down
4 changes: 3 additions & 1 deletion library/Zend/Rest/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ public function match($request, $partial = false)
* @param array $data An array of variable and value pairs used as parameters
* @param bool $reset Weither to reset the current params
* @param bool $encode Weither to return urlencoded string
* @param bool $partial
*
* @return string Route path with user submitted parameters
*/
public function assemble($data = array(), $reset = false, $encode = true)
public function assemble($data = array(), $reset = false, $encode = true, $partial = false)
{
if (!$this->_keysSet) {
if (null === $this->_request) {
Expand Down
6 changes: 5 additions & 1 deletion library/Zend/Test/DbStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ public function setRowCount($rowCount)
*/
public function append($row)
{
$this->_columnCount = count($row);
if (!is_array($row)) {
$this->_columnCount = 1;
} else {
$this->_columnCount = count($row);
}
$this->_fetchStack[] = $row;
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Tool/Project/Profile/Resource/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public function valid()
*/
public function hasChildren()
{
return (count($this->_subResources > 0)) ? true : false;
return (count($this->_subResources) > 0) ? true : false;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Validate/EmailAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ private function _validateMXRecords()

//decode IDN domain name if possible
if (function_exists('idn_to_ascii')) {
$hostname = idn_to_ascii($this->_hostname);
$hostname = idn_to_ascii($this->_hostname, 0, INTL_IDNA_VARIANT_UTS46);
}

$result = getmxrr($hostname, $mxHosts);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Validate/File/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function getFiles($file = null)
*/
public function setFiles($files = array())
{
if (count($files) === 0) {
if ($files === null || count($files) === 0) {
$this->_files = $_FILES;
} else {
$this->_files = $files;
Expand Down
10 changes: 7 additions & 3 deletions library/Zend/XmlRpc/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,17 @@ protected static function _createSimpleXMLElement(&$xml)
*/
protected static function _extractTypeAndValue(SimpleXMLElement $xml, &$type, &$value)
{
list($type, $value) = each($xml);
$type = key($xml);
$value = current($xml);
next($xml);

if (!$type and $value === null) {
if ($type === null && $value === false) {
$namespaces = array('ex' => 'http://ws.apache.org/xmlrpc/namespaces/extensions');
foreach ($namespaces as $namespaceName => $namespaceUri) {
$namespaceXml = $xml->children($namespaceUri);
list($type, $value) = each($namespaceXml);
$type = key($namespaceXml);
$value = current($namespaceXml);
next($namespaceXml);
if ($type !== null) {
$type = $namespaceName . ':' . $type;
break;
Expand Down

0 comments on commit 8b58cfd

Please sign in to comment.