Browse code

auch aliases dürfen username.schokokeks.org sein

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@646 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 27/08/2007 19:46:31
Showing 2 changed files
... ...
@@ -162,8 +162,9 @@ function get_alias_details($id)
162 162
   
163 163
   $alias = mysql_fetch_assoc($result);
164 164
   
165
-  if ($alias['domain_id'] == NULL)
165
+  if ($alias['domain_id'] == NULL) {
166 166
     $alias['domain_id'] = -1;
167
+  }
167 168
 
168 169
   /* Das bewirkt, dass nur die eigenen Aliase gesehen werden können */
169 170
   get_vhost_details( (int) $alias['vhost'] );
... ...
@@ -128,9 +128,13 @@ elseif ($_GET['action'] == 'addalias')
128 128
 
129 129
   
130 130
   $hostname = filter_input_hostname($_POST['hostname']);
131
-  $domain = new Domain( (int) $_POST['domain'] );
132
-  if ($domain->useraccount != $_SESSION['userinfo']['uid'])
133
-    system_failure('Ungültige Domain');
131
+  $domainid = (int) $_POST['domain'];
132
+  if ($domainid != -1) {
133
+    $domain = new Domain( (int) $_POST['domain'] );
134
+    if ($domain->useraccount != $_SESSION['userinfo']['uid'])
135
+      system_failure('Ungültige Domain');
136
+    $domainid = $domain->id;
137
+  }
134 138
 
135 139
   if (! is_array($_POST['options']))
136 140
     $_POST['options'] = array();
... ...
@@ -147,7 +151,7 @@ elseif ($_GET['action'] == 'addalias')
147 151
   DEBUG('New options: '.$options);
148 152
 
149 153
   $alias['hostname'] = $hostname;
150
-  $alias['domainid'] = $domain->id;
154
+  $alias['domainid'] = $domainid;
151 155
     
152 156
   $alias ['options'] = $options;
153 157