1d3fc4d1dec25890043701794f3ebce6adabaecd
bernd Großer VMail-move

bernd authored 16 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

10) 
11) 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.
12) */
bernd Großer VMail-move

bernd authored 16 years ago

13) 
14) require_once('session/start.php');
15) require_once('vmail.php');
16) 
17) require_once("inc/debug.php");
18) global $debugmode;
19) 
20) require_role(ROLE_SYSTEMUSER);
21) 
22) check_form_token('vmail_domainchange');
23) 
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

24) $newsetting = [];
25) $newdkimsetting = [];
Bernd Wurst Redesign der Domain-Mail-Ve...

Bernd Wurst authored 9 years ago

26) foreach ($_POST as $key => $value) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

27)     if (strpos($key, "option-") === 0) {
28)         $id = substr($key, 7);
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

29)         $newsetting[$id] = 'virtual';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

30)         if ($value == 'manual') {
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

31)             $newsetting[$id] = 'auto';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

32)         } elseif ($value == 'off') {
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

33)             $newsetting[$id] = 'none';
34)         }
35)     }
36)     if (strpos($key, "nomail-") === 0) {
37)         $id = substr($key, 7);
38)         if ($value == 'nomail' && (!isset($newsetting[$id]) || $newsetting[$id] == 'none')) {
39)             $newsetting[$id] = 'nomail';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

40)         }
Bernd Wurst Redesign der Domain-Mail-Ve...

Bernd Wurst authored 9 years ago

41)     }
Bernd Wurst DKIM-Auswahl eingebaut

Bernd Wurst authored 11 months ago

42)     if (strpos($key, "dkim-") === 0) {
43)         $id = substr($key, 5);
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

44)         $newdkimsetting[$id] = 'none';
Bernd Wurst DKIM-Auswahl eingebaut

Bernd Wurst authored 11 months ago

45)         if ($value == 'dkim') {
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

46)             $newdkimsetting[$id] = 'dkim';
Bernd Wurst DKIM-Auswahl eingebaut

Bernd Wurst authored 11 months ago

47)         } elseif ($value == 'dmarc') {
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

48)             $newdkimsetting[$id] = 'dmarc';
Bernd Wurst DKIM-Auswahl eingebaut

Bernd Wurst authored 11 months ago

49)         }
50)     }
Bernd Wurst Redesign der Domain-Mail-Ve...

Bernd Wurst authored 9 years ago

51) }
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

52) foreach ($newsetting as $id => $type) {
Bernd Wurst DKIM+DMARC per default eins...

Bernd Wurst authored 4 weeks ago

53)     $old = domainsettings($id);
54)     DEBUG('MAILCONFIG change request for id #' . $id . ' from ' . $old['type'] . ' to ' . $type);
Bernd Wurst coding style

Bernd Wurst authored 5 months ago

55)     change_domain($id, $type);
Bernd Wurst DKIM+DMARC per default eins...

Bernd Wurst authored 4 weeks ago

56)     if (($old['type'] == 'none' || $old['type'] == 'nomail') && ($type == 'auto' || $type == 'virtual')) {
57)         // Default wenn man Mail-Verwendung einschaltet
58)         $newdkimsetting[$id] = 'dmarc';
59)     }
Bernd Wurst coding style

Bernd Wurst authored 5 months ago

60)     if ($type == "nomail" || $type == "none") {
61)         // DKIM muss abgeschaltet sein, wenn das DKIM-UI nicht mehr angezeigt wird
62)         $newdkimsetting[$id] = 'none';
63)     }
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

64) }
65) foreach ($newdkimsetting as $id => $type) {
Bernd Wurst coding style

Bernd Wurst authored 5 months ago

66)     DEBUG('DKIM change request for id #' . $id . ' to ' . $type);
67)     change_domain_dkim($id, $type);
Bernd Wurst Bugfix für nomail-Option un...

Bernd Wurst authored 5 months ago

68) }
bernd Großer VMail-move

bernd authored 16 years ago

69) 
70) if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

71)     header('Location: domains');
72)     die();