Skip to content

Commit 83d9fde

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1'
2 parents 6fb3427 + 41e2b4d commit 83d9fde

File tree

11 files changed

+148
-12
lines changed

11 files changed

+148
-12
lines changed

install/lib/installer_base.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function warning($msg) {
5959
}
6060

6161
public function simple_query($query, $answers, $default, $name = '') {
62-
global $autoinstall;
62+
global $autoinstall, $autoupdate;
6363
$finished = false;
6464
do {
6565
if($name != '' && $autoinstall[$name] != '') {
@@ -104,7 +104,7 @@ public function simple_query($query, $answers, $default, $name = '') {
104104
}
105105

106106
public function free_query($query, $default, $name = '') {
107-
global $autoinstall;
107+
global $autoinstall, $autoupdate;
108108
if($name != '' && $autoinstall[$name] != '') {
109109
if($autoinstall[$name] == 'default') {
110110
$input = $default;

install/tpl/debian_postfix.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ broken_sasl_auth_clients = yes
1414
smtpd_sasl_authenticated_header = yes
1515
smtpd_restriction_classes = greylisting
1616
greylisting = check_policy_service inet:127.0.0.1:10023
17-
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{rbl_list}{greylisting}
17+
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
1818
smtpd_use_tls = yes
1919
smtpd_tls_security_level = may
2020
smtpd_tls_cert_file = {config_dir}/smtpd.cert

install/tpl/fedora_postfix.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ broken_sasl_auth_clients = yes
1111
smtpd_sasl_authenticated_header = yes
1212
smtpd_restriction_classes = greylisting
1313
greylisting = check_policy_service inet:127.0.0.1:10023
14-
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{rbl_list}{greylisting}
14+
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
1515
smtpd_use_tls = yes
1616
smtpd_tls_security_level = may
1717
smtpd_tls_cert_file = {config_dir}/smtpd.cert

install/tpl/gentoo_postfix.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ broken_sasl_auth_clients = yes
1010
smtpd_sasl_authenticated_header = yes
1111
smtpd_restriction_classes = greylisting
1212
greylisting = check_policy_service inet:127.0.0.1:10023
13-
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{rbl_list}{greylisting}
13+
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
1414
smtpd_use_tls = yes
1515
smtpd_tls_security_level = may
1616
smtpd_tls_cert_file = {config_dir}/smtpd.cert

install/tpl/opensuse_postfix.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ broken_sasl_auth_clients = yes
1313
smtpd_sasl_authenticated_header = yes
1414
smtpd_restriction_classes = greylisting
1515
greylisting = check_policy_service inet:127.0.0.1:10023
16-
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{rbl_list}{greylisting}
16+
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
1717
smtpd_use_tls = yes
1818
smtpd_tls_security_level = may
1919
smtpd_tls_cert_file = {config_dir}/smtpd.cert

interface/lib/classes/aps_crawler.inc.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,13 @@ public function startCrawler()
261261
// Get all known apps from the database and the highest known version
262262
// Note: A dirty hack is used for numerical sorting of the VARCHAR field Version: +0 -> cast
263263
// A longer but typesafe way would be: ORDER BY CAST(REPLACE(Version, '.', '') AS UNSIGNED) DESC
264-
$existing_apps = $app->db->queryAllRecords("SELECT * FROM (
265-
SELECT name AS Name, CONCAT(version, '-', CAST(`release` AS CHAR)) AS CurrentVersion
266-
FROM aps_packages ORDER BY REPLACE(version, '.', '')+0 DESC, `release` DESC
267-
) as Versions GROUP BY name");
264+
$existing_apps = array();
265+
$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");
266+
while($tmp = $tmpres->get()) {
267+
if(!array_key_exists($tmp['Name'], $existing_apps)) $existing_apps[$tmp['Name']] = $tmp;
268+
}
269+
$tmpres->free();
270+
unset($tmp);
268271
//var_dump($existing_apps);
269272

270273
// Used for statistics later
@@ -492,6 +495,23 @@ public function startCrawler()
492495
$app->log($this->log_prefix.'Processed '.$apps_in_repo.
493496
' apps from the repo. Downloaded '.$apps_updated.
494497
' updates, '.$apps_downloaded.' new apps');
498+
499+
$prevapp = '';
500+
$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");
501+
while($curapp = $res->get()) {
502+
if($curapp['name'] != $prevapp) {
503+
$prevapp = $curapp['name'];
504+
continue;
505+
}
506+
if($curapp['package_status'] != PACKAGE_OUTDATED) {
507+
$app->log($this->log_prefix.'Tagging ' . $curapp['name'] . ' ' . $curapp['version'] . '-' . $curapp['release'] . ' as outdated.');
508+
$app->db->query("UPDATE `aps_packages` SET `package_status` = ? WHERE `id` = ?", PACKAGE_OUTDATED, $curapp['id']);
509+
$app->db->datalogUpdate('aps_packages', array("package_status" => PACKAGE_OUTDATED), 'id', $curapp['id']);
510+
}
511+
}
512+
$res->free();
513+
unset($curapp);
514+
unset($prevapp);
495515
}
496516

497517
catch(Exception $e)

interface/lib/classes/aps_guicontroller.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function getNewestPackageID($id)
166166
FROM aps_packages
167167
WHERE name = (SELECT name FROM aps_packages WHERE id = ?)
168168
AND package_status = 2
169-
ORDER BY REPLACE(version, '.', '')+0 DESC, `release` DESC", $id);
169+
ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(version,'.0.0.0'),'.',4)) DESC, `release` DESC", $id);
170170

171171
if(!empty($result) && ($id != $result['id'])) return $result['id'];
172172

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2017, Till Brehm, ISPConfig UG
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
30+
*/
31+
32+
//* Remote functions of the monitor module
33+
class remoting_monitor extends remoting {
34+
35+
//* get the number of pending jobs from jobqueue
36+
public function monitor_jobqueue_count($session_id, $server_id = 0)
37+
{
38+
global $app;
39+
40+
if(!$this->checkPerm($session_id, 'monitor_jobqueue_count')) {
41+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
42+
return false;
43+
}
44+
45+
$server_id = intval($server_id);
46+
47+
if($server_id == 0) {
48+
$servers = $app->db->queryAllRecords("SELECT server_id, updated FROM server");
49+
$sql = 'SELECT count(datalog_id) as jobqueue_count FROM sys_datalog WHERE ';
50+
foreach($servers as $sv) {
51+
$sql .= " (datalog_id > ".$sv['updated']." AND server_id = ".$sv['server_id'].") OR ";
52+
}
53+
$sql = substr($sql, 0, -4);
54+
$tmp = $app->db->queryOneRecord($sql);
55+
return $tmp['jobqueue_count'];
56+
57+
} else {
58+
$server = $app->db->queryOneRecord("SELECT updated FROM server WHERE server_id = ?",$server_id);
59+
$tmp = $app->db->queryOneRecord('SELECT count(datalog_id) as jobqueue_count FROM sys_datalog WHERE datalog_id > ?',$server['updated']);
60+
return $tmp['jobqueue_count'];
61+
}
62+
}
63+
64+
}
65+
66+
?>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$function_list['monitor_jobqueue_count'] = 'Monitor functions';
4+
5+
?>

interface/web/sites/backup_stats.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ public function prepareDataRow($rec)
3939
}
4040

4141
$list = new list_action;
42-
$list->SQLExtWhere = "";
42+
$list->SQLExtWhere = "web_domain.type = 'vhost'";
4343
$list->onLoad();

0 commit comments

Comments
 (0)