diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 90124ff10cfb63d372dc3333562e837225c15baf..366940634a162328c1b05048cf1eb332958e17c5 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -59,7 +59,7 @@ class installer_base {
}
public function simple_query($query, $answers, $default, $name = '') {
- global $autoinstall;
+ global $autoinstall, $autoupdate;
$finished = false;
do {
if($name != '' && $autoinstall[$name] != '') {
@@ -104,7 +104,7 @@ class installer_base {
}
public function free_query($query, $default, $name = '') {
- global $autoinstall;
+ global $autoinstall, $autoupdate;
if($name != '' && $autoinstall[$name] != '') {
if($autoinstall[$name] == 'default') {
$input = $default;
diff --git a/install/tpl/debian_postfix.conf.master b/install/tpl/debian_postfix.conf.master
index 2de0eb6436bbb4e9986f217b8042f5a30997e16e..027e27ef6db944ac08c1d0683469b15ff9e9048e 100644
--- a/install/tpl/debian_postfix.conf.master
+++ b/install/tpl/debian_postfix.conf.master
@@ -14,7 +14,7 @@ broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_restriction_classes = greylisting
greylisting = check_policy_service inet:127.0.0.1:10023
-smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{rbl_list}{greylisting}
+smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_cert_file = {config_dir}/smtpd.cert
diff --git a/install/tpl/fedora_postfix.conf.master b/install/tpl/fedora_postfix.conf.master
index 80721dbf45f94a2dc3e0659db30f679307d597ac..f06af8228807cf896136004256ae21eea75fc9b9 100644
--- a/install/tpl/fedora_postfix.conf.master
+++ b/install/tpl/fedora_postfix.conf.master
@@ -11,7 +11,7 @@ broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_restriction_classes = greylisting
greylisting = check_policy_service inet:127.0.0.1:10023
-smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{rbl_list}{greylisting}
+smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_cert_file = {config_dir}/smtpd.cert
diff --git a/install/tpl/gentoo_postfix.conf.master b/install/tpl/gentoo_postfix.conf.master
index b40a9a71d3aa802823d7f98cea73a4f01b0fa70e..dc20e02c13c44b00b89b030f9a6b99aa4ce9a142 100644
--- a/install/tpl/gentoo_postfix.conf.master
+++ b/install/tpl/gentoo_postfix.conf.master
@@ -10,7 +10,7 @@ broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_restriction_classes = greylisting
greylisting = check_policy_service inet:127.0.0.1:10023
-smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{rbl_list}{greylisting}
+smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_cert_file = {config_dir}/smtpd.cert
diff --git a/install/tpl/opensuse_postfix.conf.master b/install/tpl/opensuse_postfix.conf.master
index 7af484ce8566316e712be43ab5f1c617519009b0..4192f988b5213775cc7b47a99b70f3add21946cc 100644
--- a/install/tpl/opensuse_postfix.conf.master
+++ b/install/tpl/opensuse_postfix.conf.master
@@ -13,7 +13,7 @@ broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_restriction_classes = greylisting
greylisting = check_policy_service inet:127.0.0.1:10023
-smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{rbl_list}{greylisting}
+smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_cert_file = {config_dir}/smtpd.cert
diff --git a/interface/lib/classes/aps_crawler.inc.php b/interface/lib/classes/aps_crawler.inc.php
index 39322b799e25d4e467b42d4aa06daaec1445f33c..cd6dd0637bcb89a5bfbc408ba58a8a82a2c2406d 100644
--- a/interface/lib/classes/aps_crawler.inc.php
+++ b/interface/lib/classes/aps_crawler.inc.php
@@ -261,10 +261,13 @@ class ApsCrawler extends ApsBase
// Get all known apps from the database and the highest known version
// Note: A dirty hack is used for numerical sorting of the VARCHAR field Version: +0 -> cast
// A longer but typesafe way would be: ORDER BY CAST(REPLACE(Version, '.', '') AS UNSIGNED) DESC
- $existing_apps = $app->db->queryAllRecords("SELECT * FROM (
- SELECT name AS Name, CONCAT(version, '-', CAST(`release` AS CHAR)) AS CurrentVersion
- FROM aps_packages ORDER BY REPLACE(version, '.', '')+0 DESC, `release` DESC
- ) as Versions GROUP BY name");
+ $existing_apps = array();
+ $tmpres = $app->db->query("SELECT name as `Name`, CONCAT(version, '-', CAST(`release` AS CHAR)) AS CurrentVersion FROM aps_packages ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(version,'.0.0.0'),'.',4)) DESC, `release` DESC");
+ while($tmp = $tmpres->get()) {
+ if(!array_key_exists($tmp['Name'], $existing_apps)) $existing_apps[$tmp['Name']] = $tmp;
+ }
+ $tmpres->free();
+ unset($tmp);
//var_dump($existing_apps);
// Used for statistics later
@@ -492,6 +495,23 @@ class ApsCrawler extends ApsBase
$app->log($this->log_prefix.'Processed '.$apps_in_repo.
' apps from the repo. Downloaded '.$apps_updated.
' updates, '.$apps_downloaded.' new apps');
+
+ $prevapp = '';
+ $res = $app->db->query("SELECT `id`, `name`, `version`, `release`, `package_status` FROM `aps_packages` WHERE 1 ORDER BY `name` ASC, INET_ATON(SUBSTRING_INDEX(CONCAT(version,'.0.0.0'),'.',4)) DESC, `release` DESC");
+ while($curapp = $res->get()) {
+ if($curapp['name'] != $prevapp) {
+ $prevapp = $curapp['name'];
+ continue;
+ }
+ if($curapp['package_status'] != PACKAGE_OUTDATED) {
+ $app->log($this->log_prefix.'Tagging ' . $curapp['name'] . ' ' . $curapp['version'] . '-' . $curapp['release'] . ' as outdated.');
+ $app->db->query("UPDATE `aps_packages` SET `package_status` = ? WHERE `id` = ?", PACKAGE_OUTDATED, $curapp['id']);
+ $app->db->datalogUpdate('aps_packages', array("package_status" => PACKAGE_OUTDATED), 'id', $curapp['id']);
+ }
+ }
+ $res->free();
+ unset($curapp);
+ unset($prevapp);
}
catch(Exception $e)
diff --git a/interface/lib/classes/aps_guicontroller.inc.php b/interface/lib/classes/aps_guicontroller.inc.php
index ab7f3f4dafeae0904189781d27fa5a61db912b46..16dd9e82f1666d03ac59f163ee8fe813498f5840 100644
--- a/interface/lib/classes/aps_guicontroller.inc.php
+++ b/interface/lib/classes/aps_guicontroller.inc.php
@@ -166,7 +166,7 @@ class ApsGUIController extends ApsBase
FROM aps_packages
WHERE name = (SELECT name FROM aps_packages WHERE id = ?)
AND package_status = 2
- ORDER BY REPLACE(version, '.', '')+0 DESC, `release` DESC", $id);
+ ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(version,'.0.0.0'),'.',4)) DESC, `release` DESC", $id);
if(!empty($result) && ($id != $result['id'])) return $result['id'];
diff --git a/interface/lib/classes/remote.d/monitor.inc.php b/interface/lib/classes/remote.d/monitor.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..d3689b94caaa0e40ea65b3b906950ab114f9688f
--- /dev/null
+++ b/interface/lib/classes/remote.d/monitor.inc.php
@@ -0,0 +1,66 @@
+checkPerm($session_id, 'monitor_jobqueue_count')) {
+ throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $server_id = intval($server_id);
+
+ if($server_id == 0) {
+ $servers = $app->db->queryAllRecords("SELECT server_id, updated FROM server");
+ $sql = 'SELECT count(datalog_id) as jobqueue_count FROM sys_datalog WHERE ';
+ foreach($servers as $sv) {
+ $sql .= " (datalog_id > ".$sv['updated']." AND server_id = ".$sv['server_id'].") OR ";
+ }
+ $sql = substr($sql, 0, -4);
+ $tmp = $app->db->queryOneRecord($sql);
+ return $tmp['jobqueue_count'];
+
+ } else {
+ $server = $app->db->queryOneRecord("SELECT updated FROM server WHERE server_id = ?",$server_id);
+ $tmp = $app->db->queryOneRecord('SELECT count(datalog_id) as jobqueue_count FROM sys_datalog WHERE datalog_id > ?',$server['updated']);
+ return $tmp['jobqueue_count'];
+ }
+ }
+
+}
+
+?>
diff --git a/interface/web/monitor/lib/remote.conf.php b/interface/web/monitor/lib/remote.conf.php
new file mode 100644
index 0000000000000000000000000000000000000000..f149ed600afb1f83f1c8a0a8f507a0d394b26cec
--- /dev/null
+++ b/interface/web/monitor/lib/remote.conf.php
@@ -0,0 +1,5 @@
+
diff --git a/interface/web/sites/backup_stats.php b/interface/web/sites/backup_stats.php
index 1d10ee125aef3bd519e205e0d1f51abe04d4efbb..640b0c17bb925fd5c47c35499739582615826ff6 100644
--- a/interface/web/sites/backup_stats.php
+++ b/interface/web/sites/backup_stats.php
@@ -39,5 +39,5 @@ class list_action extends listform_actions {
}
$list = new list_action;
-$list->SQLExtWhere = "";
+$list->SQLExtWhere = "web_domain.type = 'vhost'";
$list->onLoad();
diff --git a/remoting_client/examples/monitor_jobqueue_count.php b/remoting_client/examples/monitor_jobqueue_count.php
new file mode 100644
index 0000000000000000000000000000000000000000..cdd7837acea0ec832bf86f484d72977ae8791f45
--- /dev/null
+++ b/remoting_client/examples/monitor_jobqueue_count.php
@@ -0,0 +1,45 @@
+ [
+ // set some SSL/TLS specific options
+ 'verify_peer' => false,
+ 'verify_peer_name' => false,
+ 'allow_self_signed' => true
+ ]
+]);
+
+
+$client = new SoapClient(null, array('location' => $soap_location,
+ 'uri' => $soap_uri,
+ 'trace' => 1,
+ 'exceptions' => 1,
+ 'stream_context' => $context));
+
+
+try {
+ if($session_id = $client->login($username, $password)) {
+ echo 'Logged successfull. Session ID:'.$session_id.'
';
+ }
+
+ //* Set the function parameters.
+ $server_id = 1;
+
+ $result = $client->monitor_jobqueue_count($session_id, $server_id);
+
+ print_r($result);
+ echo "
";
+
+ if($client->logout($session_id)) {
+ echo 'Logged out.
';
+ }
+
+
+} catch (SoapFault $e) {
+ echo $client->__getLastResponse();
+ die('SOAP Error: '.$e->getMessage());
+}
+
+?>