Prechádzať zdrojové kódy

Merge pull request #1174 from Arantor/release-2.1

More odds and ends
Arantor 10 rokov pred
rodič
commit
5c168e6fdf

+ 1 - 1
Sources/Packages.php

@@ -893,7 +893,7 @@ function PackageInstall()
 		// @todo Internationalize this?
 		$result = package_create_backup(($context['uninstalling'] ? 'backup_' : 'before_') . strtok($context['filename'], '.'));
 		if (!$result)
-			fatal_lang_error('could_not_language_backup', false);
+			fatal_lang_error('could_not_package_backup', false);
 	}
 
 	// The mod isn't installed.... unless proven otherwise.

+ 34 - 0
Sources/Reports.php

@@ -371,6 +371,19 @@ function BoardPermissionsReport()
 	// Make sure that every group is represented - plus in rows!
 	setKeys('rows', $member_groups);
 
+	// Certain permissions should not really be shown.
+	$disabled_permissions = array();
+	if (!$modSettings['postmod_active'])
+	{
+		$disabled_permissions[] = 'approve_posts';
+		$disabled_permissions[] = 'post_unapproved_topics';
+		$disabled_permissions[] = 'post_unapproved_replies_own';
+		$disabled_permissions[] = 'post_unapproved_replies_any';
+		$disabled_permissions[] = 'post_unapproved_attachments';
+	}
+
+	call_integration_hook('integrate_reports_boardperm', array(&$disabled_permissions));
+
 	// Cache every permission setting, to make sure we don't miss any allows.
 	$permissions = array();
 	$board_permissions = array();
