Revision 1767
Added by Dietmar about 12 years ago
save.php | ||
---|---|---|
24 | 24 |
// Print admin header |
25 | 25 |
require('../../config.php'); |
26 | 26 |
require_once(WB_PATH.'/framework/class.admin.php'); |
27 |
require_once(WB_PATH.'/framework/functions.php'); |
|
27 | 28 |
|
28 | 29 |
// suppress to print the header, so no new FTAN will be set |
29 | 30 |
if($advanced == '') |
... | ... | |
154 | 155 |
} |
155 | 156 |
|
156 | 157 |
$allow_tags_in_fields = array('website_header', 'website_footer','website_signature'); |
157 |
$allow_empty_values = array('website_header','website_footer','pages_directory','page_spacer','website_signature,page_icon_dir'); |
|
158 |
$allow_empty_values = array('website_header','website_footer','pages_directory','page_spacer','website_signature,page_icon_dir','modules_upgrade_list');
|
|
158 | 159 |
$disallow_in_fields = array('pages_directory', 'media_directory','wb_version'); |
159 | 160 |
|
161 |
$bRebuildAccessFiles = ( (isset( $_POST['rebuild_access_files']) && ( $_POST['rebuild_access_files'] == true )) ? true : false ) ; |
|
162 |
|
|
160 | 163 |
// Query current settings in the db, then loop through them and update the db with the new value |
161 | 164 |
$settings = array(); |
162 | 165 |
$old_settings = array(); |
... | ... | |
168 | 171 |
$passed = false; |
169 | 172 |
while($setting = $res_settings->fetchRow()) |
170 | 173 |
{ |
171 |
$old_settings[$setting['name']] = $setting['value']; |
|
172 | 174 |
$setting_name = $setting['name']; |
175 |
$old_settings[$setting_name] = $setting['value']; |
|
173 | 176 |
$value = $admin->get_post($setting_name); |
174 | 177 |
$value = isset($_POST[$setting_name]) ? $value : $old_settings[$setting_name] ; |
175 | 178 |
switch ($setting_name) { |
... | ... | |
184 | 187 |
case 'string_file_mode': |
185 | 188 |
$value=$file_mode; |
186 | 189 |
$passed = true; |
187 |
break; |
|
190 |
break;
|
|
188 | 191 |
case 'sec_anchor': |
189 | 192 |
$value=(($value=='') ? 'section_' : $value); |
190 | 193 |
$passed = true; |
194 |
break; |
|
191 | 195 |
case 'pages_directory': |
196 |
$bNewPageFile = ( ( $value!= $old_settings['pages_directory'] ) ? true : false ); |
|
197 |
$passed = $bNewPageFile; |
|
198 |
$sGetId = '&id='.$bNewPageFile; |
|
199 |
// if(!is_dir(WB_PATH.$value) && is_writable(WB_PATH)) { |
|
200 |
// $passed = make_dir(WB_PATH.$value); |
|
201 |
// } |
|
202 |
$value = (($passed == true) ? $value : $old_settings['pages_directory']); |
|
203 |
$sPageDirectory = $value; |
|
192 | 204 |
break; |
193 | 205 |
case 'wbmailer_smtp_auth': |
194 | 206 |
// $value = isset($_POST[$setting_name]) ? $_POST[$setting_name] : '' ; |
... | ... | |
200 | 212 |
break; |
201 | 213 |
} |
202 | 214 |
|
215 |
|
|
203 | 216 |
if (!in_array($setting_name, $allow_tags_in_fields)) |
204 | 217 |
{ |
205 | 218 |
$value = strip_tags($value); |
... | ... | |
212 | 225 |
$sql .= 'SET `value` = \''.$value.'\' '; |
213 | 226 |
$sql .= 'WHERE `name` != \'wb_version\' '; |
214 | 227 |
$sql .= 'AND `name` = \''.$setting_name.'\' '; |
215 |
|
|
216 | 228 |
if (!$database->query($sql)) |
217 | 229 |
{ |
218 | 230 |
if($database->is_error()) { |
... | ... | |
221 | 233 |
} |
222 | 234 |
} |
223 | 235 |
} |
236 |
|
|
237 |
if(($bRebuildAccessFiles==true) && ($_POST['modules_upgrade_list']!='') && ($sPageDirectory==$old_settings['pages_directory']) ) { |
|
238 |
rebuild_all_accessfiles(); |
|
239 |
$aModuleList = ( explode(',', $_POST['modules_upgrade_list'])); |
|
240 |
upgrade_modules($aModuleList); |
|
241 |
} |
|
242 |
|
|
224 | 243 |
} |
225 | 244 |
|
226 | 245 |
// Query current search settings in the db, then loop through them and update the db with the new value |
Also available in: Unified diff
! change page_extended to extended settings under page language