Browse Source

Merge pull request #147 from emanuele45/master

Fixes found while pack + language files version to 2.1
emanuele45 12 years ago
parent
commit
f0efd8ec80
42 changed files with 86 additions and 95 deletions
  1. 1 9
      Sources/Admin.php
  2. 4 1
      Sources/ManageMembers.php
  3. 8 3
      Sources/Memberlist.php
  4. 1 8
      Sources/Security.php
  5. 1 4
      Sources/Subs-Auth.php
  6. 1 1
      Sources/Subs-Members.php
  7. 2 2
      Themes/default/GenericList.template.php
  8. 1 1
      Themes/default/languages/Admin.english.php
  9. 1 1
      Themes/default/languages/EmailTemplates.english.php
  10. 2 2
      Themes/default/languages/Errors.english.php
  11. 1 1
      Themes/default/languages/Help.english.php
  12. 1 1
      Themes/default/languages/Install.english.php
  13. 1 1
      Themes/default/languages/Login.english.php
  14. 1 1
      Themes/default/languages/ManageBoards.english.php
  15. 1 1
      Themes/default/languages/ManageCalendar.english.php
  16. 1 1
      Themes/default/languages/ManageMail.english.php
  17. 1 1
      Themes/default/languages/ManageMaintenance.english.php
  18. 1 1
      Themes/default/languages/ManageMembers.english.php
  19. 1 1
      Themes/default/languages/ManagePaid.english.php
  20. 1 1
      Themes/default/languages/ManagePermissions.english.php
  21. 1 1
      Themes/default/languages/ManageScheduledTasks.english.php
  22. 1 1
      Themes/default/languages/ManageSettings.english.php
  23. 1 1
      Themes/default/languages/ManageSmileys.english.php
  24. 1 1
      Themes/default/languages/Manual.english.php
  25. 1 1
      Themes/default/languages/ModerationCenter.english.php
  26. 1 1
      Themes/default/languages/Modifications.english.php
  27. 1 1
      Themes/default/languages/Modlog.english.php
  28. 1 1
      Themes/default/languages/Packages.english.php
  29. 1 1
      Themes/default/languages/PersonalMessage.english.php
  30. 1 2
      Themes/default/languages/Post.english.php
  31. 1 1
      Themes/default/languages/Profile.english.php
  32. 1 1
      Themes/default/languages/Reports.english.php
  33. 1 1
      Themes/default/languages/Search.english.php
  34. 1 1
      Themes/default/languages/Settings.english.php
  35. 1 1
      Themes/default/languages/Stats.english.php
  36. 1 1
      Themes/default/languages/Themes.english.php
  37. 1 1
      Themes/default/languages/Who.english.php
  38. 1 1
      Themes/default/languages/Wireless.english.php
  39. 1 1
      Themes/default/languages/index.english.php
  40. 1 1
      other/upgrade_2-1_mysql.sql
  41. 17 16
      other/upgrade_2-1_postgresql.sql
  42. 17 16
      other/upgrade_2-1_sqlite.sql

+ 1 - 9
Sources/Admin.php

@@ -39,14 +39,6 @@ function AdminMain()
 
 	// Some preferences.
 	$context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
