]> git.mxchange.org Git - friendica-addons.git/blob - jappixmini/jappix/php/post-hosts.php
Twitter: Fetch the contact relation
[friendica-addons.git] / jappixmini / jappix / php / post-hosts.php
1 <?php
2
3 /*
4
5 Jappix - An open social platform
6 This is the hosts configuration POST handler (install & manager)
7
8 -------------------------------------------------
9
10 License: AGPL
11 Author: Vanaryon
12 Last revision: 27/05/11
13
14 */
15
16 // Someone is trying to hack us?
17 if(!defined('JAPPIX_BASE'))
18         exit;
19
20 // Main host
21 if(isset($_POST['host_main']) && !empty($_POST['host_main']))
22         $host_main = stripslashes(htmlspecialchars($_POST['host_main']));
23 else
24         $host_main = stripslashes(htmlspecialchars($hosts_default['main']));
25
26 // Groupchat host
27 if(isset($_POST['host_muc']) && !empty($_POST['host_muc']))
28         $host_muc = stripslashes(htmlspecialchars($_POST['host_muc']));
29 else
30         $host_muc = stripslashes(htmlspecialchars($hosts_default['muc']));
31
32 // Pubsub host
33 if(isset($_POST['host_pubsub']) && !empty($_POST['host_pubsub']))
34         $host_pubsub = stripslashes(htmlspecialchars($_POST['host_pubsub']));
35 else
36         $host_pubsub = stripslashes(htmlspecialchars($hosts_default['pubsub']));
37
38 // Directory host
39 if(isset($_POST['host_vjud']) && !empty($_POST['host_vjud']))
40         $host_vjud = stripslashes(htmlspecialchars($_POST['host_vjud']));
41 else
42         $host_vjud = stripslashes(htmlspecialchars($hosts_default['vjud']));
43
44 // Anonymous host
45 if(isset($_POST['host_anonymous']) && !empty($_POST['host_anonymous']))
46         $host_anonymous = stripslashes(htmlspecialchars($_POST['host_anonymous']));
47 else
48         $host_anonymous = stripslashes(htmlspecialchars($hosts_default['anonymous']));
49
50 // BOSH host
51 if(isset($_POST['host_bosh']) && !empty($_POST['host_bosh']))
52         $host_bosh = stripslashes(htmlspecialchars($_POST['host_bosh']));
53 else
54         $host_bosh = stripslashes(htmlspecialchars($hosts_default['bosh']));
55
56 // Main BOSH host
57 if(isset($_POST['host_bosh_main']) && !empty($_POST['host_bosh_main']))
58         $host_bosh_main = stripslashes(htmlspecialchars($_POST['host_bosh_main']));
59 else
60         $host_bosh_main = stripslashes(htmlspecialchars($hosts_default['bosh_main']));
61
62 // Mini BOSH host
63 if(isset($_POST['host_bosh_mini']) && !empty($_POST['host_bosh_mini']))
64         $host_bosh_mini = stripslashes(htmlspecialchars($_POST['host_bosh_mini']));
65 else
66         $host_bosh_mini = stripslashes(htmlspecialchars($hosts_default['bosh_mini']));
67
68 // Static host
69 if(isset($_POST['host_static']) && !empty($_POST['host_static']))
70         $host_static = stripslashes(htmlspecialchars($_POST['host_static']));
71 else
72         $host_static = stripslashes(htmlspecialchars($hosts_default['static']));
73
74 // Upload host
75 if(isset($_POST['host_upload']) && !empty($_POST['host_upload']))
76         $host_upload = stripslashes(htmlspecialchars($_POST['host_upload']));
77 else
78         $host_upload = stripslashes(htmlspecialchars($hosts_default['upload']));
79
80 // Generate the hosts XML content
81 $hosts_xml = 
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>'
92 ;
93
94 // Write the main configuration
95 writeXML('conf', 'hosts', $hosts_xml);