Bläddra i källkod

Merge pull request #714 from Arantor/release-2.1

! Some admin panel reorg: moving 'search engine tracking' out of being i...
Arantor 11 år sedan
förälder
incheckning
52faa0efed
4 ändrade filer med 73 tillägg och 77 borttagningar
  1. 15 15
      Sources/Admin.php
  2. 56 0
      Sources/ManageServer.php
  3. 1 61
      Sources/ManageSettings.php
  4. 1 1
      Themes/default/languages/Admin.english.php

+ 15 - 15
Sources/Admin.php

@@ -128,7 +128,6 @@ function AdminMain()
 					'function' => 'ModifySecuritySettings',
 					'icon' => 'security.png',
 					'subsections' => array(
-						'general' => array($txt['mods_cat_security_general']),
 						'spam' => array($txt['antispam_title']),
 						'moderation' => array($txt['moderation_settings_short'], 'enabled' => in_array('w', $context['admin_features'])),
 					),
@@ -267,6 +266,20 @@ function AdminMain()
 						'maintenance' => array($txt['attachment_manager_maintenance']),
 					),
 				),
+				'sengines' => array(
+					'label' => $txt['search_engines'],
+					'enabled' => in_array('sp', $context['admin_features']),
+					'file' => 'ManageSearchEngines.php',
+					'icon' => 'engines.png',
+					'function' => 'SearchEngines',
+					'permission' => 'admin_forum',
+					'subsections' => array(
+						'stats' => array($txt['spider_stats']),
+						'logs' => array($txt['spider_logs']),
+						'spiders' => array($txt['spiders']),
+						'settings' => array($txt['settings']),
+					),
+				),
 			),
 		),
 		'members' => array(
@@ -348,20 +361,6 @@ function AdminMain()
 						'settings' => array($txt['settings']),
 					),
 				),
-				'sengines' => array(
-					'label' => $txt['search_engines'],
-					'enabled' => in_array('sp', $context['admin_features']),
-					'file' => 'ManageSearchEngines.php',
-					'icon' => 'engines.png',
-					'function' => 'SearchEngines',
-					'permission' => 'admin_forum',
-					'subsections' => array(
-						'stats' => array($txt['spider_stats']),
-						'logs' => array($txt['spider_logs']),
-						'spiders' => array($txt['spiders']),
-						'settings' => array($txt['settings']),
-					),
-				),
 			),
 		),
 		'maintenance' => array(
@@ -377,6 +376,7 @@ function AdminMain()
 						'general' => array($txt['general_settings']),
 						'database' => array($txt['database_paths_settings']),
 						'cookie' => array($txt['cookies_sessions_settings']),
+						'security' => array($txt['security_settings']),
 						'cache' => array($txt['caching_settings']),
 						'loads' => array($txt['load_balancing_settings']),
 						'phpinfo' => array($txt['phpinfo_settings']),

+ 56 - 0
Sources/ManageServer.php

@@ -94,6 +94,7 @@ function ModifySettings()
 		'general' => 'ModifyGeneralSettings',
 		'database' => 'ModifyDatabaseSettings',
 		'cookie' => 'ModifyCookieSettings',
+		'security' => 'ModifyGeneralSecuritySettings',
 		'cache' => 'ModifyCacheSettings',
 		'loads' => 'ModifyLoadBalancingSettings',
 		'phpinfo' => 'ShowPHPinfoSettings',
@@ -336,6 +337,61 @@ function ModifyCookieSettings($return_config = false)
 	prepareServerSettingsContext($config_vars);
 }
 
