Project

General

Profile

« Previous | Next » 

Revision 1930

Added by darkviper over 11 years ago

implement class Password and activate it (not implemented for use yet)

View differences:

save.php
471 471

  
472 472
	require(ADMIN_PATH.'/interface/version.php');
473 473

  
474
	$settings_rows=	"INSERT INTO `".TABLE_PREFIX."settings` "
475
	." (setting_id, name, value) VALUES "
476
	." ( 1, 'wb_version', '".VERSION."'),"
477
	." ( 2, 'website_title', '$website_title'),"
478
	." ( 3, 'website_description', ''),"
479
	." ( 4, 'website_keywords', ''),"
480
	." ( 5, 'website_header', ''),"
481
	." ( 6, 'website_footer', ''),"
482
	." ( 7, 'wysiwyg_style', 'font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;'),"
483
	." ( 8, 'rename_files_on_upload', 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js,txt'),"
484
	." ( 9, 'er_level', '0'),"
485
	." (10, 'default_language', '$default_language'),"
486
	." (11, 'app_name', 'wb_$session_rand'),"
487
	." (12, 'sec_anchor', 'Sec'),"
488
	." (13, 'default_timezone', '$default_timezone'),"
489
	." (14, 'default_date_format', 'Y-m-d'),"
490
	." (15, 'default_time_format', 'h:i A'),"
491
	." (16, 'redirect_timer', '1500'),"
492
	." (17, 'home_folders', 'true'),"
493
	." (18, 'warn_page_leave', '1'),"
494
	." (19, 'default_template', 'round'),"
495
	." (20, 'default_theme', 'wb_theme'),"
496
	." (21, 'default_charset', 'utf-8'),"
497
	." (22, 'multiple_menus', 'true'),"
498
	." (23, 'page_level_limit', '6'),"
499
	." (24, 'intro_page', 'false'),"
500
	." (25, 'page_trash', 'inline'),"
501
	." (26, 'homepage_redirection', 'false'),"
502
	." (27, 'page_languages', 'true'),"
503
	." (28, 'wysiwyg_editor', 'fckeditor'),"
504
	." (29, 'manage_sections', 'true'),"
505
	." (30, 'section_blocks', 'false'),"
506
	." (31, 'smart_login', 'false'),"
507
	." (32, 'frontend_login', 'false'),"
508
	." (33, 'frontend_signup', 'false'),"
509
	." (34, 'search', 'public'),"
510
	." (35, 'page_extension', '.php'),"
511
	." (36, 'page_spacer', '-'),"
512
	." (37, 'pages_directory', '/pages'),"
513
	." (38, 'rename_files_on_upload', 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js,txt'),"
514
	." (39, 'media_directory', '/media'),"
515
	." (40, 'operating_system', '$operating_system'),"
516
	." (41, 'string_file_mode', '$file_mode'),"
517
	." (42, 'string_dir_mode', '$dir_mode'),"
518
	." (43, 'wbmailer_routine', 'phpmail'),"
519
	." (44, 'server_email', '$admin_email'),"
520
	." (45, 'wbmailer_default_sendername', 'WebsiteBaker Mailer'),"
521
	." (46, 'wbmailer_smtp_host', ''),"
522
	." (47, 'wbmailer_smtp_auth', ''),"
523
	." (48, 'wbmailer_smtp_username', ''),"
524
	." (49, 'wbmailer_smtp_password', ''),"
525
	." (50, 'fingerprint_with_ip_octets', '2'),"
526
	." (51, 'secure_form_module', ''),"
527
	." (52, 'mediasettings', ''),"
528
	." (53, 'wb_revision', '".REVISION."'),"
529
 	." (54, 'wb_sp', '".SP."'),"
530
	." (55, 'page_icon_dir', '/templates/*/title_images'),"
531
	." (56, 'dev_infos', 'false'),"
532
	." (57, 'groups_updated', '".time()."'),"
533
	." (58, 'wbmail_signature', ''),"
534
	." (59, 'confirmed_registration', '1'),"
535
	." (60, 'page_extendet', 'true'),"
536
	." (62, 'system_locked', '0')";
474
	$sql = 'INSERT INTO `'.TABLE_PREFIX.'settings` (`name`, `value`) VALUES '
475
	     . '(\'wb_version\', \''.VERSION.'\'), '
476
	     . '(\'website_title\', \''.$website_title.'\'), '
477
	     . '(\'website_description\', \'\'), '
478
	     . '(\'website_keywords\', \'\'), '
479
	     . '(\'website_header\', \'\'), '
480
	     . '(\'website_footer\', \'\'), '
481
	     . '(\'wysiwyg_style\', \'font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;\'), '
482
	     . '(\'rename_files_on_upload\', \'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js,txt\'), '
483
	     . '(\'er_level\', \'0\'), '
484
	     . '(\'default_language\', \''.$default_language.'\'), '
485
	     . '(\'app_name\', \'wb_'.$session_rand.'\'), '
486
	     . '(\'sec_anchor\', \'Sec\'), '
487
	     . '(\'default_timezone\', \''.$default_timezone.'\'), '
488
	     . '(\'default_date_format\', \'Y-m-d\'), '
489
	     . '(\'default_time_format\', \'h:i A\'), '
490
	     . '(\'redirect_timer\', \'1500\'), '
491
	     . '(\'home_folders\', \'true\'), '
492
	     . '(\'warn_page_leave\', \'1\'), '
493
	     . '(\'default_template\', \'round\'), '
494
	     . '(\'default_theme\', \'wb_theme\'), '
495
	     . '(\'default_charset\', \'utf-8\'), '
496
	     . '(\'multiple_menus\', \'true\'), '
