Browse code

√úbergebe keine Kundennummer beim Auflisten der Userdomains im vhost-Modul

Bernd Wurst authored on07/08/2019 06:59:51
Showing2 changed files
... ...
@@ -148,14 +148,18 @@ class Domain
148 148
 
149 149
 
150 150
 
151
-function get_domain_list($customerno, $uid = null)
151
+function get_domain_list($customerno = null, $uid = null)
152 152
 {
153
-    $customerno = (int) $customerno;
153
+    if ($customerno == null && $uid === null) {
154
+        DEBUG('get_domain_list() wurde aufgerufen mit leerem Kunde und leerem User!');
155
+        system_failure('Interner Fehler');
156
+    }
154 157
     $query = "SELECT id FROM kundendaten.domains WHERE";
155 158
     if ($uid !== null) {
156 159
         $uid = (int) $uid;
157 160
         $query .= " useraccount={$uid}";
158 161
     } else {
162
+        $customerno = (int) $customerno;
159 163
         $query .= " kunde={$customerno}";
160 164
     }
161 165
     $query .= " ORDER BY domainname,tld";
... ...
@@ -189,10 +189,11 @@ function domainselect($selected = null, $selectattribute = '')
189 189
 {
190 190
     global $domainlist, $config;
191 191
     if ($domainlist == null) {
192
-        $domainlist = get_domain_list(
193
-            $_SESSION['customerinfo']['customerno'],
194
-            $_SESSION['userinfo']['uid']
195
-    );
192
+        $uid = null;
193
+        if (isset($_SESSION['userinfo']['uid'])) {
194
+            $uid = $_SESSION['userinfo']['uid'];
195
+        }
196
+        $domainlist = get_domain_list(null, $uid);
196 197
     }
197 198
     $selected = (int) $selected;
198 199