Browse Source

Some other tweaks to the hooks

Signed-off-by: emanuele <[email protected]>
emanuele 11 years ago
parent
commit
bceb21e0f6

+ 1 - 1
Sources/Display.php

@@ -822,7 +822,7 @@ function Display()
 	$smcFunc['db_free_result']($request);
 	$posters = array_unique($all_posters);
 
-	call_integration_hook('integrate_display_message_list', array($messages, $posters));
+	call_integration_hook('integrate_display_message_list', array(&$messages, &$posters));
 
 	// Guests can't mark topics read or for notifications, just can't sorry.
 	if (!$user_info['is_guest'] && !empty($messages))

+ 1 - 1
Sources/Errors.php

@@ -235,7 +235,7 @@ function error_handler($error_level, $error_string, $file, $line)
 	$message = log_error($error_level . ': ' . $error_string, $error_type, $file, $line);
 
 	// Let's give integrations a chance to ouput a bit differently
-	call_integration_hook('integrate_output_error', array($message, $error_type, $error_level, $file, $line));
+	call_integration_hook('integrate_output_error', array(&$message, &$error_type, &$error_level, &$file, &$line));
 
 	// Dying on these errors only causes MORE problems (blank pages!)
 	if ($file == 'Unknown')

+ 1 - 1
Sources/LogInOut.php

@@ -369,7 +369,7 @@ function Login2()
 		}
 
 		// Allows mods to easily extend the $other_passwords array
-		call_integration_hook('integrate_other_passwords', array($other_passwords));
+		call_integration_hook('integrate_other_passwords', array(&$other_passwords));
 
 		// Whichever encryption it was using, let's make it use SMF's now ;).
 		if (in_array($user_settings['passwd'], $other_passwords))

+ 1 - 1
Sources/Logging.php

@@ -421,7 +421,7 @@ function logActions($logs)
 		'admin' => 3,
 	);
 
-	call_integration_hook('integrate_log_types', array($log_types));
+	call_integration_hook('integrate_log_types', array(&$log_types));
 
 	// No point in doing anything, if the log isn't even enabled.
 	if (empty($modSettings['modlog_enabled']))

+ 1 - 1
Sources/ManageLanguages.php

@@ -822,7 +822,7 @@ function ModifyLanguageSettings($return_config = false)
 	{
 		checkSession();
 
-		call_integration_hook('integrate_save_language_settings', array($config_vars));
+		call_integration_hook('integrate_save_language_settings', array(&$config_vars));
 
 		saveSettings($config_vars);
 		redirectexit('action=admin;area=languages;sa=settings');

+ 1 - 1
Sources/Poll.php

@@ -978,7 +978,7 @@ function RemovePoll()
 	);
 
 	// A mod might have logged this (social network?), so let them remove, it too
-	call_integration_hook('integrate_poll_remove', array(&$pollID));
+	call_integration_hook('integrate_poll_remove', array($pollID));
 
 	// Take the moderator back to the topic.
 	redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);

+ 1 - 1
Sources/Post.php

@@ -972,7 +972,7 @@ function Post($post_errors = array())
 	 */
 	$minor_errors = array('not_approved', 'new_replies', 'old_topic', 'need_qr_verification', 'no_subject');
 
-	call_integration_hook('integrate_post_errors', array($post_errors, $minor_errors));
+	call_integration_hook('integrate_post_errors', array(&$post_errors, &$minor_errors));
 
 	// Any errors occurred?
 	if (!empty($post_errors))

+ 2 - 2
Sources/Profile-Modify.php

@@ -690,7 +690,7 @@ function loadProfileFields($force_reload = false)
 		),
 	);
 
-	call_integration_hook('integrate_load_profile_fields', array($profile_fields));
+	call_integration_hook('integrate_load_profile_fields', array(&$profile_fields));
 
 	$disabled_fields = !empty($modSettings['disabled_profile_fields']) ? explode(',', $modSettings['disabled_profile_fields']) : array();
 	// For each of the above let's take out the bits which don't apply - to save memory and security!
@@ -1282,7 +1282,7 @@ function makeCustomFieldChanges($memID, $area, $sanitize = true)
 	}
 	$smcFunc['db_free_result']($request);
 
-	call_integration_hook('integrate_save_custom_profile_fields', array($changes, $log_changes, $memID, $area, $sanitize));
+	call_integration_hook('integrate_save_custom_profile_fields', array(&$changes, &$log_changes, $memID, $area, $sanitize));
 
 	// Make those changes!
 	if (!empty($changes) && empty($context['password_auth_failed']))

+ 1 - 1
Sources/Profile.php