497
	     . '(\'page_level_limit\', \'6\'), '
498
	     . '(\'intro_page\', \'false\'), '
499
	     . '(\'page_trash\', \'inline\'), '
500
	     . '(\'homepage_redirection\', \'false\'), '
501
	     . '(\'page_languages\', \'true\'), '
502
	     . '(\'wysiwyg_editor\', \'fckeditor\'), '
503
	     . '(\'manage_sections\', \'true\'), '
504
	     . '(\'section_blocks\', \'false\'), '
505
	     . '(\'smart_login\', \'false\'), '
506
	     . '(\'frontend_login\', \'false\'), '
507
	     . '(\'frontend_signup\', \'false\'), '
508
	     . '(\'search\', \'public\'), '
509
	     . '(\'page_extension\', \'.php\'), '
510
	     . '(\'page_spacer\', \'-\'), '
511
	     . '(\'pages_directory\', \'/pages\'), '
512
	     . '(\'rename_files_on_upload\', \'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js,txt\'), '
513
	     . '(\'media_directory\', \'/media\'), '
514
	     . '(\'operating_system\', \''.$operating_system.'\'), '
515
	     . '(\'string_file_mode\', \''.$file_mode.'\'), '
516
	     . '(\'string_dir_mode\', \''.$dir_mode.'\'), '
517
	     . '(\'wbmailer_routine\', \'phpmail\'), '
518
	     . '(\'server_email\', \''.$admin_email.'\'), '
519
	     . '(\'wbmailer_default_sendername\', \'WebsiteBaker Mailer\'), '
520
	     . '(\'wbmailer_smtp_host\', \'\'), '
521
	     . '(\'wbmailer_smtp_auth\', \'\'), '
522
	     . '(\'wbmailer_smtp_username\', \'\'), '
523
	     . '(\'wbmailer_smtp_password\', \'\'), '
524
	     . '(\'fingerprint_with_ip_octets\', \'2\'), '
525
	     . '(\'secure_form_module\', \'\'), '
526
	     . '(\'mediasettings\', \'\'), '
527
	     . '(\'wb_revision\', \''.REVISION.'\'), '
528
 	     . '(\'wb_sp\', \''.SP.'\'), '
529
	     . '(\'page_icon_dir\', \'/templates/*/title_images\'), '
530
	     . '(\'dev_infos\', \'false\'), '
531
	     . '(\'groups_updated\', \''.time().'\'), '
532
	     . '(\'wbmail_signature\', \'\'), '
533
	     . '(\'confirmed_registration\', \'1\'), '
534
	     . '(\'page_extendet\', \'true\'), '
535
	     . '(\'system_locked\', \'0\'), '
536
	     . '(\'password_crypt_loops\', \'12\'), '
537
	     . '(\'password_hash_type\', \'false\'), '
538
	     . '(\'password_length\', \'10\'), '
539
		 . '(\'password_use_types\', \''.(int)0xFFFF.'\') '
540
	     . '';
537 541
	if(!$database->query($settings_rows)) { set_error($database->get_error()); }
538 542

  
539 543
	// Admin group
540
	$full_system_permissions  = 'access,addons,admintools,admintools_view,groups,groups_add,groups_delete,groups_modify,groups_view,';
541
	$full_system_permissions .= 'languages,languages_install,languages_uninstall,languages_view,media,media_create,media_delete,media_rename,media_upload,media_view,';
542
	$full_system_permissions .= 'modules,modules_advanced,modules_install,modules_uninstall,modules_view,pages,pages_add,pages_add_l0,pages_delete,pages_intro,pages_modify,pages_settings,pages_view,';
543
	$full_system_permissions .= 'preferences,preferences_view,settings,settings_advanced,settings_basic,settings_view,templates,templates_install,templates_uninstall,templates_view,users,users_add,users_delete,users_modify,users_view';
544
	$insert_admin_group = "INSERT INTO `".TABLE_PREFIX."groups` VALUES ('1', 'Administrators', '$full_system_permissions', '', '')";
545
	if(!$database->query($insert_admin_group)) { set_error($database->get_error()); }
544
	$full_system_permissions  = 'access,addons,admintools,admintools_view,groups,groups_add,groups_delete,'
545
	                          . 'groups_modify,groups_view,languages,languages_install,languages_uninstall,'
546
	                          . 'languages_view,media,media_create,media_delete,media_rename,media_upload,'
547
	                          . 'media_view,modules,modules_advanced,modules_install,modules_uninstall,'
548
	                          . 'modules_view,pages,pages_add,pages_add_l0,pages_delete,pages_intro,'
549
	                          . 'pages_modify,pages_settings,pages_view,preferences,preferences_view,'
550
	                          . 'settings,settings_advanced,settings_basic,settings_view,templates,'
551
	                          . 'templates_install,templates_uninstall,templates_view,users,users_add,'
552
	                          . 'users_delete,users_modify,users_view';
553
	$sql = 'INSERT INTO `'.TABLE_PREFIX.'groups` '
554
	     . 'SET `group_id` =1,'
555
	     .     '`name`=\'Administrators\','
556
		 .     '`system_permissions`=\''.$full_system_permissions.'\','
557
		 .     '`module_permissions`=\'\','
558
		 .     '`template_permissions`=\'\'';
559
	if(!$database->query($sql)) { set_error($database->get_error()); }
546 560

  
547 561
// Admin user
548 562
	$insert_admin_user = "INSERT INTO `".TABLE_PREFIX."users` VALUES (1, 1, '1', 1, '$admin_username', '".md5($admin_password)."', '', 0, '', 0, 'Administrator', '$admin_email', $default_timezone, '', '', '$default_language', '', 0, '');";

Also available in: Unified diff