5 Jappix - An open social platform
6 This is the hosts configuration POST handler (install & manager)
8 -------------------------------------------------
12 Last revision: 27/05/11
16 // Someone is trying to hack us?
17 if(!defined('JAPPIX_BASE'))
21 if(isset($_POST['host_main']) && !empty($_POST['host_main']))
22 $host_main = stripslashes(htmlspecialchars($_POST['host_main']));
24 $host_main = stripslashes(htmlspecialchars($hosts_default['main']));
27 if(isset($_POST['host_muc']) && !empty($_POST['host_muc']))
28 $host_muc = stripslashes(htmlspecialchars($_POST['host_muc']));
30 $host_muc = stripslashes(htmlspecialchars($hosts_default['muc']));
33 if(isset($_POST['host_pubsub']) && !empty($_POST['host_pubsub']))
34 $host_pubsub = stripslashes(htmlspecialchars($_POST['host_pubsub']));
36 $host_pubsub = stripslashes(htmlspecialchars($hosts_default['pubsub']));
39 if(isset($_POST['host_vjud']) && !empty($_POST['host_vjud']))
40 $host_vjud = stripslashes(htmlspecialchars($_POST['host_vjud']));
42 $host_vjud = stripslashes(htmlspecialchars($hosts_default['vjud']));
45 if(isset($_POST['host_anonymous']) && !empty($_POST['host_anonymous']))
46 $host_anonymous = stripslashes(htmlspecialchars($_POST['host_anonymous']));
48 $host_anonymous = stripslashes(htmlspecialchars($hosts_default['anonymous']));
51 if(isset($_POST['host_bosh']) && !empty($_POST['host_bosh']))
52 $host_bosh = stripslashes(htmlspecialchars($_POST['host_bosh']));
54 $host_bosh = stripslashes(htmlspecialchars($hosts_default['bosh']));
57 if(isset($_POST['host_bosh_main']) && !empty($_POST['host_bosh_main']))
58 $host_bosh_main = stripslashes(htmlspecialchars($_POST['host_bosh_main']));
60 $host_bosh_main = stripslashes(htmlspecialchars($hosts_default['bosh_main']));
63 if(isset($_POST['host_bosh_mini']) && !empty($_POST['host_bosh_mini']))
64 $host_bosh_mini = stripslashes(htmlspecialchars($_POST['host_bosh_mini']));
66 $host_bosh_mini = stripslashes(htmlspecialchars($hosts_default['bosh_mini']));
69 if(isset($_POST['host_static']) && !empty($_POST['host_static']))
70 $host_static = stripslashes(htmlspecialchars($_POST['host_static']));
72 $host_static = stripslashes(htmlspecialchars($hosts_default['static']));
75 if(isset($_POST['host_upload']) && !empty($_POST['host_upload']))
76 $host_upload = stripslashes(htmlspecialchars($_POST['host_upload']));
78 $host_upload = stripslashes(htmlspecialchars($hosts_default['upload']));
80 // Generate the hosts XML content
82 '<main>'.$host_main.'</main>
83 <muc>'.$host_muc.'</muc>
84 <pubsub>'.$host_pubsub.'</pubsub>
85 <vjud>'.$host_vjud.'</vjud>
86 <anonymous>'.$host_anonymous.'</anonymous>
87 <bosh>'.$host_bosh.'</bosh>
88 <bosh_main>'.$host_bosh_main.'</bosh_main>
89 <bosh_mini>'.$host_bosh_mini.'</bosh_mini>
90 <static>'.$host_static.'</static>
91 <upload>'.$host_upload.'</upload>'
94 // Write the main configuration
95 writeXML('conf', 'hosts', $hosts_xml);