summaryrefslogtreecommitdiffstats
path: root/modules-available/dnbd3/inc/dnbd3util.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-11 16:10:38 +0100
committerSimon Rettberg2017-12-11 16:10:38 +0100
commit7c5bebc943557d771d0310bb7d82fbfbcc51b62b (patch)
tree5615822623f33440d69f18216656ce1ecc911dd6 /modules-available/dnbd3/inc/dnbd3util.inc.php
parent[dozmod] Increase limits for maxImageValidityDays and maxLectureValidityDays (diff)
downloadslx-admin-7c5bebc943557d771d0310bb7d82fbfbcc51b62b.tar.gz
slx-admin-7c5bebc943557d771d0310bb7d82fbfbcc51b62b.tar.xz
slx-admin-7c5bebc943557d771d0310bb7d82fbfbcc51b62b.zip
[dnbd3] Allow configuring alternative IP address for managed proxy
Diffstat (limited to 'modules-available/dnbd3/inc/dnbd3util.inc.php')
-rw-r--r--modules-available/dnbd3/inc/dnbd3util.inc.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules-available/dnbd3/inc/dnbd3util.inc.php b/modules-available/dnbd3/inc/dnbd3util.inc.php
index 02ca89c2..95b6ffe2 100644
--- a/modules-available/dnbd3/inc/dnbd3util.inc.php
+++ b/modules-available/dnbd3/inc/dnbd3util.inc.php
@@ -11,10 +11,10 @@ class Dnbd3Util {
FROM dnbd3_server s
LEFT JOIN machine m USING (machineuuid)');
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
- if (!is_null($row['clientip'])) {
- $ip = $row['clientip'];
- } elseif (!is_null($row['fixedip'])) {
+ if (!is_null($row['fixedip'])) {
$ip = $row['fixedip'];
+ } elseif (!is_null($row['clientip'])) {
+ $ip = $row['clientip'];
} else {
continue; // Huh?
}
@@ -25,6 +25,9 @@ class Dnbd3Util {
RunMode::setRunMode($row['machineuuid'], 'dnbd3', null, null, null);
continue;
}
+ } elseif ($ip === $satServerIp) {
+ // Manually configured sat server as dnbd3 server - makes no sense
+ continue;
}
$server = array(
'serverid' => $row['serverid'],
@@ -141,7 +144,7 @@ class Dnbd3Util {
$self = Property::getServerIp();
$public[$self] = $self;
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
- $ip = $row['clientip'] ? $row['clientip'] : $row['fixedip'];
+ $ip = $row['fixedip'] ? $row['fixedip'] : $row['clientip'];
if ($ip === '<self>') {
continue;
}