Browse code

remove whitespace in empty lines

Hanno authored on26/06/2018 23:36:40
Showing1 changed files
... ...
@@ -43,7 +43,7 @@ if ($_GET['action'] == 'edit') {
43 43
         $account['id'] = null;
44 44
         if ($id) {
45 45
             $account['id'] = $id;
46
-  
46
+
47 47
             $oldaccount = get_account_details($id);
48 48
             $account['local'] = $oldaccount['local'];
49 49
             $account['domain'] = $oldaccount['domain'];
... ...
@@ -65,7 +65,7 @@ if ($_GET['action'] == 'edit') {
65 65
         if (isset($_POST['quota'])) {
66 66
             $account['quota'] = $_POST['quota'];
67 67
         }
68
-  
68
+
69 69
         $account['quota_threshold'] = -1;
70 70
         if (isset($_POST['quota_notify']) && isset($_POST['quota_threshold']) && $_POST['quota_notify'] == 1) {
71 71
             $account['quota_threshold'] = $_POST['quota_threshold'];
... ...
@@ -145,7 +145,7 @@ if ($_GET['action'] == 'edit') {
145 145
     if (isset($_POST['ar_from']) && $_POST['ar_from'] == 'custom' && isset($_POST['ar_fromname'])) {
146 146
         $ar['fromname'] = $_POST['ar_fromname'];
147 147
     }
148
-    
148
+
149 149
     $account['autoresponder'] = $ar;
150 150
 
151 151
 
... ...
@@ -226,7 +226,7 @@ if ($_GET['action'] == 'edit') {
226 226
         }
227 227
     }
228 228
     $account_string = $account['local'] . "@" . $domain;
229
-  
229
+
230 230
     if (!isset($_POST['smtpreply']) || !$_POST['smtpreply']) {
231 231
         system_failure('Zur Stilllegung einer Adresse müssen Sie einen Text eingeben den der Absender als Fehlermeldung erhält.');
232 232
     }
... ...
@@ -251,7 +251,7 @@ if ($_GET['action'] == 'edit') {
251 251
         }
252 252
     }
253 253
     $account_string = $account['local'] . "@" . $domain;
254
-  
254
+
255 255
     $account['smtpreply'] = null;
256 256
 
257 257
     save_vmail_account($account);
Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on26/06/2018 13:58:19
Showing1 changed files
... ...
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely
8 8
 
9 9
 To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10 10
 
11
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12 12
 http://creativecommons.org/publicdomain/zero/1.0/
13 13
 
14 14
 Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
... ...
@@ -26,251 +26,240 @@ global $debugmode;
26 26
 $section = 'email_vmail';
27 27
 
28 28
 
29
-if ($_GET['action'] == 'edit')
30
-{
31
-  check_form_token('vmail_edit_mailbox');
32
-  $accountlogin = ($_SESSION['role'] == ROLE_VMAIL_ACCOUNT);
33
-
34
-  if ($accountlogin) {
35
-    $section = 'email_edit';
36
-    $id = get_vmail_id_by_emailaddr($_SESSION['mailaccount']);
37
-    $account = get_account_details($id, false);
38
-    // Leere das, sonst werden die vervielfacht
39
-    $account['forwards'] = array();
40
-  } else {
41
-    $id = isset($_GET['id']) ? (int) $_GET['id'] : NULL;
42
-
43
-    $account = empty_account();
44
-    $account['id'] = NULL;
45
-    if ($id) {
46
-      $account['id'] = $id;
29
+if ($_GET['action'] == 'edit') {
30
+    check_form_token('vmail_edit_mailbox');
31
+    $accountlogin = ($_SESSION['role'] == ROLE_VMAIL_ACCOUNT);
32
+
33
+    if ($accountlogin) {
34
+        $section = 'email_edit';
35
+        $id = get_vmail_id_by_emailaddr($_SESSION['mailaccount']);
36
+        $account = get_account_details($id, false);
37
+        // Leere das, sonst werden die vervielfacht
38
+        $account['forwards'] = array();
39
+    } else {
40
+        $id = isset($_GET['id']) ? (int) $_GET['id'] : null;
41
+
42
+        $account = empty_account();
43
+        $account['id'] = null;
44
+        if ($id) {
45
+            $account['id'] = $id;
46
+  
47
+            $oldaccount = get_account_details($id);
48
+            $account['local'] = $oldaccount['local'];
49
+            $account['domain'] = $oldaccount['domain'];
50
+        } else {
51
+            $account['local'] = $_POST['local'];
52
+            $account['domain'] = (int) $_POST['domain'];
53
+        }
54
+        $account['password'] = $_POST['password'];
55
+
56
+        if (($account['password'] == '') && (isset($_POST['mailbox']) && $_POST['mailbox'] == 'yes')) {
57
+            system_failure("Sie haben ein leeres Passwort eingegeben!");
58
+        }
59
+        if ($_POST['password'] == '**********') {
60
+            $account['password'] = '';
61
+        }
62
+        if (!isset($_POST['mailbox']) || (isset($_POST['mailbox']) && $_POST['mailbox'] != 'yes')) {
63
+            $account['password'] = null;
64
+        }
65
+        if (isset($_POST['quota'])) {
66
+            $account['quota'] = $_POST['quota'];
67
+        }
47 68
   
48
-      $oldaccount = get_account_details($id);
49
-      $account['local'] = $oldaccount['local'];
50
-      $account['domain'] = $oldaccount['domain'];
69
+        $account['quota_threshold'] = -1;
70
+        if (isset($_POST['quota_notify']) && isset($_POST['quota_threshold']) && $_POST['quota_notify'] == 1) {
71
+            $account['quota_threshold'] = $_POST['quota_threshold'];
72
+        }
73
+    }
74
+
75
+    $ar = empty_autoresponder_config();
76
+    $valid_from_date = time();
77
+    $valid_until_date = null;
78
+    if (isset($_POST['ar_valid_from']) && ($_POST['ar_valid_from'] == 'now')) {
79
+        $valid_from_date = time();
51 80
     } else {
52
-      $account['local'] = $_POST['local'];
53
-      $account['domain'] = (int) $_POST['domain'];
81
+        if (isset($_POST['ar_startdate'])) {
82
+            if (date('Y-m-d', strtotime($_POST['ar_startdate'])) != $_POST['ar_startdate']) {
83
+                system_failure('Das Aktivierungs-Datum scheint ungültig zu sein.');
84
+            } else {
85
+                $valid_from_date = strtotime($_POST['ar_startdate']);
86
+            }
87
+        }
54 88
     }
55
-    $account['password'] = $_POST['password'];
56
-
57
-    if (($account['password'] == '') && (isset($_POST['mailbox']) && $_POST['mailbox'] == 'yes'))
58
-      system_failure("Sie haben ein leeres Passwort eingegeben!");
59
-    if ($_POST['password'] == '**********')
60
-      $account['password'] = '';
61
-    if (!isset($_POST['mailbox']) || (isset($_POST['mailbox']) && $_POST['mailbox'] != 'yes'))
62
-    {
63
-      $account['password'] = NULL;
89
+    if ($valid_from_date < time()) {
90
+        $valid_from_date = time();
91
+        warning('Das Aktivierungs-Datum liegt in der Vergangenheit. Die Funktion wird ab sofort aktiviert.');
64 92
     }
65
-    if (isset($_POST['quota'])) {
66
-      $account['quota'] = $_POST['quota'];
93
+    if ($valid_from_date > time() + 365*24*60*60) {
94
+        warning('Das Aktivierungs-Datum liegt mehr als ein Jahr in der Zukunft. Bitte prüfen Sie ob Sie das korrekte Jahr gewählt haben.');
67 95
     }
68
-  
69
-    $account['quota_threshold'] = -1;
70
-    if (isset($_POST['quota_notify']) && isset($_POST['quota_threshold']) && $_POST['quota_notify'] == 1) {
71
-      $account['quota_threshold'] = $_POST['quota_threshold'];
96
+    if (isset($_POST['ar_valid_until']) && ($_POST['ar_valid_until'] == 'infinity')) {
97
+        $valid_until_date = null;
98
+    } else {
99
+        if (isset($_POST['ar_enddate'])) {
100
+            if (date('Y-m-d', strtotime($_POST['ar_enddate'])) != $_POST['ar_enddate']) {
101
+                system_failure('Das Deaktivierungs-Datum scheint ungültig zu sein.');
102
+            } else {
103
+                $valid_until_date = strtotime($_POST['ar_enddate']);
104
+            }
105
+        }
72 106
     }
73
-
74
-  }
75
-
76
-  $ar = empty_autoresponder_config();
77
-  $valid_from_date = time();
78
-  $valid_until_date = NULL;
79
-  if (isset($_POST['ar_valid_from']) && ($_POST['ar_valid_from'] == 'now')) {
80
-    $valid_from_date = time();
81
-  } else {
82
-    if (isset($_POST['ar_startdate'])) {
83
-      if (date('Y-m-d', strtotime($_POST['ar_startdate'])) != $_POST['ar_startdate']) {
84
-        system_failure('Das Aktivierungs-Datum scheint ungültig zu sein.');
85
-      } else {
86
-        $valid_from_date = strtotime($_POST['ar_startdate']);
87
-      }
107
+    if (!isset($_POST['autoresponder']) || $_POST['autoresponder'] != 'yes') {
108
+        $valid_from_date = null;
109
+    } else {
110
+        if ($valid_until_date && $valid_until_date < time()) {
111
+            warning('Das Deaktivierungs-Datum liegt in der Vergangenheit, der Autoresponder wird sofort deaktiviert!');
112
+        }
88 113
     }
89
-  }
90
-  if ($valid_from_date < time()) {
91
-    $valid_from_date = time();
92
-    warning('Das Aktivierungs-Datum liegt in der Vergangenheit. Die Funktion wird ab sofort aktiviert.');
93
-  }
94
-  if ($valid_from_date > time() + 365*24*60*60) {
95
-    warning('Das Aktivierungs-Datum liegt mehr als ein Jahr in der Zukunft. Bitte prüfen Sie ob Sie das korrekte Jahr gewählt haben.');
96
-  }
97
-  if (isset($_POST['ar_valid_until']) && ($_POST['ar_valid_until'] == 'infinity')) {
98
-    $valid_until_date = NULL;
99
-  } else {
100
-    if (isset($_POST['ar_enddate'])) {
101
-      if (date('Y-m-d', strtotime($_POST['ar_enddate'])) != $_POST['ar_enddate']) {
102
-        system_failure('Das Deaktivierungs-Datum scheint ungültig zu sein.');
103
-      } else {
104
-        $valid_until_date = strtotime($_POST['ar_enddate']);
105
-      }
114
+    if ($valid_from_date) {
115
+        $ar['valid_from'] = date('Y-m-d', $valid_from_date);
116
+    } else {
117
+        $ar['valid_from'] = null;
106 118
     }
107
-  }
108
-  if (!isset($_POST['autoresponder']) || $_POST['autoresponder'] != 'yes') {
109
-    $valid_from_date = NULL;
110
-  } else {
111
-    if ($valid_until_date && $valid_until_date < time()) {
112
-      warning('Das Deaktivierungs-Datum liegt in der Vergangenheit, der Autoresponder wird sofort deaktiviert!');
119
+    if ($valid_until_date) {
120
+        $ar['valid_until'] = date('Y-m-d', $valid_until_date);
121
+    } else {
122
+        $ar['valid_until'] = null;
113 123
     }
114
-  }
115
-  if ($valid_from_date) {
116
-    $ar['valid_from'] = date('Y-m-d', $valid_from_date);
117
-  } else {
118
-    $ar['valid_from'] = NULL;
119
-  }
120
-  if ($valid_until_date) {
121
-    $ar['valid_until'] = date('Y-m-d', $valid_until_date);
122
-  } else {
123
-    $ar['valid_until'] = NULL;
124
-  }
125
-
126
-  if (isset($_POST['ar_subject']) && $_POST['ar_subject'] == 'custom' && isset($_POST['ar_subject_value']) && chop($_POST['ar_subject_value']) != '') {
127
-    $ar['subject'] = chop($_POST['ar_subject_value']);
128
-  }
129
-
130
-  if (isset($_POST['ar_message'])) {
131
-    $ar['message'] = $_POST['ar_message'];
132
-  }
133
-
134
-  if (isset($_POST['ar_quote'])) {
135
-    if ($_POST['ar_quote'] == 'teaser') {
136
-      $ar['quote'] = 'teaser';
124
+
125
+    if (isset($_POST['ar_subject']) && $_POST['ar_subject'] == 'custom' && isset($_POST['ar_subject_value']) && chop($_POST['ar_subject_value']) != '') {
126
+        $ar['subject'] = chop($_POST['ar_subject_value']);
137 127
     }
138
-    if ($_POST['ar_quote'] == 'inline') {
139
-      $ar['quote'] = 'inline';
128
+
129
+    if (isset($_POST['ar_message'])) {
130
+        $ar['message'] = $_POST['ar_message'];
140 131
     }
141
-    if ($_POST['ar_quote'] == 'attach') {
142
-      $ar['quote'] = 'attach';
132
+
133
+    if (isset($_POST['ar_quote'])) {
134
+        if ($_POST['ar_quote'] == 'teaser') {
135
+            $ar['quote'] = 'teaser';
136
+        }
137
+        if ($_POST['ar_quote'] == 'inline') {
138
+            $ar['quote'] = 'inline';
139
+        }
140
+        if ($_POST['ar_quote'] == 'attach') {
141
+            $ar['quote'] = 'attach';
142
+        }
143 143
     }
144
-  }
145 144
 
146
-  if (isset($_POST['ar_from']) && $_POST['ar_from'] == 'custom' && isset($_POST['ar_fromname'])) {
147
-    $ar['fromname'] = $_POST['ar_fromname'];
148
-  }
145
+    if (isset($_POST['ar_from']) && $_POST['ar_from'] == 'custom' && isset($_POST['ar_fromname'])) {
146
+        $ar['fromname'] = $_POST['ar_fromname'];
147
+    }
149 148
     
150
-  $account['autoresponder'] = $ar;
151
-
152
-
153
-
154
-  if (isset($_POST['forward']) && $_POST['forward'] == 'yes')
155
-  {
156
-    $num = 1;
157
-    while (true)
158
-    {
159
-      // Die ersten 50 Einträge in jedem Fall prüfen, danach nur so lange zusätzliche Einträge vorhanden
160
-      if (! isset($_POST['forward_to_'.$num]) && $num > 50)
161
-        break;
162
-      if (isset($_POST['forward_to_'.$num]) && chop($_POST['forward_to_'.$num]) != '') {
163
-        $fwd = array("destination" => chop($_POST['forward_to_'.$num]));
164
-        array_push($account['forwards'], $fwd);
165
-      }
166
-      $num++;
149
+    $account['autoresponder'] = $ar;
150
+
151
+
152
+
153
+    if (isset($_POST['forward']) && $_POST['forward'] == 'yes') {
154
+        $num = 1;
155
+        while (true) {
156
+            // Die ersten 50 Einträge in jedem Fall prüfen, danach nur so lange zusätzliche Einträge vorhanden
157
+            if (! isset($_POST['forward_to_'.$num]) && $num > 50) {
158
+                break;
159
+            }
160
+            if (isset($_POST['forward_to_'.$num]) && chop($_POST['forward_to_'.$num]) != '') {
161
+                $fwd = array("destination" => chop($_POST['forward_to_'.$num]));
162
+                array_push($account['forwards'], $fwd);
163
+            }
164
+            $num++;
165
+        }
166
+        if (count($account['forwards']) == 0) {
167
+            system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
168
+        }
167 169
     }
168
-    if (count($account['forwards']) == 0) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
169
-  }
170 170
 
171
-  if ($account['password'] === NULL && count($account['forwards']) == 0) {
172
-    system_failure("Entweder eine Mailbox oder eine Weiterleitung muss angegeben werden!");
173
-  }
171
+    if ($account['password'] === null && count($account['forwards']) == 0) {
172
+        system_failure("Entweder eine Mailbox oder eine Weiterleitung muss angegeben werden!");
173
+    }
174 174
 
175
-  DEBUG($account);
175
+    DEBUG($account);
176 176
 
177
-  save_vmail_account($account);
177
+    save_vmail_account($account);
178 178
 
179
-  if (! ($debugmode || we_have_an_error())) {
180
-    if ($accountlogin) {
181
-      header('Location: /');
182
-    } else {
183
-      header('Location: vmail');
179
+    if (! ($debugmode || we_have_an_error())) {
180
+        if ($accountlogin) {
181
+            header('Location: /');
182
+        } else {
183
+            header('Location: vmail');
184
+        }
184 185
     }
185
-  }
186
-}
187
-elseif ($_GET['action'] == 'delete')
188
-{
189
-  $title = "E-mail-Adresse löschen";
190
-  $section = 'vmail_vmail';
191
-
192
-  $account = get_account_details( (int) $_GET['id'] );
193
-
194
-  $domain = NULL;
195
-  $domains = get_vmail_domains();
196
-  foreach ($domains as $dom)
197
-    if ($dom['id'] == $account['domain'])
198
-    {
199
-      $domain = $dom['domainname'];
200
-      break;
186
+} elseif ($_GET['action'] == 'delete') {
187
+    $title = "E-mail-Adresse löschen";
188
+    $section = 'vmail_vmail';
189
+
190
+    $account = get_account_details((int) $_GET['id']);
191
+
192
+    $domain = null;
193
+    $domains = get_vmail_domains();
194
+    foreach ($domains as $dom) {
195
+        if ($dom['id'] == $account['domain']) {
196
+            $domain = $dom['domainname'];
197
+            break;
198
+        }
201 199
     }
202
-  $account_string = $account['local'] . "@" . $domain;
203
-  $sure = user_is_sure();
204
-  if ($sure === NULL)
205
-  {
206
-    are_you_sure("action=delete&id={$account['id']}", "Möchten Sie die E-Mail-Adresse »{$account_string}« wirklich löschen?");
207
-  }
208
-  elseif ($sure === true)
209
-  {
210
-    delete_account($account['id']);
211
-    if (! $debugmode)
212
-      header("Location: vmail");
213
-  }
214
-  elseif ($sure === false)
215
-  {
216
-    if (! $debugmode)
217
-      header("Location: vmail");
218
-  }
219
-
220
-}
221
-elseif ($_GET['action'] == 'suspend')
222
-{
223
-  $title = "E-mail-Adresse stilllegen";
224
-  $section = 'vmail_vmail';
225
-
226
-  $account = get_account_details( (int) $_GET['id'] );
227
-
228
-  $domain = NULL;
229
-  $domains = get_vmail_domains();
230
-  foreach ($domains as $dom)
231
-    if ($dom['id'] == $account['domain'])
232
-    {
233
-      $domain = $dom['domainname'];
234
-      break;
200
+    $account_string = $account['local'] . "@" . $domain;
201
+    $sure = user_is_sure();
202
+    if ($sure === null) {
203
+        are_you_sure("action=delete&id={$account['id']}", "Möchten Sie die E-Mail-Adresse »{$account_string}« wirklich löschen?");
204
+    } elseif ($sure === true) {
205
+        delete_account($account['id']);
206
+        if (! $debugmode) {
207
+            header("Location: vmail");
208
+        }
209
+    } elseif ($sure === false) {
210
+        if (! $debugmode) {
211
+            header("Location: vmail");
212
+        }
235 213
     }
236
-  $account_string = $account['local'] . "@" . $domain;
214
+} elseif ($_GET['action'] == 'suspend') {
215
+    $title = "E-mail-Adresse stilllegen";
216
+    $section = 'vmail_vmail';
217
+
218
+    $account = get_account_details((int) $_GET['id']);
219
+
220
+    $domain = null;
221
+    $domains = get_vmail_domains();
222
+    foreach ($domains as $dom) {
223
+        if ($dom['id'] == $account['domain']) {
224
+            $domain = $dom['domainname'];
225
+            break;
226
+        }
227
+    }
228
+    $account_string = $account['local'] . "@" . $domain;
237 229
   
238
-  if (!isset($_POST['smtpreply']) || !$_POST['smtpreply']) {
239
-    system_failure('Zur Stilllegung einer Adresse müssen Sie einen Text eingeben den der Absender als Fehlermeldung erhält.');
240
-  }
241
-  $account['smtpreply'] = $_POST['smtpreply'];
242
-
243
-  save_vmail_account($account);
244
-  if (! $debugmode)
245
-    header("Location: vmail");
246
-}
247
-elseif ($_GET['action'] == 'unsuspend')
248
-{
249
-  $title = "E-mail-Adresse wieder aktivieren";
250
-  $section = 'vmail_vmail';
251
-
252
-  $account = get_account_details( (int) $_GET['id'] );
253
-
254
-  $domain = NULL;
255
-  $domains = get_vmail_domains();
256
-  foreach ($domains as $dom)
257
-    if ($dom['id'] == $account['domain'])
258
-    {
259
-      $domain = $dom['domainname'];
260
-      break;
230
+    if (!isset($_POST['smtpreply']) || !$_POST['smtpreply']) {
231
+        system_failure('Zur Stilllegung einer Adresse müssen Sie einen Text eingeben den der Absender als Fehlermeldung erhält.');
232
+    }
233
+    $account['smtpreply'] = $_POST['smtpreply'];
234
+
235
+    save_vmail_account($account);
236
+    if (! $debugmode) {
237
+        header("Location: vmail");
261 238
     }
262
-  $account_string = $account['local'] . "@" . $domain;
239
+} elseif ($_GET['action'] == 'unsuspend') {
240
+    $title = "E-mail-Adresse wieder aktivieren";
241
+    $section = 'vmail_vmail';
242
+
243
+    $account = get_account_details((int) $_GET['id']);
244
+
245
+    $domain = null;
246
+    $domains = get_vmail_domains();
247
+    foreach ($domains as $dom) {
248
+        if ($dom['id'] == $account['domain']) {
249
+            $domain = $dom['domainname'];
250
+            break;
251
+        }
252
+    }
253
+    $account_string = $account['local'] . "@" . $domain;
263 254
   
264
-  $account['smtpreply'] = NULL;
255
+    $account['smtpreply'] = null;
265 256
 
266
-  save_vmail_account($account);
267
-  if (! $debugmode)
268
-    header("Location: vmail");
257
+    save_vmail_account($account);
258
+    if (! $debugmode) {
259
+        header("Location: vmail");
260
+    }
261
+} else {
262
+    system_failure("Unimplemented action");
269 263
 }
270
-else
271
-  system_failure("Unimplemented action");
272 264
 
273 265
 output('');
274
-
275
-
276
-?>
Browse code

Prüfe, dass entweder Mailbox oder Weiterleitung eingeschaltet ist

Bernd Wurst authored on09/04/2018 10:21:14
Showing1 changed files
... ...
@@ -168,8 +168,9 @@ if ($_GET['action'] == 'edit')
168 168
     if (count($account['forwards']) == 0) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
169 169
   }
170 170
 
171
-  if ((isset($_POST['forward']) && $_POST['forward']!='yes') && (isset($_POST['mailbox']) && $_POST['mailbox']!='yes'))
171
+  if ($account['password'] === NULL && count($account['forwards']) == 0) {
172 172
     system_failure("Entweder eine Mailbox oder eine Weiterleitung muss angegeben werden!");
173
+  }
173 174
 
174 175
   DEBUG($account);
175 176
 
Browse code

Ermögliche das Abschalten einer Mailbox

Bernd Wurst authored on09/04/2018 10:10:59
Showing1 changed files
... ...
@@ -58,7 +58,7 @@ if ($_GET['action'] == 'edit')
58 58
       system_failure("Sie haben ein leeres Passwort eingegeben!");
59 59
     if ($_POST['password'] == '**********')
60 60
       $account['password'] = '';
61
-    if (isset($_POST['mailbox']) && $_POST['mailbox'] != 'yes')
61
+    if (!isset($_POST['mailbox']) || (isset($_POST['mailbox']) && $_POST['mailbox'] != 'yes'))
62 62
     {
63 63
       $account['password'] = NULL;
64 64
     }
Browse code

Copyright year update

Bernd Wurst authored on13/01/2018 06:07:05
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

avoid warnings due to unset mailbox array element in POST

Hanno Böck authored on01/12/2017 12:24:59
Showing1 changed files
... ...
@@ -53,11 +53,12 @@ if ($_GET['action'] == 'edit')
53 53
       $account['domain'] = (int) $_POST['domain'];
54 54
     }
55 55
     $account['password'] = $_POST['password'];
56
-    if (($account['password'] == '') && ($_POST['mailbox'] == 'yes'))
56
+
57
+    if (($account['password'] == '') && (isset($_POST['mailbox']) && $_POST['mailbox'] == 'yes'))
57 58
       system_failure("Sie haben ein leeres Passwort eingegeben!");
58 59
     if ($_POST['password'] == '**********')
59 60
       $account['password'] = '';
60
-    if ($_POST['mailbox'] != 'yes')
61
+    if (isset($_POST['mailbox']) && $_POST['mailbox'] != 'yes')
61 62
     {
62 63
       $account['password'] = NULL;
63 64
     }
... ...
@@ -167,7 +168,7 @@ if ($_GET['action'] == 'edit')
167 168
     if (count($account['forwards']) == 0) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
168 169
   }
169 170
 
170
-  if ((isset($_POST['forward']) && $_POST['forward']!='yes') && ($_POST['mailbox']!='yes'))
171
+  if ((isset($_POST['forward']) && $_POST['forward']!='yes') && (isset($_POST['mailbox']) && $_POST['mailbox']!='yes'))
171 172
     system_failure("Entweder eine Mailbox oder eine Weiterleitung muss angegeben werden!");
172 173
 
173 174
   DEBUG($account);
Bernd Wurst authored on22/03/2017 08:50:35
Showing1 changed files
... ...
@@ -156,7 +156,7 @@ if ($_GET['action'] == 'edit')
156 156
     while (true)
157 157
     {
158 158
       // Die ersten 50 Einträge in jedem Fall prüfen, danach nur so lange zusätzliche Einträge vorhanden
159
-      if (! isset($_POST['forward_to_'.$num])) && $num > 50)
159
+      if (! isset($_POST['forward_to_'.$num]) && $num > 50)
160 160
         break;
161 161
       if (isset($_POST['forward_to_'.$num]) && chop($_POST['forward_to_'.$num]) != '') {
162 162
         $fwd = array("destination" => chop($_POST['forward_to_'.$num]));
Browse code

Alle Optionen bzgl. Spamfilter entfernt, der ist jetzt obligatorisch und lehnt auf SMTP-Ebene ab

Bernd Wurst authored on02/03/2017 15:52:13
Showing1 changed files
... ...
@@ -60,7 +60,6 @@ if ($_GET['action'] == 'edit')
60 60
     if ($_POST['mailbox'] != 'yes')
61 61
     {
62 62
       $account['password'] = NULL;
63
-      $account['spamfilter'] = 'none';
64 63
     }
65 64
     if (isset($_POST['quota'])) {
66 65
       $account['quota'] = $_POST['quota'];
... ...
@@ -72,7 +71,6 @@ if ($_GET['action'] == 'edit')
72 71
     }
73 72
 
74 73
   }
75
-  $account['spamfilter'] = $_POST['spamfilter_action'];
76 74
 
77 75
   $ar = empty_autoresponder_config();
78 76
   $valid_from_date = time();
... ...
@@ -158,10 +156,10 @@ if ($_GET['action'] == 'edit')
158 156
     while (true)
159 157
     {
160 158
       // Die ersten 50 Einträge in jedem Fall prüfen, danach nur so lange zusätzliche Einträge vorhanden
161
-      if (! isset($_POST['forward_to_'.$num]) && ! isset($_POST['spamfilter_action_'.$num]) && $num > 50)
159
+      if (! isset($_POST['forward_to_'.$num])) && $num > 50)
162 160
         break;
163 161
       if (isset($_POST['forward_to_'.$num]) && chop($_POST['forward_to_'.$num]) != '') {
164
-        $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => chop($_POST['forward_to_'.$num]));
162
+        $fwd = array("destination" => chop($_POST['forward_to_'.$num]));
165 163
         array_push($account['forwards'], $fwd);
166 164
       }
167 165
       $num++;
Browse code

Update auf nicht mehr so neue Rechtschreibung

Bernd Wurst authored on22/07/2014 12:23:59
Showing1 changed files
... ...
@@ -220,7 +220,7 @@ elseif ($_GET['action'] == 'delete')
220 220
 }
221 221
 elseif ($_GET['action'] == 'suspend')
222 222
 {
223
-  $title = "E-mail-Adresse stillegen";
223
+  $title = "E-mail-Adresse stilllegen";
224 224
   $section = 'vmail_vmail';
225 225
 
226 226
   $account = get_account_details( (int) $_GET['id'] );
... ...
@@ -236,7 +236,7 @@ elseif ($_GET['action'] == 'suspend')
236 236
   $account_string = $account['local'] . "@" . $domain;
237 237
   
238 238
   if (!isset($_POST['smtpreply']) || !$_POST['smtpreply']) {
239
-    system_failure('Zur Stillegung einer Adresse müssen Sie einen Text eingeben den der Absender als Fehlermeldung erhält.');
239
+    system_failure('Zur Stilllegung einer Adresse müssen Sie einen Text eingeben den der Absender als Fehlermeldung erhält.');
240 240
   }
241 241
   $account['smtpreply'] = $_POST['smtpreply'];
242 242
 
Browse code

SMTP-seitige Autoresponder als "Stillegung" implementiert

Bernd Wurst authored on22/07/2014 11:47:11
Showing1 changed files
... ...
@@ -218,6 +218,55 @@ elseif ($_GET['action'] == 'delete')
218 218
   }
219 219
 
220 220
 }
221
+elseif ($_GET['action'] == 'suspend')
222
+{
223
+  $title = "E-mail-Adresse stillegen";
224
+  $section = 'vmail_vmail';
225
+
226
+  $account = get_account_details( (int) $_GET['id'] );
227
+
228
+  $domain = NULL;
229
+  $domains = get_vmail_domains();
230
+  foreach ($domains as $dom)
231
+    if ($dom['id'] == $account['domain'])
232
+    {
233
+      $domain = $dom['domainname'];
234
+      break;
235
+    }
236
+  $account_string = $account['local'] . "@" . $domain;
237
+  
238
+  if (!isset($_POST['smtpreply']) || !$_POST['smtpreply']) {
239
+    system_failure('Zur Stillegung einer Adresse müssen Sie einen Text eingeben den der Absender als Fehlermeldung erhält.');
240
+  }
241
+  $account['smtpreply'] = $_POST['smtpreply'];
242
+
243
+  save_vmail_account($account);
244
+  if (! $debugmode)
245
+    header("Location: vmail");
246
+}
247
+elseif ($_GET['action'] == 'unsuspend')
248
+{
249
+  $title = "E-mail-Adresse wieder aktivieren";
250
+  $section = 'vmail_vmail';
251
+
252
+  $account = get_account_details( (int) $_GET['id'] );
253
+
254
+  $domain = NULL;
255
+  $domains = get_vmail_domains();
256
+  foreach ($domains as $dom)
257
+    if ($dom['id'] == $account['domain'])
258
+    {
259
+      $domain = $dom['domainname'];
260
+      break;
261
+    }
262
+  $account_string = $account['local'] . "@" . $domain;
263
+  
264
+  $account['smtpreply'] = NULL;
265
+
266
+  save_vmail_account($account);
267
+  if (! $debugmode)
268
+    header("Location: vmail");
269
+}
221 270
 else
222 271
   system_failure("Unimplemented action");
223 272
 
Browse code

Autoresponder nur noch befristet auf 60 Tage möglich

Bernd Wurst authored on15/05/2014 07:34:16
Showing1 changed files
... ...
@@ -133,6 +133,9 @@ if ($_GET['action'] == 'edit')
133 133
   }
134 134
 
135 135
   if (isset($_POST['ar_quote'])) {
136
+    if ($_POST['ar_quote'] == 'teaser') {
137
+      $ar['quote'] = 'teaser';
138
+    }
136 139
     if ($_POST['ar_quote'] == 'inline') {
137 140
       $ar['quote'] = 'inline';
138 141
     }
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on08/02/2014 05:45:07
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2013 by schokokeks.org Hosting, namely
5
+Written 2008-2014 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Umgestellt auf JQueryUI-Datepicker

Bernd Wurst authored on08/02/2014 04:09:28
Showing1 changed files
... ...
@@ -80,12 +80,11 @@ if ($_GET['action'] == 'edit')
80 80
   if (isset($_POST['ar_valid_from']) && ($_POST['ar_valid_from'] == 'now')) {
81 81
     $valid_from_date = time();
82 82
   } else {
83
-    if (isset($_POST['ar_valid_from_day']) && isset($_POST['ar_valid_from_month']) && isset($_POST['ar_valid_from_year'])) {
84
-      $tmpdate = $_POST['ar_valid_from_year'].'-'.$_POST['ar_valid_from_month'].'-'.$_POST['ar_valid_from_day'];
85
-      if (date('Y-n-j', strtotime($tmpdate)) != $tmpdate) {
83
+    if (isset($_POST['ar_startdate'])) {
84
+      if (date('Y-m-d', strtotime($_POST['ar_startdate'])) != $_POST['ar_startdate']) {
86 85
         system_failure('Das Aktivierungs-Datum scheint ungültig zu sein.');
87 86
       } else {
88
-        $valid_from_date = strtotime($tmpdate);
87
+        $valid_from_date = strtotime($_POST['ar_startdate']);
89 88
       }
90 89
     }
91 90
   }
... ...
@@ -99,12 +98,11 @@ if ($_GET['action'] == 'edit')
99 98
   if (isset($_POST['ar_valid_until']) && ($_POST['ar_valid_until'] == 'infinity')) {
100 99
     $valid_until_date = NULL;
101 100
   } else {
102
-    if (isset($_POST['ar_valid_until_day']) && isset($_POST['ar_valid_until_month']) && isset($_POST['ar_valid_until_year'])) {
103
-      $tmpdate = $_POST['ar_valid_until_year'].'-'.$_POST['ar_valid_until_month'].'-'.$_POST['ar_valid_until_day'];
104
-      if (date('Y-n-j', strtotime($tmpdate)) != $tmpdate) {
101
+    if (isset($_POST['ar_enddate'])) {
102
+      if (date('Y-m-d', strtotime($_POST['ar_enddate'])) != $_POST['ar_enddate']) {
105 103
         system_failure('Das Deaktivierungs-Datum scheint ungültig zu sein.');
106 104
       } else {
107
-        $valid_until_date = strtotime($tmpdate);
105
+        $valid_until_date = strtotime($_POST['ar_enddate']);
108 106
       }
109 107
     }
110 108
   }
Browse code

Fehler behoben, durch den der Autoresponder evtl. versehentlich wieder aktiviert wird.

Bernd Wurst authored on17/12/2013 14:09:23
Showing1 changed files
... ...
@@ -74,7 +74,6 @@ if ($_GET['action'] == 'edit')
74 74
   }
75 75
   $account['spamfilter'] = $_POST['spamfilter_action'];
76 76
 
77
-
78 77
   $ar = empty_autoresponder_config();
79 78
   $valid_from_date = time();
80 79
   $valid_until_date = NULL;
... ...
@@ -111,10 +110,10 @@ if ($_GET['action'] == 'edit')
111 110
   }
112 111
   if (!isset($_POST['autoresponder']) || $_POST['autoresponder'] != 'yes') {
113 112
     $valid_from_date = NULL;
114
-  }
115
-  if ($valid_until_date && $valid_until_date < time()) {
116
-    warning('Das Deaktivierungs-Datum liegt in der Vergangenheit, eine automatische Deaktivierung wird nicht stattfinden.');
117
-    $valid_until_date = NULL;
113
+  } else {
114
+    if ($valid_until_date && $valid_until_date < time()) {
115
+      warning('Das Deaktivierungs-Datum liegt in der Vergangenheit, der Autoresponder wird sofort deaktiviert!');
116
+    }
118 117
   }
119 118
   if ($valid_from_date) {
120 119
     $ar['valid_from'] = date('Y-m-d', $valid_from_date);
Browse code

Daten für Autoresponder bei der Ausgabe Filtern, nicht bei der Eingabe

schokokeks.org web services authored on14/09/2013 18:18:01
Showing1 changed files
... ...
@@ -128,11 +128,11 @@ if ($_GET['action'] == 'edit')
128 128
   }
129 129
 
130 130
   if (isset($_POST['ar_subject']) && $_POST['ar_subject'] == 'custom' && isset($_POST['ar_subject_value']) && chop($_POST['ar_subject_value']) != '') {
131
-    $ar['subject'] = filter_input_general( chop($_POST['ar_subject_value']) );
131
+    $ar['subject'] = chop($_POST['ar_subject_value']);
132 132
   }
133 133
 
134 134
   if (isset($_POST['ar_message'])) {
135
-    $ar['message'] = filter_input_general( $_POST['ar_message'] );
135
+    $ar['message'] = $_POST['ar_message'];
136 136
   }
137 137
 
138 138
   if (isset($_POST['ar_quote'])) {
... ...
@@ -145,7 +145,7 @@ if ($_GET['action'] == 'edit')
145 145
   }
146 146
 
147 147
   if (isset($_POST['ar_from']) && $_POST['ar_from'] == 'custom' && isset($_POST['ar_fromname'])) {
148
-    $ar['fromname'] = filter_input_general( $_POST['ar_fromname']);
148
+    $ar['fromname'] = $_POST['ar_fromname'];
149 149
   }
150 150
     
151 151
   $account['autoresponder'] = $ar;
Browse code

Bugfix: Adresse kann nicht mehr nachträglich in ein Postfach umgewandelt werden

Bernd Wurst authored on27/02/2013 15:52:00
Showing1 changed files
... ...
@@ -46,13 +46,8 @@ if ($_GET['action'] == 'edit')
46 46
       $account['id'] = $id;
47 47
   
48 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
-      }
49
+      $account['local'] = $oldaccount['local'];
50
+      $account['domain'] = $oldaccount['domain'];
56 51
     } else {
57 52
       $account['local'] = $_POST['local'];
58 53
       $account['domain'] = (int) $_POST['domain'];
Browse code

object => assoc

Bernd Wurst authored on25/02/2013 10:25:42
Showing1 changed files
... ...
@@ -199,9 +199,9 @@ elseif ($_GET['action'] == 'delete')
199 199
   $domain = NULL;
200 200
   $domains = get_vmail_domains();
201 201
   foreach ($domains as $dom)
202
-    if ($dom->id == $account['domain'])
202
+    if ($dom['id'] == $account['domain'])
203 203
     {
204
-      $domain = $dom->domainname;
204
+      $domain = $dom['domainname'];
205 205
       break;
206 206
     }
207 207
   $account_string = $account['local'] . "@" . $domain;
Browse code

Updated copyright notice (2012 => 2013)

Bernd Wurst authored on19/01/2013 10:49:50
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2012 by schokokeks.org Hosting, namely
5
+Written 2008-2013 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
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
Showing1 changed files
... ...
@@ -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!");
Browse code

Added license tags for CC0, README and COPYING

Bernd Wurst authored on11/03/2012 15:40:04
Showing1 changed files
... ...
@@ -1,4 +1,18 @@
1 1
 <?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2012 by schokokeks.org Hosting, namely
6
+  Bernd Wurst <bernd@schokokeks.org>
7
+  Hanno Böck <hanno@schokokeks.org>
8
+
9
+To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10
+
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12
+http://creativecommons.org/publicdomain/zero/1.0/
13
+
14
+Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15
+*/
2 16
 
3 17
 require_once('session/start.php');
4 18
 
Browse code

Index-Blöcke werden jetzt vond en Modulen selbst bereitgestellt

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

bernd authored on08/03/2012 14:33:17
Showing1 changed files
... ...
@@ -18,6 +18,7 @@ if ($_GET['action'] == 'edit')
18 18
   $accountlogin = ($_SESSION['role'] == ROLE_VMAIL_ACCOUNT);
19 19
 
20 20
   if ($accountlogin) {
21
+    $section = 'email_edit';
21 22
     $id = get_vmail_id_by_emailaddr($_SESSION['mailaccount']);
22 23
     $account = get_account_details($id, false);
23 24
     // Leere das, sonst werden die vervielfacht
... ...
@@ -157,7 +158,7 @@ if ($_GET['action'] == 'edit')
157 158
 
158 159
   if (! ($debugmode || we_have_an_error())) {
159 160
     if ($accountlogin) {
160
-      header('Location: ../index/index');
161
+      header('Location: /');
161 162
     } else {
162 163
       header('Location: vmail');
163 164
     }
Browse code

JavaScript-Erweiterungen: User kann Weiterleitungen direkt löschen

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

bernd authored on05/03/2012 14:58:37
Showing1 changed files
... ...
@@ -136,15 +136,16 @@ if ($_GET['action'] == 'edit')
136 136
     $num = 1;
137 137
     while (true)
138 138
     {
139
-      if (! isset($_POST['forward_to_'.$num]))
139
+      // Die ersten 50 Einträge in jedem Fall prüfen, danach nur so lange zusätzliche Einträge vorhanden
140
+      if (! isset($_POST['forward_to_'.$num]) && ! isset($_POST['spamfilter_action_'.$num]) && $num > 50)
140 141
         break;
141
-      if ($_POST['forward_to_'.$num] == '')
142
-        break;
143
-      $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => chop($_POST['forward_to_'.$num]));
144
-      array_push($account['forwards'], $fwd);
142
+      if (isset($_POST['forward_to_'.$num]) && chop($_POST['forward_to_'.$num]) != '') {
143
+        $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => chop($_POST['forward_to_'.$num]));
144
+        array_push($account['forwards'], $fwd);
145
+      }
145 146
       $num++;
146 147
     }
147
-    if ($num == 1) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
148
+    if (count($account['forwards']) == 0) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
148 149
   }
149 150
 
150 151
   if ((isset($_POST['forward']) && $_POST['forward']!='yes') && ($_POST['mailbox']!='yes'))
Browse code

Datums-Check und Daten in umgangssprachlicher Form ausgeben

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

bernd authored on02/03/2012 09:59:53
Showing1 changed files
... ...
@@ -9,6 +9,8 @@ require_role(array(ROLE_SYSTEMUSER, ROLE_VMAIL_ACCOUNT));
9 9
 require_once("inc/debug.php");
10 10
 global $debugmode;
11 11
 
12
+$section = 'email_vmail';
13
+
12 14
 
13 15
 if ($_GET['action'] == 'edit')
14 16
 {
... ...
@@ -21,7 +23,7 @@ if ($_GET['action'] == 'edit')
21 23
     // Leere das, sonst werden die vervielfacht
22 24
     $account['forwards'] = array();
23 25
   } else {
24
-    $id = (int) $_GET['id'];
26
+    $id = isset($_GET['id']) ? (int) $_GET['id'] : NULL;
25 27
   
26 28
     $account = empty_account();
27 29
     $account['id'] = NULL;
... ...
@@ -55,21 +57,52 @@ if ($_GET['action'] == 'edit')
55 57
   $ar = empty_autoresponder_config();
56 58
   $valid_from_date = time();
57 59
   $valid_until_date = NULL;
58
-  if (isset($_POST['ar_valid_from_day']) && isset($_POST['ar_valid_from_month']) && isset($_POST['ar_valid_from_year'])) {
59
-    $valid_from_date = strtotime($_POST['ar_valid_from_year'].'-'.$_POST['ar_valid_from_month'].'-'.$_POST['ar_valid_from_day']);
60
-  }
61
-  if (isset($_POST['ar_valid_until_day']) && isset($_POST['ar_valid_until_month']) && isset($_POST['ar_valid_until_year'])) {
62
-    $valid_until_date = strtotime($_POST['ar_valid_until_year'].'-'.$_POST['ar_valid_until_month'].'-'.$_POST['ar_valid_until_day']);
60
+  if (isset($_POST['ar_valid_from']) && ($_POST['ar_valid_from'] == 'now')) {
61
+    $valid_from_date = time();
62
+  } else {
63
+    if (isset($_POST['ar_valid_from_day']) && isset($_POST['ar_valid_from_month']) && isset($_POST['ar_valid_from_year'])) {
64
+      $tmpdate = $_POST['ar_valid_from_year'].'-'.$_POST['ar_valid_from_month'].'-'.$_POST['ar_valid_from_day'];
65
+      if (date('Y-n-j', strtotime($tmpdate)) != $tmpdate) {
66
+        system_failure('Das Aktivierungs-Datum scheint ungültig zu sein.');
67
+      } else {
68
+        $valid_from_date = strtotime($tmpdate);
69
+      }
70
+    }
63 71
   }
64
-  if (isset($_POST['ar_valid_from']) && ($_POST['ar_valid_from'] == 'now' || $valid_from_date < time())) {
72
+  if ($valid_from_date < time()) {
65 73
     $valid_from_date = time();
74
+    warning('Das Aktivierungs-Datum liegt in der Vergangenheit. Die Funktion wird ab sofort aktiviert.');
75
+  }
76
+  if ($valid_from_date > time() + 365*24*60*60) {
77
+    warning('Das Aktivierungs-Datum liegt mehr als ein Jahr in der Zukunft. Bitte prüfen Sie ob Sie das korrekte Jahr gewählt haben.');
78
+  }
79
+  if (isset($_POST['ar_valid_until']) && ($_POST['ar_valid_until'] == 'infinity')) {
80
+    $valid_until_date = NULL;
81
+  } else {
82
+    if (isset($_POST['ar_valid_until_day']) && isset($_POST['ar_valid_until_month']) && isset($_POST['ar_valid_until_year'])) {
83
+      $tmpdate = $_POST['ar_valid_until_year'].'-'.$_POST['ar_valid_until_month'].'-'.$_POST['ar_valid_until_day'];
84
+      if (date('Y-n-j', strtotime($tmpdate)) != $tmpdate) {
85
+        system_failure('Das Deaktivierungs-Datum scheint ungültig zu sein.');
86
+      } else {
87
+        $valid_until_date = strtotime($tmpdate);
88
+      }
89
+    }
66 90
   }
67
-  $ar['valid_from'] = date('Y-m-d', $valid_from_date);
68
-  $ar['valid_until'] = date('Y-m-d', $valid_until_date);
69 91
   if (!isset($_POST['autoresponder']) || $_POST['autoresponder'] != 'yes') {
92
+    $valid_from_date = NULL;
93
+  }
94
+  if ($valid_until_date && $valid_until_date < time()) {
95
+    warning('Das Deaktivierungs-Datum liegt in der Vergangenheit, eine automatische Deaktivierung wird nicht stattfinden.');
96
+    $valid_until_date = NULL;
97
+  }
98
+  if ($valid_from_date) {
99
+    $ar['valid_from'] = date('Y-m-d', $valid_from_date);
100
+  } else {
70 101
     $ar['valid_from'] = NULL;
71 102
   }
72
-  if (isset($_POST['ar_valid_until']) && ($_POST['ar_valid_until'] == 'infinity' || $valid_until_date < time())) {
103
+  if ($valid_until_date) {
104
+    $ar['valid_until'] = date('Y-m-d', $valid_until_date);
105
+  } else {
73 106
     $ar['valid_until'] = NULL;
74 107
   }
75 108
 
... ...
@@ -121,12 +154,13 @@ if ($_GET['action'] == 'edit')
121 154
 
122 155
   save_vmail_account($account);
123 156
 
124
-  if (! ($debugmode || we_have_an_error()))
157
+  if (! ($debugmode || we_have_an_error())) {
125 158
     if ($accountlogin) {
126 159
       header('Location: ../index/index');
127 160
     } else {
128 161
       header('Location: vmail');
129 162
     }
163
+  }
130 164
 }
131 165
 elseif ($_GET['action'] == 'delete')
132 166
 {
Browse code

VMail-User können ihre Einstellungen selbst vornehmen und bekommen eine individuelle Startseite mit den Einstellungen.

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

bernd authored on29/02/2012 13:26:13
Showing1 changed files
... ...
@@ -4,7 +4,7 @@ require_once('session/start.php');
4 4
 
5 5
 require_once('vmail.php');
6 6
 
7
-require_role(ROLE_SYSTEMUSER);
7
+require_role(array(ROLE_SYSTEMUSER, ROLE_VMAIL_ACCOUNT));
8 8
 
9 9
 require_once("inc/debug.php");
10 10
 global $debugmode;
... ...
@@ -13,34 +13,43 @@ global $debugmode;
13 13
 if ($_GET['action'] == 'edit')
14 14
 {
15 15
   check_form_token('vmail_edit_mailbox');
16
-  $id = (int) $_GET['id'];
17
-
18
-  $account = empty_account();
19
-  $account['id'] = NULL;
20
-  if ($id)
21
-    $account['id'] = $id;
22
-  $account['local'] = $_POST['local'];
23
-  $account['domain'] = (int) $_POST['domain'];
24
-  $account['spamfilter'] = $_POST['spamfilter_action'];
25
-  $account['password'] = $_POST['password'];
26
-  if (($account['password'] == '') && ($_POST['mailbox'] == 'yes'))
27
-    system_failure("Sie haben ein leeres Passwort eingegeben!");
28
-  if ($_POST['password'] == '**********')
29
-    $account['password'] = '';
30
-  if ($_POST['mailbox'] != 'yes')
31
-  {
32
-    $account['password'] = NULL;
33
-    $account['spamfilter'] = 'none';
34
-  }
35
-  if (isset($_POST['quota'])) {
36
-    $account['quota'] = $_POST['quota'];
37
-  }
16
+  $accountlogin = ($_SESSION['role'] == ROLE_VMAIL_ACCOUNT);
17
+
18
+  if ($accountlogin) {
19
+    $id = get_vmail_id_by_emailaddr($_SESSION['mailaccount']);
20
+    $account = get_account_details($id, false);
21
+    // Leere das, sonst werden die vervielfacht
22
+    $account['forwards'] = array();
23
+  } else {
24
+    $id = (int) $_GET['id'];
25
+  
26
+    $account = empty_account();
27
+    $account['id'] = NULL;
28
+    if ($id)
29
+      $account['id'] = $id;
30
+    $account['local'] = $_POST['local'];
31
+    $account['domain'] = (int) $_POST['domain'];
32
+    $account['password'] = $_POST['password'];
33
+    if (($account['password'] == '') && ($_POST['mailbox'] == 'yes'))
34
+      system_failure("Sie haben ein leeres Passwort eingegeben!");
35
+    if ($_POST['password'] == '**********')
36
+      $account['password'] = '';
37
+    if ($_POST['mailbox'] != 'yes')
38
+    {
39
+      $account['password'] = NULL;
40
+      $account['spamfilter'] = 'none';
41
+    }
42
+    if (isset($_POST['quota'])) {
43
+      $account['quota'] = $_POST['quota'];
44
+    }
45
+  
46
+    $account['quota_threshold'] = -1;
47
+    if (isset($_POST['quota_notify']) && isset($_POST['quota_threshold']) && $_POST['quota_notify'] == 1) {
48
+      $account['quota_threshold'] = $_POST['quota_threshold'];
49
+    }
38 50
 
39
-  $account['quota_threshold'] = -1;
40
-  if (isset($_POST['quota_notify']) && isset($_POST['quota_threshold']) && $_POST['quota_notify'] == 1) {
41
-    $account['quota_threshold'] = $_POST['quota_threshold'];
42 51
   }
43
-
52
+  $account['spamfilter'] = $_POST['spamfilter_action'];
44 53
 
45 54
 
46 55
   $ar = empty_autoresponder_config();
... ...
@@ -113,7 +122,11 @@ if ($_GET['action'] == 'edit')
113 122
   save_vmail_account($account);
114 123
 
115 124
   if (! ($debugmode || we_have_an_error()))
116
-    header('Location: vmail');
125
+    if ($accountlogin) {
126
+      header('Location: ../index/index');
127
+    } else {
128
+      header('Location: vmail');
129
+    }
117 130
 }
118 131
 elseif ($_GET['action'] == 'delete')
119 132
 {
Browse code

Konfiguration des Autoresponders

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

bernd authored on25/02/2012 15:16:45
Showing1 changed files
... ...
@@ -41,6 +41,54 @@ if ($_GET['action'] == 'edit')
41 41
     $account['quota_threshold'] = $_POST['quota_threshold'];
42 42
   }
43 43
 
44
+
45
+
46
+  $ar = empty_autoresponder_config();
47
+  $valid_from_date = time();
48
+  $valid_until_date = NULL;
49
+  if (isset($_POST['ar_valid_from_day']) && isset($_POST['ar_valid_from_month']) && isset($_POST['ar_valid_from_year'])) {
50
+    $valid_from_date = strtotime($_POST['ar_valid_from_year'].'-'.$_POST['ar_valid_from_month'].'-'.$_POST['ar_valid_from_day']);
51
+  }
52
+  if (isset($_POST['ar_valid_until_day']) && isset($_POST['ar_valid_until_month']) && isset($_POST['ar_valid_until_year'])) {
53
+    $valid_until_date = strtotime($_POST['ar_valid_until_year'].'-'.$_POST['ar_valid_until_month'].'-'.$_POST['ar_valid_until_day']);
54
+  }
55
+  if (isset($_POST['ar_valid_from']) && ($_POST['ar_valid_from'] == 'now' || $valid_from_date < time())) {
56
+    $valid_from_date = time();
57
+  }
58
+  $ar['valid_from'] = date('Y-m-d', $valid_from_date);
59
+  $ar['valid_until'] = date('Y-m-d', $valid_until_date);
60
+  if (!isset($_POST['autoresponder']) || $_POST['autoresponder'] != 'yes') {
61
+    $ar['valid_from'] = NULL;
62
+  }
63
+  if (isset($_POST['ar_valid_until']) && ($_POST['ar_valid_until'] == 'infinity' || $valid_until_date < time())) {
64
+    $ar['valid_until'] = NULL;
65
+  }
66
+
67
+  if (isset($_POST['ar_subject']) && $_POST['ar_subject'] == 'custom' && isset($_POST['ar_subject_value']) && chop($_POST['ar_subject_value']) != '') {
68
+    $ar['subject'] = filter_input_general( chop($_POST['ar_subject_value']) );
69
+  }
70
+
71
+  if (isset($_POST['ar_message'])) {
72
+    $ar['message'] = filter_input_general( $_POST['ar_message'] );
73
+  }
74
+
75
+  if (isset($_POST['ar_quote'])) {
76
+    if ($_POST['ar_quote'] == 'inline') {
77
+      $ar['quote'] = 'inline';
78
+    }
79
+    if ($_POST['ar_quote'] == 'attach') {
80
+      $ar['quote'] = 'attach';
81
+    }
82
+  }
83
+
84
+  if (isset($_POST['ar_from']) && $_POST['ar_from'] == 'custom' && isset($_POST['ar_fromname'])) {
85
+    $ar['fromname'] = filter_input_general( $_POST['ar_fromname']);
86
+  }
87
+    
88
+  $account['autoresponder'] = $ar;
89
+
90
+
91
+
44 92
   if (isset($_POST['forward']) && $_POST['forward'] == 'yes')
45 93
   {
46 94
     $num = 1;
Browse code

Quota-Threshold für Notification einstellbar

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

bernd authored on17/07/2011 13:28:37
Showing1 changed files
... ...
@@ -36,6 +36,11 @@ if ($_GET['action'] == 'edit')
36 36
     $account['quota'] = $_POST['quota'];
37 37
   }
38 38
 
39
+  $account['quota_threshold'] = -1;
40
+  if (isset($_POST['quota_notify']) && isset($_POST['quota_threshold']) && $_POST['quota_notify'] == 1) {
41
+    $account['quota_threshold'] = $_POST['quota_threshold'];
42
+  }
43
+
39 44
   if (isset($_POST['forward']) && $_POST['forward'] == 'yes')
40 45
   {
41 46
     $num = 1;
Browse code

VMail-Quota-Zeug

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

bernd authored on20/06/2011 17:46:18
Showing1 changed files
... ...
@@ -36,7 +36,7 @@ if ($_GET['action'] == 'edit')
36 36
     $account['quota'] = $_POST['quota'];
37 37
   }
38 38
 
39
-  if ($_POST['forward'] == 'yes')
39
+  if (isset($_POST['forward']) && $_POST['forward'] == 'yes')
40 40
   {
41 41
     $num = 1;
42 42
     while (true)
... ...
@@ -52,7 +52,7 @@ if ($_GET['action'] == 'edit')
52 52
     if ($num == 1) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
53 53
   }
54 54
 
55
-  if (($_POST['forward']!='yes') && ($_POST['mailbox']!='yes'))
55
+  if ((isset($_POST['forward']) && $_POST['forward']!='yes') && ($_POST['mailbox']!='yes'))
56 56
     system_failure("Entweder eine Mailbox oder eine Weiterleitung muss angegeben werden!");
57 57
 
58 58
   DEBUG($account);
Browse code

Mailaccount-Quota auch bei den System-Usern berücksichtigen

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

bernd authored on22/04/2011 13:25:18
Showing1 changed files
... ...
@@ -32,6 +32,9 @@ if ($_GET['action'] == 'edit')
32 32
     $account['password'] = NULL;
33 33
     $account['spamfilter'] = 'none';
34 34
   }
35
+  if (isset($_POST['quota'])) {
36
+    $account['quota'] = $_POST['quota'];
37
+  }
35 38
 
36 39
   if ($_POST['forward'] == 'yes')
37 40
   {
Browse code

Filtere Leerzeichen am Anfang und Ende der E-Mail-Adresse einer Weiterleitung

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

bernd authored on11/08/2010 07:12:54
Showing1 changed files
... ...
@@ -42,7 +42,7 @@ if ($_GET['action'] == 'edit')
42 42
         break;
43 43
       if ($_POST['forward_to_'.$num] == '')
44 44
         break;
45
-      $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => $_POST['forward_to_'.$num]);
45
+      $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => chop($_POST['forward_to_'.$num]));
46 46
       array_push($account['forwards'], $fwd);
47 47
       $num++;
48 48
     }
Browse code

* alle internen Links sinnvoll (und gleichartig!) encoden * Automatischer Upgrader für Drupal funktioniert jetzt

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

bernd authored on07/03/2009 14:48:53
Showing1 changed files
... ...
@@ -78,7 +78,7 @@ elseif ($_GET['action'] == 'delete')
78 78
   $sure = user_is_sure();
79 79
   if ($sure === NULL)
80 80
   {
81
-    are_you_sure("action=delete&amp;id={$account['id']}", "Möchten Sie die E-Mail-Adresse »{$account_string}« wirklich löschen?");
81
+    are_you_sure("action=delete&id={$account['id']}", "Möchten Sie die E-Mail-Adresse »{$account_string}« wirklich löschen?");
82 82
   }
83 83
   elseif ($sure === true)
84 84
   {
Browse code

eliminate .php extensions for URLs

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

bernd authored on08/08/2008 19:32:32
Showing1 changed files
... ...
@@ -57,7 +57,7 @@ if ($_GET['action'] == 'edit')
57 57
   save_vmail_account($account);
58 58
 
59 59
   if (! ($debugmode || we_have_an_error()))
60
-    header('Location: vmail.php');
60
+    header('Location: vmail');
61 61
 }
62 62
 elseif ($_GET['action'] == 'delete')
63 63
 {
... ...
@@ -84,12 +84,12 @@ elseif ($_GET['action'] == 'delete')
84 84
   {
85 85
     delete_account($account['id']);
86 86
     if (! $debugmode)
87
-      header("Location: vmail.php");
87
+      header("Location: vmail");
88 88
   }
89 89
   elseif ($sure === false)
90 90
   {
91 91
     if (! $debugmode)
92
-      header("Location: vmail.php");
92
+      header("Location: vmail");
93 93
   }
94 94
 
95 95
 }
Browse code

Großer VMail-move

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

bernd authored on03/04/2008 10:38:22
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,102 @@
1
+<?php
2
+
3
+require_once('session/start.php');
4
+
5
+require_once('vmail.php');
6
+
7
+require_role(ROLE_SYSTEMUSER);
8
+
9
+require_once("inc/debug.php");
10
+global $debugmode;
11
+
12
+
13
+if ($_GET['action'] == 'edit')
14
+{
15
+  check_form_token('vmail_edit_mailbox');
16
+  $id = (int) $_GET['id'];
17
+
18
+  $account = empty_account();
19
+  $account['id'] = NULL;
20
+  if ($id)
21
+    $account['id'] = $id;
22
+  $account['local'] = $_POST['local'];
23
+  $account['domain'] = (int) $_POST['domain'];
24
+  $account['spamfilter'] = $_POST['spamfilter_action'];
25
+  $account['password'] = $_POST['password'];
26
+  if (($account['password'] == '') && ($_POST['mailbox'] == 'yes'))
27
+    system_failure("Sie haben ein leeres Passwort eingegeben!");
28
+  if ($_POST['password'] == '**********')
29
+    $account['password'] = '';
30
+  if ($_POST['mailbox'] != 'yes')
31
+  {
32
+    $account['password'] = NULL;
33
+    $account['spamfilter'] = 'none';
34
+  }
35
+
36
+  if ($_POST['forward'] == 'yes')
37
+  {
38
+    $num = 1;
39
+    while (true)
40
+    {
41
+      if (! isset($_POST['forward_to_'.$num]))
42
+        break;
43
+      if ($_POST['forward_to_'.$num] == '')
44
+        break;
45
+      $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => $_POST['forward_to_'.$num]);
46
+      array_push($account['forwards'], $fwd);
47
+      $num++;
48
+    }
49
+    if ($num == 1) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
50
+  }
51
+
52
+  if (($_POST['forward']!='yes') && ($_POST['mailbox']!='yes'))
53
+    system_failure("Entweder eine Mailbox oder eine Weiterleitung muss angegeben werden!");
54
+
55
+  DEBUG($account);
56
+
57
+  save_vmail_account($account);
58
+
59
+  if (! ($debugmode || we_have_an_error()))
60
+    header('Location: vmail.php');
61
+}
62
+elseif ($_GET['action'] == 'delete')
63
+{
64
+  $title = "E-mail-Adresse löschen";
65
+  $section = 'vmail_vmail';
66
+
67
+  $account = get_account_details( (int) $_GET['id'] );
68
+
69
+  $domain = NULL;
70
+  $domains = get_vmail_domains();
71
+  foreach ($domains as $dom)
72
+    if ($dom->id == $account['domain'])
73
+    {
74
+      $domain = $dom->domainname;
75
+      break;
76
+    }
77
+  $account_string = $account['local'] . "@" . $domain;
78
+  $sure = user_is_sure();
79
+  if ($sure === NULL)
80
+  {
81
+    are_you_sure("action=delete&amp;id={$account['id']}", "Möchten Sie die E-Mail-Adresse »{$account_string}« wirklich löschen?");
82
+  }
83
+  elseif ($sure === true)
84
+  {
85
+    delete_account($account['id']);
86
+    if (! $debugmode)
87
+      header("Location: vmail.php");
88
+  }
89
+  elseif ($sure === false)
90
+  {
91
+    if (! $debugmode)
92
+      header("Location: vmail.php");
93
+  }
94
+
95
+}
96
+else
97
+  system_failure("Unimplemented action");
98
+
99
+output('');
100
+
101
+
102
+?>