From 59154d428a5a36f9552263372be51d826a520b91 Mon Sep 17 00:00:00 2001
From: Bob Vincent <bobvin@pillars.net>
Date: Sat, 14 Apr 2012 08:37:53 -0400
Subject: [PATCH] Issue #1533026 by pillarsdotnet: Call user_module_invoke()
 instead of module_invoke_all('user').

---
 countryban.module |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/countryban.module b/countryban.module
index d736ce535cd262d7cf5b55d972113bd477817b87..be76876fd18086c2341eb7851e00bf88b5da3c9f 100644
--- a/countryban.module
+++ b/countryban.module
@@ -344,7 +344,9 @@ function countryban_user($op, &$edit, &$account, $category = NULL)  {
       case 'login':
         if ( ($banvalue == 1) || ($banvalue == 2) ) {
           // Destroy the current session:
-          module_invoke_all('user', 'logout', NULL, $user);
+          // The $edit parameter to hook_user() must be an array reference.
+          $edit = array();
+          user_module_invoke('logout', $edit, $user);
           // Load the anonymous user
           $user = drupal_anonymous_user();
           drupal_set_message(variable_get('countryban_readonly', "Accounts Disabled."));
@@ -355,7 +357,9 @@ function countryban_user($op, &$edit, &$account, $category = NULL)  {
         if ($banvalue == 2) {
           // Destroy the current session:
           session_destroy();
-          module_invoke_all('user', 'logout', NULL, $user);
+          // The $edit parameter to hook_user() must be an array reference.
+          $edit = array();
+          user_module_invoke('logout', $edit, $user);
           // Load the anonymous user
           $user = drupal_anonymous_user();
           drupal_set_message(variable_get('countryban_completeban', "Access Denied."), 'error');
-- 
1.7.9.5

