Project

General

Profile

1 1241 Luisehahne
<?php
2 1255 Luisehahne
/*
3 1241 Luisehahne
*
4 1255 Luisehahne
*                       About WebsiteBaker
5 1241 Luisehahne
*
6
* Website Baker is a PHP-based Content Management System (CMS)
7
* designed with one goal in mind: to enable its users to produce websites
8
* with ease.
9
*
10 1255 Luisehahne
*                       LICENSE INFORMATION
11 1241 Luisehahne
*
12
* WebsiteBaker is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public License
14
* as published by the Free Software Foundation; either version 2
15
* of the License, or (at your option) any later version.
16
*
17
* WebsiteBaker is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
* See the GNU General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
*
26
*                   WebsiteBaker Extra Information
27
*
28
*
29 1255 Luisehahne
*/
30 1241 Luisehahne
/**
31
 *
32 1255 Luisehahne
 * @category        admin
33
 * @package         settings
34
 * @author          Ryan Djurovich
35
 * @copyright       2004-2009, Ryan Djurovich
36
 * @copyright       2009-2010, Website Baker Org. e.V.
37
 * @filesource		$HeadURL$
38
 * @author          Ryan Djurovich
39
 * @copyright       2004-2009, Ryan Djurovich
40 1241 Luisehahne
 *
41 1255 Luisehahne
 * @author          WebsiteBaker Project
42
 * @link			http://www.websitebaker2.org/
43
 * @copyright       2009-2010, Website Baker Org. e.V.
44
 * @link			http://start.websitebaker2.org/impressum-datenschutz.php
45
 * @license         http://www.gnu.org/licenses/gpl.html
46
 * @version         $Id$
47
 * @platform        WebsiteBaker 2.8.x
48
 * @requirements    PHP 4.3.4 and higher
49
 * @lastmodified    $Date$
50
 *
51 1241 Luisehahne
 */
52
53
require('../../config.php');
54
require_once(WB_PATH.'/framework/class.admin.php');
55
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
56
	$admin = new admin('Settings', 'settings_advanced');
57
} else {
58
	$admin = new admin('Settings', 'settings_basic');
59
}
60
61
// Include the WB functions file
62
require_once(WB_PATH.'/framework/functions.php');
63
require_once(WB_PATH.'/framework/functions-utf8.php');
64
65
// Create new template object
66
$template = new Template(THEME_PATH.'/templates');
67
$template->set_file('page', 'settings.htt');
68
$template->set_block('page', 'main_block', 'main');
69
70
// Query current settings in the db, then loop through them and print them
71
$query = "SELECT * FROM ".TABLE_PREFIX."settings";
72
$results = $database->query($query);
73
while($setting = $results->fetchRow())
74
{
75
	$setting_name = $setting['name'];
76
	$setting_value = ( $setting_name != 'wbmailer_smtp_password' ) ? htmlspecialchars($setting['value']) : $setting['value'];
77
	$template->set_var(strtoupper($setting_name),$setting_value);
78
}
79
80
// Query current settings in the db, then loop through them and print them
81
$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
82
$results = $database->query($query);
83
while($setting = $results->fetchRow()) {
84
	$setting_name = $setting['name'];
85
	$setting_value = htmlspecialchars(($setting['value']));
86
	switch($setting_name) {
87
		// Search header
88
		case 'header':
89
			$template->set_var('SEARCH_HEADER', $setting_value);
90
		break;
91
		// Search results header
92
		case 'results_header':
93
			$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
94
		break;
95
		// Search results loop
96
		case 'results_loop':
97
			$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
98
		break;
99
		// Search results footer
100
		case 'results_footer':
101
			$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
102
		break;
103
		// Search no results
104
		case 'no_results':
105
			$template->set_var('SEARCH_NO_RESULTS', $setting_value);
106
		break;
107
		// Search footer
108
		case 'footer':
109
			$template->set_var('SEARCH_FOOTER', $setting_value);
110
		break;
111
		// Search module-order
112
		case 'module_order':
113
			$template->set_var('SEARCH_MODULE_ORDER', $setting_value);
114
		break;
115
		// Search max lines of excerpt
116
		case 'max_excerpt':
117
			$template->set_var('SEARCH_MAX_EXCERPT', $setting_value);
118
		break;
119
		// time-limit
120
		case 'time_limit':
121
			$template->set_var('SEARCH_TIME_LIMIT', $setting_value);
122
		break;
123
		// Search template
124
		case 'template':
125
			$search_template = $setting_value;
126
		break;
127
	}
128
}
129
130
// Do the same for settings stored in config file as with ones in db
131
$database_type = '';
132
133
// Tell the browser whether or not to show advanced options
134
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
135
	$template->set_var('DISPLAY_ADVANCED', '');