-	$context['hooks_exist'] = false;
-	foreach ($modSettings as $key => $setting)
-	if (strpos($key, 'integrate') === 0)
-		if (!empty($setting))
-		{
-			$context['hooks_exist'] = true;
-			break;
-		}
 
 	// Define all the menu structure - see Subs-Menu.php for details!
 	$admin_areas = array(
@@ -189,7 +181,7 @@ function AdminMain()
 					'function' => 'ModifyModSettings',
 					'icon' => 'modifications.png',
 					'subsections' => array(
-						'hooks' => array($txt['hooks_title_list'], 'enabled' => $context['hooks_exist']),
+						'hooks' => array($txt['hooks_title_list']),
 						'general' => array($txt['mods_cat_modifications_misc']),
 						// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
 						// 'shout' => array($txt['shout']),

+ 4 - 1
Sources/ManageMembers.php

@@ -369,7 +369,10 @@ function ViewMemberlist()
 				// Replace the wildcard characters ('*' and '?') into MySQL ones.
 				$parameter = strtolower(strtr($smcFunc['htmlspecialchars']($search_params[$param_name], ENT_QUOTES), array('%' => '\%', '_' => '\_', '*' => '%', '?' => '_')));
 
-				$query_parts[] = '(' . implode( ' LIKE {string:' . $param_name . '_normal} OR ', $param_info['db_fields']) . ' LIKE {string:' . $param_name . '_normal})';
+				if ($smcFunc['db_case_sensitive'])
+					$query_parts[] = '(LOWER(' . implode( ') LIKE {string:' . $param_name . '_normal} OR LOWER(', $param_info['db_fields']) . ') LIKE {string:' . $param_name . '_normal})';
+				else
+					$query_parts[] = '(' . implode( ' LIKE {string:' . $param_name . '_normal} OR ', $param_info['db_fields']) . ' LIKE {string:' . $param_name . '_normal})';
 				$where_params[$param_name . '_normal'] = '%' . $parameter . '%';
 			}
 		}

+ 8 - 3
Sources/Memberlist.php

@@ -406,6 +406,9 @@ function MLSearch()
 {
 	global $txt, $scripturl, $context, $user_info, $modSettings, $smcFunc;
 
+	$context['page_title'] = $txt['mlist_search'];
+	$context['can_moderate_forum'] = allowedTo('moderate_forum');
+
 	// Can they search custom fields?
 	$request = $smcFunc['db_query']('', '
 		SELECT col_name, field_name, field_desc
@@ -464,8 +467,6 @@ function MLSearch()
 		}
 
 		// set up some things for use in the template
-		$context['page_title'] = $txt['mlist_search'];
-		$context['can_moderate_forum'] = allowedTo('moderate_forum');
 		$context['sort_direction'] = !isset($_REQUEST['desc']) ? 'up' : 'down';
 		$context['sort_by'] = $_REQUEST['sort'];
 
@@ -500,6 +501,10 @@ function MLSearch()
 		else
 			$condition = '';
 
+		if ($smcFunc['db_case_sensitive'])
+			foreach ($fields as $key => $field)
+				$fields[$key] = 'LOWER(' . $field . ')';
+
 		$customJoin = array();
 		$customCount = 10;
 
@@ -515,7 +520,7 @@ function MLSearch()
 			}
 		}
 