+/**
+ * Settings really associated with general security aspects.
+ *
+ * @param $return_config
+ */
+function ModifyGeneralSecuritySettings($return_config = false)
+{
+	global $txt, $scripturl, $context, $settings, $sc, $modSettings;
+
+	$config_vars = array(
+			array('check', 'guest_hideContacts'),
+			array('check', 'make_email_viewable'),
+		'',
+			array('int', 'failed_login_threshold'),
+			array('int', 'loginHistoryDays'),
+		'',
+			array('check', 'securityDisable'),
+			array('check', 'securityDisable_moderate'),
+		'',
+			// Reactive on email, and approve on delete
+			array('check', 'send_validation_onChange'),
+			array('check', 'approveAccountDeletion'),
+		'',
+			// Password strength.
+			array('select', 'password_strength', array($txt['setting_password_strength_low'], $txt['setting_password_strength_medium'], $txt['setting_password_strength_high'])),
+			array('check', 'enable_password_conversion'),
+		'',
+			// Reporting of personal messages?
+			array('check', 'enableReportPM'),
+		'',
+			array('select', 'frame_security', array('SAMEORIGIN' => $txt['setting_frame_security_SAMEORIGIN'], 'DENY' => $txt['setting_frame_security_DENY'], 'DISABLE' => $txt['setting_frame_security_DISABLE'])),
+	);
+
+	call_integration_hook('integrate_general_security_settings', array(&$config_vars));
+
+	if ($return_config)
+		return $config_vars;
+
+	// Saving?
+	if (isset($_GET['save']))
+	{
+		saveDBSettings($config_vars);
+
+		call_integration_hook('integrate_save_general_security_settings');
+
+		writeLog();
+		redirectexit('action=admin;area=serversettings;sa=security;' . $context['session_var'] . '=' . $context['session_id']);
+	}
+
+	$context['post_url'] = $scripturl . '?action=admin;area=serversettings;save;sa=security';
+	$context['settings_title'] = $txt['security_settings'];
+
+	prepareDBSettingContext($config_vars);
+}
+
 /**
  * Simply modifying cache functions
  *

+ 1 - 61
Sources/ManageSettings.php

@@ -104,7 +104,6 @@ function ModifySecuritySettings()
 	$context['page_title'] = $txt['admin_security_moderation'];
 
 	$subActions = array(
-		'general' => 'ModifyGeneralSecuritySettings',
 		'spam' => 'ModifySpamSettings',
 		'moderation' => 'ModifyModerationSettings',
 	);
@@ -115,7 +114,7 @@ function ModifySecuritySettings()
 	if (!in_array('w', $context['admin_features']))
 		unset($subActions['moderation']);
 
-	loadGeneralSettingParameters($subActions, 'general');
+	loadGeneralSettingParameters($subActions, 'spam');
 
 	// Load up all the tabs...
 	$context[$context['admin_menu_name']]['tab_data'] = array(
@@ -123,8 +122,6 @@ function ModifySecuritySettings()
 		'help' => 'securitysettings',
 		'description' => $txt['security_settings_desc'],
 		'tabs' => array(
-			'general' => array(
-			),
 			'spam' => array(
 				'description' => $txt['antispam_Settings_desc'] ,
 			),
@@ -507,63 +504,6 @@ function ModifyBasicSettings($return_config = false)
 	prepareDBSettingContext($config_vars);
 }
 
-/**
- * Settings really associated with general security aspects.
- *
- * @param $return_config
- */
-function ModifyGeneralSecuritySettings($return_config = false)
-{
-	global $txt, $scripturl, $context, $settings, $sc, $modSettings;
-
-	$config_vars = array(
-			array('check', 'guest_hideContacts'),
-			array('check', 'make_email_viewable'),
-		'',
-			array('int', 'failed_login_threshold'),
-			array('int', 'loginHistoryDays'),
-		'',
-			array('check', 'securityDisable'),
-			array('check', 'securityDisable_moderate'),
-		'',
-			// Reactive on email, and approve on delete
-			array('check', 'send_validation_onChange'),
-			array('check', 'approveAccountDeletion'),
-		'',
-			// Password strength.
-			array('select', 'password_strength', array($txt['setting_password_strength_low'], $txt['setting_password_strength_medium'], $txt['setting_password_strength_high'])),
-			array('check', 'enable_password_conversion'),
-		'',
-			// Reporting of personal messages?
-			array('check', 'enableReportPM'),
-		'',
-			array('select', 'frame_security', array('SAMEORIGIN' => $txt['setting_frame_security_SAMEORIGIN'], 'DENY' => $txt['setting_frame_security_DENY'], 'DISABLE' => $txt['setting_frame_security_DISABLE'])),
-	);
-
-	call_integration_hook('integrate_general_security_settings', array(&$config_vars));
-
-	if ($return_config)
-		return $config_vars;
-
-	// Saving?
-	if (isset($_GET['save']))
-	{
-		checkSession();
-
-		saveDBSettings($config_vars);
-
-		call_integration_hook('integrate_save_general_security_settings');
-
-		writeLog();
-		redirectexit('action=admin;area=securitysettings;sa=general');
-	}
-
-	$context['post_url'] = $scripturl . '?action=admin;area=securitysettings;save;sa=general';
-	$context['settings_title'] = $txt['mods_cat_security_general'];
-
-	prepareDBSettingContext($config_vars);
-}
-
 /**
  * Allows modifying the global layout settings in the forum
  * Accessed through ?action=admin;area=featuresettings;sa=layout;

+ 1 - 1
Themes/default/languages/Admin.english.php

@@ -595,6 +595,7 @@ $txt['not_done_continue'] = 'Continue';
 $txt['general_settings'] = 'General';
 $txt['database_paths_settings'] = 'Database and Paths';
 $txt['cookies_sessions_settings'] = 'Cookies and Sessions';
+$txt['security_settings'] = 'Security';
 $txt['caching_settings'] = 'Caching';
 $txt['load_balancing_settings'] = 'Load Balancing';
 $txt['phpinfo_settings'] = 'PHP Info';
@@ -645,7 +646,6 @@ $txt['admin_search_section_settings'] = 'Setting';
 $txt['core_settings_title'] = 'Core Features';
 $txt['core_settings_desc'] = 'This page allows you to turn on or off optional features of your forum.';
 $txt['mods_cat_features'] = 'General';
-$txt['mods_cat_security_general'] = 'General';
 $txt['antispam_title'] = 'Anti-Spam';
 $txt['mods_cat_modifications_misc'] = 'Miscellaneous';
 $txt['mods_cat_layout'] = 'Layout';