838077f18b71321a685c84329342e6a711d22d09
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) 
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) */
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'])) {
26) 
27)   $aliaswww = (bool) ( (int) $_GET['aliaswww'] );
28) 
29)   $alias = get_alias_details($_GET['alias']);
30)   DEBUG($alias);
31)   $old_options = explode(',', $alias['options']);
32)   $new_options = array();
33)   foreach ($old_options AS $op)
34)   {
35)     if ($op != 'aliaswww')
36)       array_push($new_options, $op);
37)   }
38)   if ($aliaswww)
39)     array_push($new_options, 'aliaswww');
40)   
41)   DEBUG($old_options);
42)   DEBUG($new_options);
43)   $alias['options'] = implode(',', $new_options);
44)   DEBUG('New options: '.$options);
45) 
46)   $alias['domainid'] = $alias['domain_id'];
47)   save_alias($alias);
48) 
49)   if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

50)     header('Location: aliases?vhost='.$alias['vhost']);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

51) }
52) if (isset($_GET['forward'])) {
53) 
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)
61)   {
62)     if ($op != 'forward')
63)       array_push($new_options, $op);
64)   }
65)   if ($forward)
66)     array_push($new_options, 'forward');
67)   
68)   DEBUG($old_options);
69)   DEBUG($new_options);
70)   $alias['options'] = implode(',', $new_options);
71)   DEBUG('New options: '.$options);
72) 
73)   $alias['domainid'] = $alias['domain_id'];
74)   save_alias($alias);
75) 
76)   if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

77)     header('Location: aliases?vhost='.$alias['vhost']);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

78) }
79) 
80) 
81)