-		$query = $_POST['search'] == '' ? '= {string:blank_string}' : 'LIKE {string:search}';
+		$query = $_POST['search'] == '' ? '= {string:blank_string}' : ($smcFunc['db_case_sensitive'] ? 'LIKE LOWER({string:search})' : 'LIKE {string:search}');
 
 		$request = $smcFunc['db_query']('', '
 			SELECT COUNT(*)

+ 1 - 8
Sources/Security.php

@@ -764,7 +764,7 @@ function createToken($action, $type = 'post')
  */
 function validateToken($action, $type = 'post', $reset = true)
 {
-	global $modSettings, $sourcedir;
+	global $modSettings;
 
 	$type = $type == 'get' || $type == 'request' ? $type : 'post';
 
@@ -806,13 +806,6 @@ function validateToken($action, $type = 'post', $reset = true)
 		// I'm back baby.
 		createToken($action, $type);
 
-		// Need to type in a password for that, man.
-		if (!isset($_GET['xml']))
-		{
-			require_once($sourcedir . '/Subs-Auth.php');
-			adminLogin($type, $action);
-		}
-
 		fatal_lang_error('token_verify_fail', false);
 	}
 	// Remove this token as its useless

+ 1 - 4
Sources/Subs-Auth.php

@@ -193,7 +193,7 @@ function InMaintenance()
  *
  * @param string $type = 'admin'
  */
-function adminLogin($type = 'admin', $additionalToken = false)
+function adminLogin($type = 'admin')
 {
 	global $context, $scripturl, $txt, $user_info, $user_settings;
 
@@ -230,9 +230,6 @@ function adminLogin($type = 'admin', $additionalToken = false)
 	foreach ($_POST as $k => $v)
 		$context['post_data'] .= adminLogin_outputPostVars($k, $v);
 
-	if (!empty($additionalToken))
-		$context['post_data'] .= adminLogin_outputPostVars($context[$additionalToken . '_token_var'], $context[$additionalToken . '_token']);
-
 	// Now we'll use the admin_login sub template of the Login template.
 	$context['sub_template'] = 'admin_login';
 

+ 1 - 1
Sources/Subs-Members.php

@@ -1254,7 +1254,7 @@ function list_getMembers($start, $items_per_page, $sort, $where, $where_params =
 			mem.posts, mem.is_activated, mem.date_registered, mem.id_group, mem.additional_groups, mg.group_name
 		FROM {db_prefix}members AS mem
 			LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)
-		WHERE ' . $where . '
+		WHERE ' . ($where == '1' ? '1=1' : $where) . '
 		ORDER BY {raw:sort}
 		LIMIT {int:start}, {int:per_page}',
 		array_merge($where_params, array(

+ 2 - 2
Themes/default/GenericList.template.php

@@ -62,7 +62,7 @@ function template_show_list($list_id = null)
 			<div class="flow_auto">';
 
 		// Show the page index (if this list doesn't intend to show all items).
-		if (!empty($cur_list['items_per_page']))
+		if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index']))
 			echo '
 				<div class="floatleft">
 					<div class="pagesection">', $cur_list['page_index'], '</div>
@@ -145,7 +145,7 @@ function template_show_list($list_id = null)
 			<div class="flow_auto">';
 
 		// Show the page index (if this list doesn't intend to show all items).
-		if (!empty($cur_list['items_per_page']))
+		if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index']))
 			echo '
 				<div class="floatleft">
 					<div class="pagesection">', $cur_list['page_index'], '</div>

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Admin
+// Version: 2.1; Admin
 
 global $settings, $scripturl;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; EmailTemplates
+// Version: 2.1; EmailTemplates
 
 // Since all of these strings are being used in emails, numeric entities should be used.
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Errors
+// Version: 2.1; Errors
 
 global $scripturl, $modSettings;
 
@@ -418,4 +418,4 @@ $txt['restore_not_found'] = 'The following messages could not be restored; the o
 $txt['error_invalid_dir'] = 'The directory you entered is invalid.';
 
 $txt['error_sqlite_optimizing'] = 'Sqlite is optimizing the database, the forum can not be accessed until it has finished.  Please try refreshing this page momentarily.';
-?>
+?>

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Help
+// Version: 2.1; Help
 
 global $helptxt;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Install
+// Version: 2.1; Install
 
 // These should be the same as those in index.language.php.
 $txt['lang_character_set'] = 'ISO-8859-1';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Login
+// Version: 2.1; Login
 
 global $context;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManageBoards
+// Version: 2.1; ManageBoards
 
 $txt['boards_and_cats'] = 'Manage Boards and Categories';
 $txt['order'] = 'Order';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManageCalendar
+// Version: 2.1; ManageCalendar
 
 $txt['calendar_desc'] = 'From here you can modify all aspects of the calendar.';
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManageMail
+// Version: 2.1; ManageMail
 
 $txt['mailqueue_desc'] = 'From this page you can configure your mail settings, as well as viewing and administrating the current mail queue if it is enabled.';
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManageMaintenance
+// Version: 2.1; ManageMaintenance
 
 $txt['repair_zero_ids'] = 'Found topics and/or messages with topic or message IDs of 0.';
 $txt['repair_missing_topics'] = 'Message #%1$d is in non-existent topic #%2$d.';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManageMembers
+// Version: 2.1; ManageMembers
 
 global $context;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManagePaid
+// Version: 2.1; ManagePaid
 
 global $boardurl;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManagePermissions
+// Version: 2.1; ManagePermissions
 
 $txt['permissions_title'] = 'Manage Permissions';
 $txt['permissions_modify'] = 'Modify';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManageScheduledTasks
+// Version: 2.1; ManageScheduledTasks
 
 $txt['scheduled_tasks_title'] = 'Scheduled Tasks';
 $txt['scheduled_tasks_header'] = 'All Scheduled Tasks';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManageSettings
+// Version: 2.1; ManageSettings
 
 global $scripturl;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ManageSmileys
+// Version: 2.1; ManageSmileys
 
 $txt['smiley_sets_save'] = 'Save Changes';
 $txt['smiley_sets_add'] = 'New smiley Set';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Manual
+// Version: 2.1; Manual
 
 /* Everything in this file is for the Simple Machines help manual
    If you are looking at translating the manual into another language

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; ModerationCenter
+// Version: 2.1; ModerationCenter
 
 global $scripturl;
 

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

@@ -1,4 +1,4 @@
 <?php
-// Version: 2.0; Modifications
+// Version: 2.1; Modifications
 
 ?>

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Modlog
+// Version: 2.1; Modlog
 
 global $scripturl;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Packages
+// Version: 2.1; Packages
 
 $txt['package_proceed'] = 'Proceed';
 $txt['php_script'] = 'Modification file was extracted, but this modification also comes with a PHP script which should be executed before it will work';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; PersonalMessage
+// Version: 2.1; PersonalMessage
 
 global $context;
 

+ 1 - 2
Themes/default/languages/Post.english.php

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Post
+// Version: 2.1; Post
 
 global $context;
 
@@ -232,5 +232,4 @@ $txt['attachments_no_write'] = 'The attachments upload directory is not writable
 $txt['attachments_no_create'] = 'Unable to create a new attachment directory.  Your attachment or avatar cannot be saved.';
 $txt['attachments_limit_per_post'] = 'You may not upload more than %1$d attachments per post';
 
-
 ?>

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Profile
+// Version: 2.1; Profile
 
 global $scripturl, $context;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Reports
+// Version: 2.1; Reports
 
 $txt['generate_reports_desc'] = 'From this section you can generate a variety of reports to assist in the administration of your forum. Simply follow the steps below to select the option of your choice.';
 $txt['generate_reports_continue'] = 'Continue';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Search
+// Version: 2.1; Search
 
 $txt['set_parameters'] = 'Set Search Parameters';
 $txt['choose_board'] = 'Choose a board to search in, or search all';

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Settings
+// Version: 2.1; Settings
 
 global $settings;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Stats
+// Version: 2.1; Stats
 
 global $context;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Themes
+// Version: 2.1; Themes
 
 $txt['themeadmin_explain'] = 'Themes are the different looks and feels of your forum.  These settings affect the selection of themes, and which themes guests and other members use.';
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Who
+// Version: 2.1; Who
 
 global $scripturl, $context;
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; Wireless
+// Version: 2.1; Wireless
 
 $txt['wireless_error_home'] = 'Board index';
 

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

@@ -1,5 +1,5 @@
 <?php
-// Version: 2.0; index
+// Version: 2.1; index
 
 global $forum_copyright, $forum_version, $webmaster_email, $scripturl, $context, $boardurl;
 

+ 1 - 1
other/upgrade_2-1_mysql.sql

@@ -216,7 +216,7 @@ CREATE TABLE IF NOT EXISTS {$db_prefix}user_drafts (
   to_list varchar(255) NOT NULL default '',
   outbox tinyint(4) NOT NULL default '0',
   PRIMARY KEY id_draft(id_draft),
-  UNIQUE id_member (id_member, id_draft, type),
+  UNIQUE id_member (id_member, id_draft, type)
 ) ENGINE=MyISAM{$db_collation};
 ---#
 

+ 17 - 16
other/upgrade_2-1_postgresql.sql

@@ -252,22 +252,23 @@ upgrade_query("
 /******************************************************************************/
 ---# Creating drafts table.
 CREATE TABLE {$db_prefix}user_drafts (
-  id_draft int unsigned NOT NULL auto_increment,
-  id_topic int unsigned NOT NULL default '0',
-  id_board smallint unsigned NOT NULL default '0',
-  id_reply int unsigned NOT NULL default '0',
-  type smallint NOT NULL default '0',
-  poster_time int unsigned NOT NULL default '0',
-  id_member int unsigned NOT NULL default '0',
-  subject varchar(255) NOT NULL default '',
-  smileys_enabled smallint NOT NULL default '1',
-  body text NOT NULL,
-  icon varchar(16) NOT NULL default 'xx',
-  locked smallint NOT NULL default '0',
-  is_sticky smallint NOT NULL default '0',
-  to_list varchar(255) NOT NULL default '',
-  outbox smallint NOT NULL default '0',
-  PRIMARY KEY (id_draft)
+	id_draft int unsigned NOT NULL auto_increment,
+	id_topic int unsigned NOT NULL default '0',
+	id_board smallint unsigned NOT NULL default '0',
+	id_reply int unsigned NOT NULL default '0',
+	type smallint NOT NULL default '0',
+	poster_time int unsigned NOT NULL default '0',
+	id_member int unsigned NOT NULL default '0',
+	subject varchar(255) NOT NULL default '',
+	smileys_enabled smallint NOT NULL default '1',
+	body text NOT NULL,
+	icon varchar(16) NOT NULL default 'xx',
+	locked smallint NOT NULL default '0',
+	is_sticky smallint NOT NULL default '0',
+	to_list varchar(255) NOT NULL default '',
+	outbox smallint NOT NULL default '0',
+	PRIMARY KEY (id_draft)
+);
 ---#
 
 ---# Adding draft permissions...

+ 17 - 16
other/upgrade_2-1_sqlite.sql

@@ -228,22 +228,23 @@ upgrade_query("
 /******************************************************************************/
 ---# Creating drafts table.
 CREATE TABLE {$db_prefix}user_drafts (
-  id_draft int unsigned NOT NULL auto_increment,
-  id_topic int unsigned NOT NULL default '0',
-  id_board smallint unsigned NOT NULL default '0',
-  id_reply int unsigned NOT NULL default '0',
-  type smallint NOT NULL default '0',
-  poster_time int unsigned NOT NULL default '0',
-  id_member int unsigned NOT NULL default '0',
-  subject varchar(255) NOT NULL default '',
-  smileys_enabled smallint NOT NULL default '1',
-  body text NOT NULL,
-  icon varchar(16) NOT NULL default 'xx',
-  locked smallint NOT NULL default '0',
-  is_sticky smallint NOT NULL default '0',
-  to_list varchar(255) NOT NULL default '',
-  outbox smallint NOT NULL default '0',
-  PRIMARY KEY (id_draft)
+	id_draft int unsigned NOT NULL auto_increment,
+	id_topic int unsigned NOT NULL default '0',
+	id_board smallint unsigned NOT NULL default '0',
+	id_reply int unsigned NOT NULL default '0',
+	type smallint NOT NULL default '0',
+	poster_time int unsigned NOT NULL default '0',
+	id_member int unsigned NOT NULL default '0',
+	subject varchar(255) NOT NULL default '',
+	smileys_enabled smallint NOT NULL default '1',
+	body text NOT NULL,
+	icon varchar(16) NOT NULL default 'xx',
+	locked smallint NOT NULL default '0',
+	is_sticky smallint NOT NULL default '0',
+	to_list varchar(255) NOT NULL default '',
+	outbox smallint NOT NULL default '0',
+	PRIMARY KEY (id_draft)
+);
 ---#
 
 ---# Adding draft permissions...