Browse code

Erlaube nicht mehr das Ändern der E-Mail-Adresse wenn ein Postfach aktiv ist.

Bernd Wurst authored on24/07/2012 16:39:18
Showing2 changed files
... ...
@@ -147,9 +147,20 @@ $form = '';
147 147
 if ($accountlogin) {
148 148
   $form.= "<p class=\"spamfilter_options\">Unerwünschte E-Mails (Spam, Viren) in diesem Postfach ".html_select('spamfilter_action', array("none" => 'nicht filtern', "folder" => 'in Unterordner »Spam« ablegen', "tag" => 'markieren und zustellen', "delete" => 'nicht zustellen (löschen)'), $account['spamfilter'])."</p>";
149 149
 } else {
150
-  $form .= "
150
+  if ($is_mailbox) {
151
+    $domainlist = get_vmail_domains();
152
+    $domain = NULL;
153
+    foreach ($domainlist as $dom) {
154
+      if ($dom->id == $account['domain']) {
155
+        $domain = $dom->domainname;
156
+      }
157
+    }
158
+    $form .= "
159
+    <p><strong style=\"font-size: 1.5em;\">{$account['local']}@{$domain}</strong></p>";
160
+  } else {
161
+    $form .= "
151 162
     <p><strong>E-Mail-Adresse:</strong>&#160;<input type=\"text\" name=\"local\" id=\"local\" size=\"10\" value=\"{$account['local']}\" /><strong style=\"font-size: 1.5em;\">&#160;@&#160;</strong>".domainselect($account['domain'])."</p>";
152
-
163
+  }
153 164
   $password_message = '';
154 165
   $password_value = '';
155 166
   if ($is_mailbox and ($account['password'] != ''))
... ...
@@ -39,13 +39,24 @@ if ($_GET['action'] == 'edit')
39 39
     $account['forwards'] = array();
40 40
   } else {
41 41
     $id = isset($_GET['id']) ? (int) $_GET['id'] : NULL;
42
-  
42
+
43 43
     $account = empty_account();
44 44
     $account['id'] = NULL;
45
-    if ($id)
45
+    if ($id) {
46 46
       $account['id'] = $id;
47
-    $account['local'] = $_POST['local'];
48
-    $account['domain'] = (int) $_POST['domain'];
47
+  
48
+      $oldaccount = get_account_details($id);
49
+      if ($oldaccount['password'] != NULL ) { // Account war vorher eine Mailbox
50
+        $account['local'] = $oldaccount['local'];
51
+        $account['domain'] = $oldaccount['domain'];
52
+      } else {
53
+        $account['local'] = $_POST['local'];
54
+        $account['domain'] = (int) $_POST['domain'];
55
+      }
56
+    } else {
57
+      $account['local'] = $_POST['local'];
58
+      $account['domain'] = (int) $_POST['domain'];
59
+    }
49 60
     $account['password'] = $_POST['password'];
50 61
     if (($account['password'] == '') && ($_POST['mailbox'] == 'yes'))
51 62
       system_failure("Sie haben ein leeres Passwort eingegeben!");