Project

General

Profile

1
<?php
2
/*
3
*
4
*                       About WebsiteBaker
5
*
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
*                       LICENSE INFORMATION
11
*
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
*/
30
/**
31
 *
32
 * @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: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/settings/index.php $
38
 * @author          Ryan Djurovich
39
 * @copyright       2004-2009, Ryan Djurovich
40
 *
41
 * @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: index.php 1255 2010-01-21 01:14:59Z Luisehahne $
47
 * @platform        WebsiteBaker 2.8.x
48
 * @requirements    PHP 4.3.4 and higher
49
 * @lastmodified    $Date: 2010-01-21 02:14:59 +0100 (Thu, 21 Jan 2010) $
50
 *
51
 */
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
$file='none';  
292
$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
if($result->numRows() > 0)
300
{
301
	while($addon = $result->fetchRow())
302
    {
303
		$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
$search_template = ( ($search_template == DEFAULT_TEMPLATE) OR ($search_template == '') ) ? '' : $search_template;
315

    
316
$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
317

    
318
$template->set_var(array(
319
        'FILE' => '',
320
        '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
        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
334
		$template->set_var('SELECTED', $selected);
335

    
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
foreach($ER_LEVELS AS $value => $title) {
344
	$template->set_var('VALUE', $value);
345
	$template->set_var('NAME', $title);
346
    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
347
    $template->set_var('SELECTED', $selected);
348

    
349
	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
350
}
351

    
352
// Insert permissions values
353
if($admin->get_permission('settings_advanced') != true) {
354
	$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
355
}
356

    
357
// Insert page level limits
358
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
359
for($i = 1; $i <= 10; $i++)
360
{
361
	$template->set_var('NUMBER', $i);
362
	if(PAGE_LEVEL_LIMIT == $i)
363
    {
364
		$template->set_var('SELECTED', ' selected="selected"');
365
	} else {
366
		$template->set_var('SELECTED', '');
367
	}
368
	$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
369
}
370

    
371
// Work-out if multiple menus feature is enabled
372
if(defined('MULTIPLE_MENUS') AND MULTIPLE_MENUS == true) {
373
	$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked="checked"');
374
} else {
375
	$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked="checked"');
376
}
377

    
378
// Work-out if page languages feature is enabled
379
if(defined('PAGE_LANGUAGES') AND PAGE_LANGUAGES == true) {
380
        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked="checked"');
381
} else {
382
        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
383
}
384

    
385
// Work-out if smart login feature is enabled
386
if(defined('SMART_LOGIN') AND SMART_LOGIN == true) {
387
	$template->set_var('SMART_LOGIN_ENABLED', ' checked="checked"');
388
} else {
389
	$template->set_var('SMART_LOGIN_DISABLED', ' checked="checked"');
390
}
391

    
392
if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */
393
	$template->set_var('GD_EXTENSION_ENABLED', '');
394
} else {
395
	$template->set_var('GD_EXTENSION_ENABLED', 'none');
396
}
397

    
398
// Work-out if section blocks feature is enabled
399
if(defined('SECTION_BLOCKS') AND SECTION_BLOCKS == true) {
400
	$template->set_var('SECTION_BLOCKS_ENABLED', ' checked="checked"');
401
} else {
402
	$template->set_var('SECTION_BLOCKS_DISABLED', ' checked="checked"');
403
}
404

    
405
// Work-out if homepage redirection feature is enabled
406
if(defined('HOMEPAGE_REDIRECTION') AND HOMEPAGE_REDIRECTION == true) {
407
	$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked="checked"');
408
} else {
409
	$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked="checked"');
410
}
411

    
412
// Work-out which server os should be checked
413
if(OPERATING_SYSTEM == 'linux') {
414
	$template->set_var('LINUX_SELECTED', ' checked="checked"');
415
} elseif(OPERATING_SYSTEM == 'windows') {
416
	$template->set_var('WINDOWS_SELECTED', ' checked="checked"');
417
}
418

    
419
// Work-out if manage sections feature is enabled
420
if(MANAGE_SECTIONS) {
421
	$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked="checked"');
422
} else {
423
	$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked="checked"');
424
}
425

    
426
// Work-out which wbmailer routine should be checked
427
if(WBMAILER_ROUTINE == 'phpmail') {
428
	$template->set_var('PHPMAIL_SELECTED', ' checked="checked"');
429
	$template->set_var('SMTP_VISIBILITY', 'none');
430
	$template->set_var('SMTP_VISIBILITY_AUTH', 'none');
431
} elseif(WBMAILER_ROUTINE == 'smtp') {
432
	$template->set_var('SMTPMAIL_SELECTED', ' checked="checked"');
433
	$template->set_var('SMTP_VISIBILITY', '');
434
}
435

    
436
// Work-out if SMTP authentification should be checked
437
if(WBMAILER_SMTP_AUTH) {
438
	$template->set_var('SMTP_AUTH_SELECTED', ' checked="checked"');
439
	if(WBMAILER_ROUTINE == 'smtp') {
440
		$template->set_var('SMTP_VISIBILITY_AUTH', '');
441
	} else {
442
		$template->set_var('SMTP_VISIBILITY_AUTH', 'none');
443
	}
444
} else {
445
	$template->set_var('SMTP_VISIBILITY_AUTH', 'none');
446
}
447

    
448
// Work-out if intro feature is enabled
449
if(INTRO_PAGE) {
450
	$template->set_var('INTRO_PAGE_ENABLED', ' checked="checked"');
451
} else {
452
	$template->set_var('INTRO_PAGE_DISABLED', ' checked="checked"');
453
}
454

    
455
// Work-out if frontend login feature is enabled
456
if(FRONTEND_LOGIN) {
457
	$template->set_var('PRIVATE_ENABLED', ' checked="checked"');
458
} else {
459
	$template->set_var('PRIVATE_DISABLED', ' checked="checked"');
460
}
461

    
462
// Work-out if page trash feature is disabled, in-line, or separate
463
if(PAGE_TRASH == 'disabled') {
464
	$template->set_var('PAGE_TRASH_DISABLED', ' checked="checked"');
465
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: none;');
466
} elseif(PAGE_TRASH == 'inline') {
467
	$template->set_var('PAGE_TRASH_INLINE', ' checked="checked"');
468
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: none;');
469
} elseif(PAGE_TRASH == 'separate') {
470
	$template->set_var('PAGE_TRASH_SEPARATE', ' checked="checked"');
471
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: inline;');
472
}
473

    
474
// Work-out if media home folde feature is enabled
475
if(HOME_FOLDERS) {
476
	$template->set_var('HOME_FOLDERS_ENABLED', ' checked="checked"');
477
} else {
478
	$template->set_var('HOME_FOLDERS_DISABLED', ' checked="checked"');
479
}
480

    
481
// Insert search select
482
if(SEARCH == 'private') {
483
	$template->set_var('PRIVATE_SEARCH', ' selected="selected"');
484
} elseif(SEARCH == 'registered') {
485
	$template->set_var('REGISTERED_SEARCH', ' selected="selected"');
486
} elseif(SEARCH == 'none') {
487
	$template->set_var('NONE_SEARCH', ' selected="selected"');
488
}
489

    
490
// Work-out if 777 permissions are set
491
if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777') {
492
	$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked="checked"');
493
}
494

    
495
// Work-out which file mode boxes are checked
496
if(extract_permission(STRING_FILE_MODE, 'u', 'r')) {
497
	$template->set_var('FILE_U_R_CHECKED', ' checked="checked"');
498
}
499
if(extract_permission(STRING_FILE_MODE, 'u', 'w')) {
500
	$template->set_var('FILE_U_W_CHECKED', ' checked="checked"');
501
}
502
if(extract_permission(STRING_FILE_MODE, 'u', 'e')) {
503
	$template->set_var('FILE_U_E_CHECKED', ' checked="checked"');
504
}
505
if(extract_permission(STRING_FILE_MODE, 'g', 'r')) {
506
	$template->set_var('FILE_G_R_CHECKED', ' checked="checked"');
507
}
508
if(extract_permission(STRING_FILE_MODE, 'g', 'w')) {
509
	$template->set_var('FILE_G_W_CHECKED', ' checked="checked"');
510
}
511
if(extract_permission(STRING_FILE_MODE, 'g', 'e')) {
512
	$template->set_var('FILE_G_E_CHECKED', ' checked="checked"');
513
}
514
if(extract_permission(STRING_FILE_MODE, 'o', 'r')) {
515
	$template->set_var('FILE_O_R_CHECKED', ' checked="checked"');
516
}
517
if(extract_permission(STRING_FILE_MODE, 'o', 'w')) {
518
	$template->set_var('FILE_O_W_CHECKED', ' checked="checked"');
519
}
520
if(extract_permission(STRING_FILE_MODE, 'o', 'e')) {
521
	$template->set_var('FILE_O_E_CHECKED', ' checked="checked"');
522
}
523
// Work-out which dir mode boxes are checked
524
if(extract_permission(STRING_DIR_MODE, 'u', 'r')) {
525
	$template->set_var('DIR_U_R_CHECKED', ' checked="checked"');
526
}
527
if(extract_permission(STRING_DIR_MODE, 'u', 'w')) {
528
	$template->set_var('DIR_U_W_CHECKED', ' checked="checked"');
529
}
530
if(extract_permission(STRING_DIR_MODE, 'u', 'e')) {
531
	$template->set_var('DIR_U_E_CHECKED', ' checked="checked"');
532
}
533
if(extract_permission(STRING_DIR_MODE, 'g', 'r')) {
534
	$template->set_var('DIR_G_R_CHECKED', ' checked="checked"');
535
}
536
if(extract_permission(STRING_DIR_MODE, 'g', 'w')) {
537
	$template->set_var('DIR_G_W_CHECKED', ' checked="checked"');
538
}
539
if(extract_permission(STRING_DIR_MODE, 'g', 'e')) {
540
	$template->set_var('DIR_G_E_CHECKED', ' checked="checked"');
541
}
542
if(extract_permission(STRING_DIR_MODE, 'o', 'r')) {
543
	$template->set_var('DIR_O_R_CHECKED', ' checked="checked"');
544
}
545
if(extract_permission(STRING_DIR_MODE, 'o', 'w')) {
546
	$template->set_var('DIR_O_W_CHECKED', ' checked="checked"');
547
}
548
if(extract_permission(STRING_DIR_MODE, 'o', 'e')) {
549
	$template->set_var('DIR_O_E_CHECKED', ' checked="checked"');
550
}
551

    
552
// Insert Server Email value into template
553
$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
554

    
555
// Insert groups into signup list
556
$template->set_block('main_block', 'group_list_block', 'group_list');
557
$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
558
if($results->numRows() > 0) {
559
	while($group = $results->fetchRow()) {
560
		$template->set_var('ID', $group['group_id']);
561
		$template->set_var('NAME', $group['name']);
562
		if(FRONTEND_SIGNUP == $group['group_id']) {
563
			$template->set_var('SELECTED', ' selected="selected"');
564
		} else {
565
			$template->set_var('SELECTED', '');
566
		}
567
		$template->parse('group_list', 'group_list_block', true);
568
	}
569
} else {
570
	$template->set_var('ID', 'disabled');
571
	$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
572
	$template->parse('group_list', 'group_list_block', true);
573
}
574

    
575
// Insert language headings
576
$template->set_var(array(
577
								'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
578
								'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
579
								'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
580
								'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
581
								'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
582
								'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
583
								)
584
						);
585
// Insert language text and messages
586
$template->set_var(array(
587
								'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
588
								'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
589
								'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
590
								'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
591
								'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
592
								'TEXT_HEADER' => $TEXT['HEADER'],
593
								'TEXT_FOOTER' => $TEXT['FOOTER'],
594
								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
595
								'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
596
								'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
597
								'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
598
								'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
599
								'TEXT_TEXT' => $TEXT['TEXT'],
600
								'TEXT_DEFAULT' => $TEXT['DEFAULT'],
601
								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
602
								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
603
								'TEXT_CHARSET' => $TEXT['CHARSET'],
604
								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
605
								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
606
								'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
607
								'TEXT_THEME' => $TEXT['THEME'],
608
								'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
609
								'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
610
								'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
611
								'TEXT_FRONTEND' => $TEXT['FRONTEND'],
612
								'TEXT_LOGIN' => $TEXT['LOGIN'],
613
								'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
614
								'TEXT_SIGNUP' => $TEXT['SIGNUP'],
615
								'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
616
								'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
617
								'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
618
								'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
619
								'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
620
								'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
621
								'TEXT_APP_NAME' => $TEXT['APP_NAME'],
622
								'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
623
								'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
624
								'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
625
								'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
626
								'TEXT_WINDOWS' => $TEXT['WINDOWS'],
627
								'TEXT_ADMIN' => $TEXT['ADMIN'],
628
								'TEXT_TYPE' => $TEXT['TYPE'],
629
								'TEXT_DATABASE' => $TEXT['DATABASE'],
630
								'TEXT_HOST' => $TEXT['HOST'],
631
								'TEXT_USERNAME' => $TEXT['USERNAME'],
632
								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
633
								'TEXT_NAME' => $TEXT['NAME'],
634
								'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
635
								'TEXT_SAVE' => $TEXT['SAVE'],
636
								'TEXT_RESET' => $TEXT['RESET'],
637
								'TEXT_CHANGES' => $TEXT['CHANGES'],
638
								'TEXT_ENABLED' => $TEXT['ENABLED'],
639
								'TEXT_DISABLED' => $TEXT['DISABLED'],
640
								'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
641
								'TEXT_MANAGE' => $TEXT['MANAGE'],
642
								'TEXT_SEARCH' => $TEXT['SEARCH'],
643
								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
644
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
645
								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
646
								'TEXT_NONE' => $TEXT['NONE'],
647
								'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
648
								'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
649
								'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
650
								'TEXT_USER' => $TEXT['USER'],
651
								'TEXT_GROUP' => $TEXT['GROUP'],
652
								'TEXT_OTHERS' => $TEXT['OTHERS'],
653
								'TEXT_READ' => $TEXT['READ'],
654
								'TEXT_WRITE' => $TEXT['WRITE'],
655
								'TEXT_EXECUTE' => $TEXT['EXECUTE'],
656
								'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
657
								'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
658
								'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
659
								'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
660
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
661
								'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
662
								'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
663
								'TEXT_INLINE' => $TEXT['INLINE'],
664
								'TEXT_SEPARATE' => $TEXT['SEPARATE'],
665
								'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
666
								'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
667
								'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
668
								'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
669
								'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
670
								'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
671
								'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
672
								'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
673
								'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
674
								'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
675
								'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
676
								'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
677
								'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['WBMAILER_SMTP_AUTH_NOTICE'],
678
								'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
679
								'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
680
								'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
681
								'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'],
682
								'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
683
								'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
684
								'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT']
685
								)
686
						);
687

    
688
// Parse template objects output
689
$template->parse('main', 'main_block', false);
690
$template->pparse('output', 'page');
691

    
692
$admin->print_footer();
693

    
694
?>
(1-1/3)