2d13e1de11c39393e7e96d9bd6849cba27fc6645
bernd Neue Dateien für Alias-Edit...

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) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 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) 
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) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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) */
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

16) 
17) require_once('inc/base.php');
18) require_once('vhosts.php');
19) 
20) require_once('inc/debug.php');
21) global $debugmode;
22) 
23) check_form_token('aliases_toggle', $_GET['formtoken']);
24) 
25) if (isset($_GET['aliaswww'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

26)     $aliaswww = (bool) ((int) $_GET['aliaswww']);
27) 
28)     $alias = get_alias_details($_GET['alias']);
29)     DEBUG($alias);
30)     $old_options = explode(',', $alias['options']);
31)     $new_options = array();
32)     foreach ($old_options as $op) {
Bernd Wurst bugfix: Datenbankfehler bei...

Bernd Wurst authored 4 years ago

33)         if ($op !== '' && $op != 'aliaswww') {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

34)             array_push($new_options, $op);
35)         }
36)     }
37)     if ($aliaswww) {
38)         array_push($new_options, 'aliaswww');
39)     }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

40) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

41)     DEBUG($old_options);
42)     DEBUG($new_options);
43)     $alias['options'] = implode(',', $new_options);
Hanno avoid accessing nonexisting...

Hanno authored 5 years ago

44)     DEBUG('New options: '.$alias['options']);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

45) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

46)     $alias['domainid'] = $alias['domain_id'];
47)     save_alias($alias);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

48) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

49)     if (! $debugmode) {
50)         header('Location: aliases?vhost='.$alias['vhost']);
51)     }
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

52) }
53) if (isset($_GET['forward'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

54)     $forward = (bool) ((int) $_GET['forward']);
55) 
56)     $alias = get_alias_details($_GET['alias']);
57)     DEBUG($alias);
58)     $old_options = explode(',', $alias['options']);
59)     $new_options = array();
60)     foreach ($old_options as $op) {
Bernd Wurst bugfix: Datenbankfehler bei...

Bernd Wurst authored 4 years ago

61)         if ($op !== '' && $op != 'forward') {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

62)             array_push($new_options, $op);
63)         }
64)     }
65)     if ($forward) {
66)         array_push($new_options, 'forward');
67)     }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

68) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

69)     DEBUG($old_options);
70)     DEBUG($new_options);
71)     $alias['options'] = implode(',', $new_options);
Hanno another instance of accessi...

Hanno authored 5 years ago

72)     DEBUG('New options: '.$alias['options']);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

73) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

74)     $alias['domainid'] = $alias['domain_id'];
75)     save_alias($alias);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

76) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

77)     if (! $debugmode) {
78)         header('Location: aliases?vhost='.$alias['vhost']);
79)     }