136
	$template->set_var('ADVANCED', 'yes');
137
	$template->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$TEXT['HIDE_ADVANCED']);
138
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
139
	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
140
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
141
} else {
142
	$template->set_var('DISPLAY_ADVANCED', ' style="display: none;"');
143
	$template->set_var('ADVANCED', 'no');
144
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' &gt;&gt;');
145
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
146
	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
147
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
148
}
149
150
$template->set_var(array(
151
									'PAGES_DIRECTORY' => PAGES_DIRECTORY,
152
									'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
153
									'PAGE_EXTENSION' => PAGE_EXTENSION,
154
									'PAGE_SPACER' => PAGE_SPACER,
155
									'WB_PATH' => WB_PATH,
156
									'WB_URL' => WB_URL,
157
									'THEME_URL' => THEME_URL,
158
									'ADMIN_PATH' => ADMIN_PATH,
159
									'ADMIN_URL' => ADMIN_URL,
160
									'DATABASE_TYPE' => DB_TYPE,
161
									'DATABASE_HOST' => DB_HOST,
162
									'DATABASE_USERNAME' => DB_USERNAME,
163
									'DATABASE_NAME' => DB_NAME,
164
									'TABLE_PREFIX' => TABLE_PREFIX
165
								 )
166
						 );
167
168
// Insert language values
169
$template->set_block('main_block', 'language_list_block', 'language_list');
170
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name");
171
if($result->numRows() > 0) {
172
	while($addon = $result->fetchRow()) {
173
		$l_codes[$addon['name']] = $addon['directory'];
174
		$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
175
	}
176
	asort($l_names);
177
	foreach($l_names as $l_name=>$v) {
178
		// Insert code and name
179
		$template->set_var(array(
180
								'CODE' => $l_codes[$l_name],
181
								'NAME' => $l_name,
182
								'FLAG' => THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]),
183
								));
184
		// Check if it is selected
185
		if(DEFAULT_LANGUAGE == $l_codes[$l_name]) {
186
			$template->set_var('SELECTED', ' selected="selected"');
187
		} else {
188
			$template->set_var('SELECTED', '');
189
		}
190
		$template->parse('language_list', 'language_list_block', true);
191
	}
192
}
193
194
// Insert default timezone values
195
require(ADMIN_PATH.'/interface/timezones.php');
196
$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
197
foreach($TIMEZONES AS $hour_offset => $title) {
198
	// Make sure we dont list "System Default" as we are setting this value!
199
	if($hour_offset != '-20') {
200
		$template->set_var('VALUE', $hour_offset);
201
		$template->set_var('NAME', $title);
202
		if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
203
			$template->set_var('SELECTED', ' selected="selected"');
204
		} else {
205
			$template->set_var('SELECTED', '');
206
		}
207
		$template->parse('timezone_list', 'timezone_list_block', true);
208
	}
