5 Jappix - An open social platform
6 This is the main configuration POST handler (install & manager)
8 -------------------------------------------------
12 Last revision: 26/08/11
16 // Someone is trying to hack us?
17 if(!defined('JAPPIX_BASE'))
21 if(isset($_POST['service_name']) && !empty($_POST['service_name']))
22 $service_name = stripslashes(htmlspecialchars($_POST['service_name']));
24 $service_name = stripslashes(htmlspecialchars($main_default['name']));
26 // Service description
27 if(isset($_POST['service_desc']) && !empty($_POST['service_desc']))
28 $service_desc = stripslashes(htmlspecialchars($_POST['service_desc']));
30 $service_desc = stripslashes(htmlspecialchars($main_default['desc']));
33 if(isset($_POST['jappix_resource']) && !empty($_POST['jappix_resource']))
34 $jappix_resource = stripslashes(htmlspecialchars($_POST['jappix_resource']));
36 $jappix_resource = stripslashes(htmlspecialchars($main_default['resource']));
39 if(isset($_POST['lock_host']) && !empty($_POST['lock_host']))
45 if(isset($_POST['anonymous_mode']) && !empty($_POST['anonymous_mode']))
46 $anonymous_mode = 'on';
48 $anonymous_mode = 'off';
51 if(isset($_POST['registration']) && !empty($_POST['registration']))
54 $registration = 'off';
57 if(isset($_POST['bosh_proxy']) && !empty($_POST['bosh_proxy']))
63 if(isset($_POST['manager_link']) && !empty($_POST['manager_link']))
66 $manager_link = 'off';
69 if(isset($_POST['groupchats_join']) && !empty($_POST['groupchats_join']))
70 $groupchats_join = stripslashes(htmlspecialchars(trim($_POST['groupchats_join'])));
72 $groupchats_join = stripslashes(htmlspecialchars($main_default['groupchats_join']));
75 if(isset($_POST['encryption']) && !empty($_POST['encryption']))
81 if(isset($_POST['https_storage']) && !empty($_POST['https_storage']))
82 $https_storage = 'on';
84 $https_storage = 'off';
87 if(isset($_POST['https_force']) && !empty($_POST['https_force']))
93 if(isset($_POST['compression']) && !empty($_POST['compression']))
99 if(isset($_POST['multi_files']) && ($_POST['multi_files'] == 'on'))
102 $multi_files = 'off';
105 if(isset($_POST['developer']) && ($_POST['developer'] == 'on'))
110 // Generate the configuration XML content
112 '<name>'.$service_name.'</name>
113 <desc>'.$service_desc.'</desc>
114 <resource>'.$jappix_resource.'</resource>
115 <lock>'.$lock_host.'</lock>
116 <anonymous>'.$anonymous_mode.'</anonymous>
117 <registration>'.$registration.'</registration>
118 <bosh_proxy>'.$bosh_proxy.'</bosh_proxy>
119 <manager_link>'.$manager_link.'</manager_link>
120 <groupchats_join>'.$groupchats_join.'</groupchats_join>
121 <encryption>'.$encryption.'</encryption>
122 <https_storage>'.$https_storage.'</https_storage>
123 <https_force>'.$https_force.'</https_force>
124 <compression>'.$compression.'</compression>
125 <multi_files>'.$multi_files.'</multi_files>
126 <developer>'.$developer.'</developer>'
129 // Write the main configuration
130 writeXML('conf', 'main', $conf_xml);