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