@@ -598,7 +598,7 @@ function ModifyProfile($post_errors = array())
 			saveProfileChanges($profile_vars, $post_errors, $memID);
 		}
 
-		call_integration_hook('integrate_profile_save', array($profile_vars, $post_errors, $memID));
+		call_integration_hook('integrate_profile_save', array(&$profile_vars, &$post_errors, $memID));
 
 		// There was a problem, let them try to re-enter.
 		if (!empty($post_errors))

+ 2 - 2
Sources/Search.php

@@ -1761,11 +1761,11 @@ function PlushSearch2()
 			$posters[] = $row['id_member'];
 		$smcFunc['db_free_result']($request);
 
+		call_integration_hook('integrate_search_message_list', array(&$msg_list, &$posters));
+
 		if (!empty($posters))
 			loadMemberData(array_unique($posters));
 
-		call_integration_hook('integrate_search_message_list', array($msg_list, $posters));
-
 		// Get the messages out for the callback - select enough that it can be made to look just like Display.
 		$messages_request = $smcFunc['db_query']('', '
 			SELECT

+ 3 - 3
Sources/Security.php

@@ -454,7 +454,7 @@ function banPermissions()
 			'remove_own', 'remove_any',
 			'post_unapproved_topics', 'post_unapproved_replies_own', 'post_unapproved_replies_any',
 		);
-		call_integration_hook('integrate_post_ban_permissions', array($denied_permissions));
+		call_integration_hook('integrate_post_ban_permissions', array(&$denied_permissions));
 		$user_info['permissions'] = array_diff($user_info['permissions'], $denied_permissions);
 	}
 	// Are they absolutely under moderation?
@@ -467,7 +467,7 @@ function banPermissions()
 			'post_reply_any' => 'post_unapproved_replies_any',
 			'post_attachment' => 'post_unapproved_attachments',
 		);
-		call_integration_hook('integrate_warn_permissions', array($permission_change));
+		call_integration_hook('integrate_warn_permissions', array(&$permission_change));
 		foreach ($permission_change as $old => $new)
 		{
 			if (!in_array($old, $user_info['permissions']))
@@ -1195,7 +1195,7 @@ function spamProtection($error_type)
 		'reporttm' => $modSettings['spamWaitTime'] * 4,
 		'search' => !empty($modSettings['search_floodcontrol_time']) ? $modSettings['search_floodcontrol_time'] : 1,
 	);
-	call_integration_hook('integrate_spam_protection', array($timeOverrides));
+	call_integration_hook('integrate_spam_protection', array(&$timeOverrides));
 
 	// Moderators are free...
 	if (!allowedTo('moderate_board'))

+ 1 - 1
Sources/Subs-Editor.php

@@ -2166,7 +2166,7 @@ function AutoSuggestHandler($checkRegistered = null)
 		'versions' => 'SMFVersions',
 	);
 
-	call_integration_hook('integrate_autosuggest', array($searchTypes));
+	call_integration_hook('integrate_autosuggest', array(&$searchTypes));
 
 	// If we're just checking the callback function is registered return true or false.
 	if ($checkRegistered != null)

+ 1 - 2
Sources/Subs-Membergroups.php

@@ -564,12 +564,11 @@ function addMembersToGroup($members, $group, $type = 'auto', $permissionCheckDon
 	updateStats('postgroups', $members);
 
 	// Log the data.
-	$log_inserts = array();
 	require_once($sourcedir . '/Logging.php');
 	foreach ($members as $member)
 		logAction('added_to_group', array('group' => $group_names[$group], 'member' => $member), 'admin');
 
-	call_integration_hook('integrate_add_members_to_group', array($log_inserts));
+	call_integration_hook('integrate_add_members_to_group');
 
 	return true;
 }

+ 1 - 1
Sources/Subs-Members.php

@@ -1173,7 +1173,7 @@ function reattributePosts($memID, $email = false, $membername = false, $post_cou
 	);
 
 	// Allow mods with their own post tables to reattribute posts as well :)
- 	call_integration_hook('integrate_reattribute_posts', array(&$memID, &$email, &$membername, &$post_count));
+ 	call_integration_hook('integrate_reattribute_posts', array($memID, $email, $membername, $post_count));
 }
 
 /**

+ 1 - 1
Sources/Subs.php

@@ -338,7 +338,7 @@ function updateMemberData($members, $data)
 
 			if (!empty($member_names))
 				foreach ($vars_to_integrate as $var)
-					call_integration_hook('integrate_change_member_data', array($member_names, $var, $data[$var], $knownInts, $knownFloats));
+					call_integration_hook('integrate_change_member_data', array($member_names, $var, &$data[$var], &$knownInts, &$knownFloats));
 		}
 	}