209
}
210
211
// Insert default charset values
212
require(ADMIN_PATH.'/interface/charsets.php');
213
$template->set_block('main_block', 'charset_list_block', 'charset_list');
214
foreach($CHARSETS AS $code => $title) {
215
	$template->set_var('VALUE', $code);
216
	$template->set_var('NAME', $title);
217
	if(DEFAULT_CHARSET == $code) {
218
		$template->set_var('SELECTED', ' selected="selected"');
219
	} else {
220
		$template->set_var('SELECTED', '');
221
	}
222
	$template->parse('charset_list', 'charset_list_block', true);
223
}
224
225
// Insert date format list
226
require(ADMIN_PATH.'/interface/date_formats.php');
227
$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
228
foreach($DATE_FORMATS AS $format => $title) {
229
	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
230
	if($format != 'system_default') {
231
		$template->set_var('VALUE', $format);
232
	} else {
233
		$template->set_var('VALUE', '');
234
	}
235
	$template->set_var('NAME', $title);
236
	if(DEFAULT_DATE_FORMAT == $format) {
237
		$template->set_var('SELECTED', ' selected="selected"');
238
	} else {
239
		$template->set_var('SELECTED', '');
240
	}
241
	$template->parse('date_format_list', 'date_format_list_block', true);
242
}
243
244
// Insert time format list
245
require(ADMIN_PATH.'/interface/time_formats.php');
246
$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
247
foreach($TIME_FORMATS AS $format => $title) {
248
	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
249
	if($format != 'system_default') {
250
		$template->set_var('VALUE', $format);
251
	} else {
252
		$template->set_var('VALUE', '');
253
	}
254
	$template->set_var('NAME', $title);
255
	if(DEFAULT_TIME_FORMAT == $format) {
256
		$template->set_var('SELECTED', ' selected="selected"');
257
	} else {
258
		$template->set_var('SELECTED', '');
259
	}
260
	$template->parse('time_format_list', 'time_format_list_block', true);
261
}
262
263
// Insert templates
264
$template->set_block('main_block', 'template_list_block', 'template_list');
265
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function != 'theme' order by name");
266
if($result->numRows() > 0) {
267
	while($addon = $result->fetchRow()) {
268
		$template->set_var('FILE', $addon['directory']);
269
		$template->set_var('NAME', $addon['name']);
270
		if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected="selected"' : $selected = '');
271
		$template->set_var('SELECTED', $selected);
272
		$template->parse('template_list', 'template_list_block', true);
273
	}
274
}
275
276
// Insert backend theme
277
$template->set_block('main_block', 'theme_list_block', 'theme_list');
278
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'theme' order by name");
279
if($result->numRows() > 0) {
280
	while($addon = $result->fetchRow()) {
281
		$template->set_var('FILE', $addon['directory']);
282
		$template->set_var('NAME', $addon['name']);
283
		if(($addon['directory'] == DEFAULT_THEME) ? $selected = ' selected="selected"' : $selected = '');
284
		$template->set_var('SELECTED', $selected);
285
		$template->parse('theme_list', 'theme_list_block', true);
286
	}
287
}
288
289
// Insert WYSIWYG modules
290
$template->set_block('main_block', 'editor_list_block', 'editor_list');
291 1260 Luisehahne
$file='none';
292 1241 Luisehahne
$module_name=$TEXT['NONE'];
293
$template->set_var('FILE', $file);
294
$template->set_var('NAME', $module_name);
295
if((!defined('WYSIWYG_EDITOR') OR $file == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
296
$template->set_var('SELECTED', $selected);
297
$template->parse('editor_list', 'editor_list_block', true);
298
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg'");
299 1255 Luisehahne
if($result->numRows() > 0)
300
{
301
	while($addon = $result->fetchRow())
302
    {
303 1241 Luisehahne
		$template->set_var('FILE', $addon['directory']);
304
		$template->set_var('NAME', $addon['name']);
305
		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
306
		$template->set_var('SELECTED', $selected);
307
		$template->parse('editor_list', 'editor_list_block', true);
308
	}
309
}
310
311
// Insert templates for search settings
312
$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
313
314 1255 Luisehahne
$search_template = ( ($search_template == DEFAULT_TEMPLATE) OR ($search_template == '') ) ? '' : $search_template;
315
316
$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
317
318 1241 Luisehahne
$template->set_var(array(
319 1255 Luisehahne
        'FILE' => '',
320 1241 Luisehahne
        'NAME' => $TEXT['SYSTEM_DEFAULT'],
321
        'SELECTED' => $selected
322
    ));
323
324
$template->parse('search_template_list', 'search_template_list_block', true);
325
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'template' order by name");
326
327
if($result->numRows() > 0)
328
{
329
	while($addon = $result->fetchRow())
330
    {
331
		$template->set_var('FILE', $addon['directory']);
332
		$template->set_var('NAME', $addon['name']);
333 1255 Luisehahne
        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
334
		$template->set_var('SELECTED', $selected);
335 1241 Luisehahne
336
		$template->parse('search_template_list', 'search_template_list_block', true);
337
	}
338
}
339
340
// Insert default error reporting values
341
require(ADMIN_PATH.'/interface/er_levels.php');
342
$template->set_block('main_block', 'error_reporting_list_block', 'error_reporting_list');
343 1260 Luisehahne
foreach($ER_LEVELS AS $value => $title)
344
{
345 1241 Luisehahne
	$template->set_var('VALUE', $value);
346
	$template->set_var('NAME', $title);
347 1255 Luisehahne
    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
348
    $template->set_var('SELECTED', $selected);
349
350 1241 Luisehahne
	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
351
}
352
353
// Insert permissions values
354 1260 Luisehahne
if($admin->get_permission('settings_advanced') != true)
355
{
356 1241 Luisehahne
	$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
357
}
358
359
// Insert page level limits
360
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
361 1255 Luisehahne
for($i = 1; $i <= 10; $i++)
362
{
363 1241 Luisehahne
	$template->set_var('NUMBER', $i);
364 1255 Luisehahne
	if(PAGE_LEVEL_LIMIT == $i)
365
    {
366 1241 Luisehahne
		$template->set_var('SELECTED', ' selected="selected"');
367
	} else {
368
		$template->set_var('SELECTED', '');
369
	}
370
	$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
371
}
372
373
// Work-out if multiple menus feature is enabled
374 1260 Luisehahne
if(defined('MULTIPLE_MENUS') AND MULTIPLE_MENUS == true)
375
{
376 1241 Luisehahne
	$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked="checked"');
377
} else {
378
	$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked="checked"');
379
}
380
381
// Work-out if page languages feature is enabled
382 1260 Luisehahne
if(defined('PAGE_LANGUAGES') AND PAGE_LANGUAGES == true)
383
{
384 1241 Luisehahne
        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked="checked"');
385
} else {
386
        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
387
}
388
389
// Work-out if smart login feature is enabled
390 1260 Luisehahne
if(defined('SMART_LOGIN') AND SMART_LOGIN == true)
391
{
392 1241 Luisehahne
	$template->set_var('SMART_LOGIN_ENABLED', ' checked="checked"');
393
} else {
394
	$template->set_var('SMART_LOGIN_DISABLED', ' checked="checked"');
395
}
396
397 1260 Luisehahne
/* Make's sure GD library is installed */
398
if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg'))
399
{
400 1241 Luisehahne
	$template->set_var('GD_EXTENSION_ENABLED', '');
401
} else {
402 1260 Luisehahne
	$template->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
403 1241 Luisehahne
}
404
405
// Work-out if section blocks feature is enabled
406 1260 Luisehahne
if(defined('SECTION_BLOCKS') AND SECTION_BLOCKS == true)
407
{
408 1241 Luisehahne
	$template->set_var('SECTION_BLOCKS_ENABLED', ' checked="checked"');
409
} else {
410
	$template->set_var('SECTION_BLOCKS_DISABLED', ' checked="checked"');
411
}
412
413
// Work-out if homepage redirection feature is enabled
414 1260 Luisehahne
if(defined('HOMEPAGE_REDIRECTION') AND HOMEPAGE_REDIRECTION == true)
415
{
416 1241 Luisehahne
	$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked="checked"');
417
} else {
418
	$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked="checked"');
419
}
420
421
// Work-out which server os should be checked
422 1260 Luisehahne
if(OPERATING_SYSTEM == 'linux')
423
{
424 1241 Luisehahne
	$template->set_var('LINUX_SELECTED', ' checked="checked"');
425
} elseif(OPERATING_SYSTEM == 'windows') {
426
	$template->set_var('WINDOWS_SELECTED', ' checked="checked"');
427
}
428
429
// Work-out if manage sections feature is enabled
430 1260 Luisehahne
if(MANAGE_SECTIONS)
431
{
432 1241 Luisehahne
	$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked="checked"');
433
} else {
434
	$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked="checked"');
435
}
436
437
// Work-out which wbmailer routine should be checked
438 1260 Luisehahne
if(WBMAILER_ROUTINE == 'phpmail')
439
{
440 1241 Luisehahne
	$template->set_var('PHPMAIL_SELECTED', ' checked="checked"');
441 1260 Luisehahne
	$template->set_var('SMTP_VISIBILITY', ' style="display: none;"');
442
	$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
443
} elseif(WBMAILER_ROUTINE == 'smtp')
444
{
445 1241 Luisehahne
	$template->set_var('SMTPMAIL_SELECTED', ' checked="checked"');
446
	$template->set_var('SMTP_VISIBILITY', '');
447
}
448
449
// Work-out if SMTP authentification should be checked
450 1260 Luisehahne
if(WBMAILER_SMTP_AUTH)
451
{
452 1241 Luisehahne
	$template->set_var('SMTP_AUTH_SELECTED', ' checked="checked"');
453 1260 Luisehahne
	if(WBMAILER_ROUTINE == 'smtp')
454
    {
455 1241 Luisehahne
		$template->set_var('SMTP_VISIBILITY_AUTH', '');
456
	} else {
457 1260 Luisehahne
		$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
458 1241 Luisehahne
	}
459
} else {
460 1260 Luisehahne
	$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
461 1241 Luisehahne
}
462
463
// Work-out if intro feature is enabled
464 1260 Luisehahne
if(INTRO_PAGE)
465
{
466 1241 Luisehahne
	$template->set_var('INTRO_PAGE_ENABLED', ' checked="checked"');
467
} else {
468
	$template->set_var('INTRO_PAGE_DISABLED', ' checked="checked"');
469
}
470
471
// Work-out if frontend login feature is enabled
472 1260 Luisehahne
if(FRONTEND_LOGIN)
473
{
474 1241 Luisehahne
	$template->set_var('PRIVATE_ENABLED', ' checked="checked"');
475
} else {
476
	$template->set_var('PRIVATE_DISABLED', ' checked="checked"');
477
}
478
479
// Work-out if page trash feature is disabled, in-line, or separate
480 1260 Luisehahne
if(PAGE_TRASH == 'disabled')
481
{
482 1241 Luisehahne
	$template->set_var('PAGE_TRASH_DISABLED', ' checked="checked"');
483 1260 Luisehahne
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
484
} elseif(PAGE_TRASH == 'inline')
485
{
486 1241 Luisehahne
	$template->set_var('PAGE_TRASH_INLINE', ' checked="checked"');
487 1260 Luisehahne
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
488
} elseif(PAGE_TRASH == 'separate')
489
{
490 1241 Luisehahne
	$template->set_var('PAGE_TRASH_SEPARATE', ' checked="checked"');
491 1260 Luisehahne
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
492 1241 Luisehahne
}
493
494
// Work-out if media home folde feature is enabled
495 1260 Luisehahne
if(HOME_FOLDERS)
496
{
497 1241 Luisehahne
	$template->set_var('HOME_FOLDERS_ENABLED', ' checked="checked"');
498
} else {
499
	$template->set_var('HOME_FOLDERS_DISABLED', ' checked="checked"');
500
}
501
502
// Insert search select
503 1260 Luisehahne
if(SEARCH == 'private')
504
{
505 1241 Luisehahne
	$template->set_var('PRIVATE_SEARCH', ' selected="selected"');
506
} elseif(SEARCH == 'registered') {
507
	$template->set_var('REGISTERED_SEARCH', ' selected="selected"');
508
} elseif(SEARCH == 'none') {
509
	$template->set_var('NONE_SEARCH', ' selected="selected"');
510
}
511
512
// Work-out if 777 permissions are set
513 1260 Luisehahne
if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
514
{
515 1241 Luisehahne
	$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked="checked"');
516
}
517
518
// Work-out which file mode boxes are checked
519 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
520
{
521 1241 Luisehahne
	$template->set_var('FILE_U_R_CHECKED', ' checked="checked"');
522
}
523 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
524
{
525 1241 Luisehahne
	$template->set_var('FILE_U_W_CHECKED', ' checked="checked"');
526
}
527 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
528
{
529 1241 Luisehahne
	$template->set_var('FILE_U_E_CHECKED', ' checked="checked"');
530
}
531 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
532
{
533 1241 Luisehahne
	$template->set_var('FILE_G_R_CHECKED', ' checked="checked"');
534
}
535 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
536
{
537 1241 Luisehahne
	$template->set_var('FILE_G_W_CHECKED', ' checked="checked"');
538
}
539 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
540
{
541 1241 Luisehahne
	$template->set_var('FILE_G_E_CHECKED', ' checked="checked"');
542
}
543 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
544
{
545 1241 Luisehahne
	$template->set_var('FILE_O_R_CHECKED', ' checked="checked"');
546
}
547 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
548
{
549 1241 Luisehahne
	$template->set_var('FILE_O_W_CHECKED', ' checked="checked"');
550
}
551 1260 Luisehahne
if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
552
{
553 1241 Luisehahne
	$template->set_var('FILE_O_E_CHECKED', ' checked="checked"');
554
}
555
// Work-out which dir mode boxes are checked
556 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
557
{
558 1241 Luisehahne
	$template->set_var('DIR_U_R_CHECKED', ' checked="checked"');
559
}
560 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
561
{
562 1241 Luisehahne
	$template->set_var('DIR_U_W_CHECKED', ' checked="checked"');
563
}
564 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
565
{
566 1241 Luisehahne
	$template->set_var('DIR_U_E_CHECKED', ' checked="checked"');
567
}
568 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
569
{
570 1241 Luisehahne
	$template->set_var('DIR_G_R_CHECKED', ' checked="checked"');
571
}
572 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
573
{
574 1241 Luisehahne
	$template->set_var('DIR_G_W_CHECKED', ' checked="checked"');
575
}
576 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
577
{
578 1241 Luisehahne
	$template->set_var('DIR_G_E_CHECKED', ' checked="checked"');
579
}
580 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
581
{
582 1241 Luisehahne
	$template->set_var('DIR_O_R_CHECKED', ' checked="checked"');
583
}
584 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
585
{
586 1241 Luisehahne
	$template->set_var('DIR_O_W_CHECKED', ' checked="checked"');
587
}
588 1260 Luisehahne
if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
589
{
590 1241 Luisehahne
	$template->set_var('DIR_O_E_CHECKED', ' checked="checked"');
591
}
592
593
// Insert Server Email value into template
594
$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
595
596
// Insert groups into signup list
597
$template->set_block('main_block', 'group_list_block', 'group_list');
598
$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
599 1260 Luisehahne
if($results->numRows() > 0)
600
{
601
	while($group = $results->fetchRow())
602
    {
603 1241 Luisehahne
		$template->set_var('ID', $group['group_id']);
604
		$template->set_var('NAME', $group['name']);
605 1260 Luisehahne
		if(FRONTEND_SIGNUP == $group['group_id'])
606
        {
607 1241 Luisehahne
			$template->set_var('SELECTED', ' selected="selected"');
608
		} else {
609
			$template->set_var('SELECTED', '');
610
		}
611
		$template->parse('group_list', 'group_list_block', true);
612
	}
613
} else {
614
	$template->set_var('ID', 'disabled');
615
	$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
616
	$template->parse('group_list', 'group_list_block', true);
617
}
618
619
// Insert language headings
620
$template->set_var(array(
621
								'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
622
								'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
623
								'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
624
								'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
625
								'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
626
								'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
627
								)
628
						);
629
// Insert language text and messages
630
$template->set_var(array(
631
								'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
632
								'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
633
								'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
634
								'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
635
								'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
636
								'TEXT_HEADER' => $TEXT['HEADER'],
637
								'TEXT_FOOTER' => $TEXT['FOOTER'],
638
								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
639
								'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
640
								'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
641
								'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
642
								'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
643
								'TEXT_TEXT' => $TEXT['TEXT'],
644
								'TEXT_DEFAULT' => $TEXT['DEFAULT'],
645
								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
646
								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
647
								'TEXT_CHARSET' => $TEXT['CHARSET'],
648
								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
649
								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
650
								'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
651
								'TEXT_THEME' => $TEXT['THEME'],
652
								'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
653
								'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
654
								'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
655
								'TEXT_FRONTEND' => $TEXT['FRONTEND'],
656
								'TEXT_LOGIN' => $TEXT['LOGIN'],
657
								'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
658
								'TEXT_SIGNUP' => $TEXT['SIGNUP'],
659
								'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
660
								'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
661
								'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
662
								'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
663
								'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
664
								'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
665
								'TEXT_APP_NAME' => $TEXT['APP_NAME'],
666
								'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
667
								'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
668
								'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
669
								'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
670
								'TEXT_WINDOWS' => $TEXT['WINDOWS'],
671
								'TEXT_ADMIN' => $TEXT['ADMIN'],
672
								'TEXT_TYPE' => $TEXT['TYPE'],
673
								'TEXT_DATABASE' => $TEXT['DATABASE'],
674
								'TEXT_HOST' => $TEXT['HOST'],
675
								'TEXT_USERNAME' => $TEXT['USERNAME'],
676
								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
677
								'TEXT_NAME' => $TEXT['NAME'],
678
								'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
679
								'TEXT_SAVE' => $TEXT['SAVE'],
680
								'TEXT_RESET' => $TEXT['RESET'],
681
								'TEXT_CHANGES' => $TEXT['CHANGES'],
682
								'TEXT_ENABLED' => $TEXT['ENABLED'],
683
								'TEXT_DISABLED' => $TEXT['DISABLED'],
684
								'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
685
								'TEXT_MANAGE' => $TEXT['MANAGE'],
686
								'TEXT_SEARCH' => $TEXT['SEARCH'],
687
								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
688
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
689
								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
690
								'TEXT_NONE' => $TEXT['NONE'],
691
								'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
692
								'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
693
								'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
694
								'TEXT_USER' => $TEXT['USER'],
695
								'TEXT_GROUP' => $TEXT['GROUP'],
696
								'TEXT_OTHERS' => $TEXT['OTHERS'],
697
								'TEXT_READ' => $TEXT['READ'],
698
								'TEXT_WRITE' => $TEXT['WRITE'],
699
								'TEXT_EXECUTE' => $TEXT['EXECUTE'],
700
								'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
701
								'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
702
								'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
703
								'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
704
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
705
								'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
706
								'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
707
								'TEXT_INLINE' => $TEXT['INLINE'],
708
								'TEXT_SEPARATE' => $TEXT['SEPARATE'],
709
								'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
710
								'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
711
								'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
712
								'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
713
								'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
714
								'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
715
								'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
716
								'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
717
								'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
718
								'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
719
								'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
720
								'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
721
								'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['WBMAILER_SMTP_AUTH_NOTICE'],
722
								'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
723
								'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
724
								'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
725
								'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'],
726
								'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
727
								'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
728
								'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT']
729
								)
730
						);
731
732
// Parse template objects output
733
$template->parse('main', 'main_block', false);
734
$template->pparse('output', 'page');
735
736
$admin->print_footer();
737
738 1260 Luisehahne
?>