@@ -389,6 +402,9 @@ function BoardPermissionsReport()
 	);
 	while ($row = $smcFunc['db_fetch_assoc']($request))
 	{
+		if (in_array($row['permission'], $disabled_permissions))
+			continue;
+
 		foreach ($boards as $id => $board)
 			if ($board['profile'] == $row['id_profile'])
 				$board_permissions[$id][$row['id_group']][$row['permission']] = $row['add_deny'];
@@ -654,6 +670,21 @@ function GroupPermissionsReport()
 	// Add a separator
 	addSeparator($txt['board_perms_permission']);
 
+	// Certain permissions should not really be shown.
+	$disabled_permissions = array();
+	if (empty($modSettings['cal_enabled']))
+	{
+		$disabled_permissions[] = 'calendar_view';
+		$disabled_permissions[] = 'calendar_post';
+		$disabled_permissions[] = 'calendar_edit_own';
+		$disabled_permissions[] = 'calendar_edit_any';
+	}
+	if (empty($modSettings['warning_settings']) || $modSettings['warning_settings'][0] == 0)
+		$disabled_permissions[] = 'issue_warning';
+	if (empty($modSettings['karmaMode']))
+		$disabled_permissions[] = 'karma_edit';
+	call_integration_hook('integrate_reports_groupperm', array(&$disabled_permissions));
+
 	// Now the big permission fetch!
 	$request = $smcFunc['db_query']('', '
 		SELECT id_group, add_deny, permission
@@ -671,6 +702,9 @@ function GroupPermissionsReport()
 	$curData = array();
 	while ($row = $smcFunc['db_fetch_assoc']($request))
 	{
+		if (in_array($row['permission'], $disabled_permissions))
+			continue;
+
 		// If this is a new permission flush the last row.
 		if ($row['permission'] != $lastPermission)
 		{

+ 1 - 1
Themes/default/ManagePermissions.template.php

@@ -562,7 +562,7 @@ function template_modify_group_display($type)
 	foreach ($permission_type['columns'] as $column)
 	{
 		echo '
-						<table width="49%" class="table_grid perm_classic floatleft">';
+						<table class="table_grid perm_grid floatleft">';
 
 		foreach ($column as $permissionGroup)
 		{

+ 2 - 1
Themes/default/css/admin.css

@@ -989,8 +989,9 @@ ul.pending_payments li {
 .perm_groups {
 	background-color: #fff;
 }
-.perm_classic {
+table.table_grid.perm_grid {
 	margin: 0.2em;
+	width: 49%;
 }
 .permission_groups {
 	padding: 0;

+ 2 - 2
Themes/default/languages/Who.english.php

@@ -49,9 +49,11 @@ $txt['whoall_register'] = 'Registering for an account on the forum.';
 $txt['whoall_register2'] = 'Registering for an account on the forum.';
 $txt['whoall_reminder'] = 'Requesting a password reminder.';
 $txt['whoall_reporttm'] = 'Reporting a topic to a moderator.';
+$txt['whoall_restoretopic'] = 'Restoring a topic.';
 $txt['whoall_spellcheck'] = 'Using the spellchecker';
 $txt['whoall_unread'] = 'Viewing unread topics since their last visit.';
 $txt['whoall_unreadreplies'] = 'Viewing unread replies since their last visit.';
+$txt['whoall_unwatchtopic'] = 'Unwatching a topic.';
 $txt['whoall_who'] = 'Viewing <a href="' . $scripturl . '?action=who">Who\'s Online</a>.';
 
 $txt['whoall_collapse_collapse'] = 'Collapsing a category.';
@@ -111,8 +113,6 @@ $txt['whoallow_optimizetables'] = 'Optimizing the database tables.';
 $txt['whoallow_repairboards'] = 'Repairing the database tables.';
 $txt['whoallow_search'] = '<a href="' . $scripturl . '?action=search">Searching</a> the forum.';
 $txt['whoallow_search2'] = 'Viewing the results of a search.';
-$txt['whoallow_setcensor'] = 'Editing the censor text.';
-$txt['whoallow_setreserve'] = 'Editing the reserved names.';
 $txt['whoallow_stats'] = 'Viewing the <a href="' . $scripturl . '?action=stats">forum stats</a>.';
 $txt['whoallow_viewErrorLog'] = 'Viewing the error log.';
 $txt['whoallow_viewmembers'] = 'Viewing a list of members.';

+ 0 - 6
Themes/default/scripts/suggest.js

@@ -39,8 +39,6 @@ function smc_AutoSuggest(oOptions)
 	this.oHideTimer = null;
 	this.bPositionComplete = false;
 
-	this.oXmlRequestHandle = null;
-
 	// Just make sure the page is loaded before calling the init.
 	addLoadEvent(this.opt.sSelf + '.init();');
 }
@@ -614,10 +612,6 @@ smc_AutoSuggest.prototype.autoSuggestUpdate = function ()
 		}
 	}
 
-	// In progress means destroy!
-	if (typeof(this.oXmlRequestHandle) == 'object' && this.oXmlRequestHandle != null)
-		this.oXmlRequestHandle.abort();
-
 	// Clean the text handle.
 	sSearchString = sSearchString.php_to8bit().php_urlencode();
 

+ 1 - 1
index.php

@@ -206,7 +206,7 @@ function smf_main()
 	if (!empty($topic) && empty($board_info['cur_topic_approved']) && !allowedTo('approve_posts') && ($user_info['id'] != $board_info['cur_topic_starter'] || $user_info['is_guest']))
 		fatal_lang_error('not_a_topic', false);
 
-	$no_stat_actions = array('dlattach', 'findmember', 'jsoption', 'requestmembers', 'smstats', '.xml', 'xmlhttp', 'verificationcode', 'viewquery', 'viewsmfile');
+	$no_stat_actions = array('clock', 'dlattach', 'findmember', 'jsoption', 'likes', 'loadeditorlocale', 'modifycat', 'requestmembers', 'smstats', 'suggest', 'about:unknown', '.xml', 'xmlhttp', 'verificationcode', 'viewquery', 'viewsmfile');
 	call_integration_hook('integrate_pre_log_stats', array(&$no_stat_actions));
 	// Do some logging, unless this is an attachment, avatar, toggle of editor buttons, theme option, XML feed etc.
 	if (empty($_REQUEST['action']) || !in_array($_REQUEST['action'], $no_stat_actions))

+ 1 - 0
other/install_2-1_mysql.sql

@@ -1277,6 +1277,7 @@ CREATE TABLE {$db_prefix}members (
   PRIMARY KEY (id_member),
   KEY member_name (member_name),
   KEY real_name (real_name),
+  KEY email_address (email_address),
   KEY date_registered (date_registered),
   KEY id_group (id_group),
   KEY birthdate (birthdate),

+ 1 - 0
other/install_2-1_postgresql.sql

@@ -1682,6 +1682,7 @@ CREATE TABLE {$db_prefix}members (
 
 CREATE INDEX {$db_prefix}members_member_name ON {$db_prefix}members (member_name);
 CREATE INDEX {$db_prefix}members_real_name ON {$db_prefix}members (real_name);
+CREATE INDEX {$db_prefix}members_email_address ON {$db_prefix}members (email_address);
 CREATE INDEX {$db_prefix}members_date_registered ON {$db_prefix}members (date_registered);
 CREATE INDEX {$db_prefix}members_id_group ON {$db_prefix}members (id_group);
 CREATE INDEX {$db_prefix}members_birthdate ON {$db_prefix}members (birthdate);

+ 1 - 0
other/install_2-1_sqlite.sql

@@ -1382,6 +1382,7 @@ CREATE TABLE {$db_prefix}members (
 
 CREATE INDEX {$db_prefix}members_member_name ON {$db_prefix}members (member_name);
 CREATE INDEX {$db_prefix}members_real_name ON {$db_prefix}members (real_name);
+CREATE INDEX {$db_prefix}members_email_address ON {$db_prefix}members (email_address);
 CREATE INDEX {$db_prefix}members_date_registered ON {$db_prefix}members (date_registered);
 CREATE INDEX {$db_prefix}members_id_group ON {$db_prefix}members (id_group);
 CREATE INDEX {$db_prefix}members_birthdate ON {$db_prefix}members (birthdate);

+ 1 - 0
other/install_2-1_sqlite3.sql

@@ -1382,6 +1382,7 @@ CREATE TABLE {$db_prefix}members (
 
 CREATE INDEX {$db_prefix}members_member_name ON {$db_prefix}members (member_name);
 CREATE INDEX {$db_prefix}members_real_name ON {$db_prefix}members (real_name);
+CREATE INDEX {$db_prefix}members_email_address ON {$db_prefix}members (email_address);
 CREATE INDEX {$db_prefix}members_date_registered ON {$db_prefix}members (date_registered);
 CREATE INDEX {$db_prefix}members_id_group ON {$db_prefix}members (id_group);
 CREATE INDEX {$db_prefix}members_birthdate ON {$db_prefix}members (birthdate);

+ 18 - 0
other/upgrade.php

@@ -910,6 +910,24 @@ function initialize_inputs()
 		}
 		closedir($dh);
 
+		// Legacy files while we're at it. NOTE: We only touch files we KNOW shouldn't be there.
+		// 1.1 Sources files not in 2.0+
+		@unlink(dirname(__FILE__) . '/Sources/ModSettings.php');
+		// 1.1 Templates that don't exist any more (e.g. renamed)
+		@unlink(dirname(__FILE__) . '/Themes/default/Combat.template.php');
+		@unlink(dirname(__FILE__) . '/Themes/default/Modlog.template.php');
+		// 1.1 JS files were stored in the main theme folder, but in 2.0+ are in the scripts/ folder
+		@unlink(dirname(__FILE__) . '/Themes/default/fader.js');
+		@unlink(dirname(__FILE__) . '/Themes/default/script.js');
+		@unlink(dirname(__FILE__) . '/Themes/default/sha1.js');
+		@unlink(dirname(__FILE__) . '/Themes/default/spellcheck.js');
+		@unlink(dirname(__FILE__) . '/Themes/default/xml_board.js');
+		@unlink(dirname(__FILE__) . '/Themes/default/xml_topic.js');
+
+		// 2.0 Sources files not in 2.1+
+		@unlink(dirname(__FILE__) . '/Sources/DumpDatabase.php');
+		@unlink(dirname(__FILE__) . '/Sources/LockTopic.php');
+
 		header('Location: http://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']) . dirname($_SERVER['PHP_SELF']) . '/Themes/default/images/blank.png');
 		exit;
 	}