354c05a4ddd678c49bcbba458bffa7d13482139a
bernd Neue Dateien für Alias-Edit...

bernd authored 17 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 2 years 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 2 years 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 Neue Dateien für Alias-Edit...

bernd authored 17 years ago

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

Hanno authored 6 years ago

23)     $aliaswww = (bool) ((int) $_GET['aliaswww']);
24) 
25)     $alias = get_alias_details($_GET['alias']);
26)     DEBUG($alias);
27)     $old_options = explode(',', $alias['options']);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

28)     $new_options = [];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

29)     foreach ($old_options as $op) {
Bernd Wurst bugfix: Datenbankfehler bei...

Bernd Wurst authored 5 years ago

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

Hanno authored 6 years ago

31)             array_push($new_options, $op);
32)         }
33)     }
34)     if ($aliaswww) {
35)         array_push($new_options, 'aliaswww');
36)     }
Hanno remove whitespace in empty...

Hanno authored 6 years ago

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

Hanno authored 6 years ago

38)     DEBUG($old_options);
39)     DEBUG($new_options);
40)     $alias['options'] = implode(',', $new_options);
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

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

bernd authored 17 years ago

45) 
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

46)     if (!$debugmode) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

47)         header('Location: aliases?vhost=' . $alias['vhost']);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

48)     }
bernd Neue Dateien für Alias-Edit...

bernd authored 17 years ago

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

Hanno authored 6 years ago

51)     $forward = (bool) ((int) $_GET['forward']);
52) 
53)     $alias = get_alias_details($_GET['alias']);
54)     DEBUG($alias);
55)     $old_options = explode(',', $alias['options']);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

56)     $new_options = [];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

57)     foreach ($old_options as $op) {
Bernd Wurst bugfix: Datenbankfehler bei...

Bernd Wurst authored 5 years ago

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

Hanno authored 6 years ago

59)             array_push($new_options, $op);
60)         }
61)     }
62)     if ($forward) {
63)         array_push($new_options, 'forward');
64)     }
Hanno remove whitespace in empty...

Hanno authored 6 years ago

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

Hanno authored 6 years ago

66)     DEBUG($old_options);
67)     DEBUG($new_options);
68)     $alias['options'] = implode(',', $new_options);
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

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

bernd authored 17 years ago

73) 
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

74)     if (!$debugmode) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

75)         header('Location: aliases?vhost=' . $alias['vhost']);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

76)     }