From 5398097273290e0ca70999083bfaef91f4994fed Mon Sep 17 00:00:00 2001
From: eileen <eileen@fuzion.co.nz>
Date: Tue, 9 Jul 2013 12:02:52 +1200
Subject: [PATCH] CRM-13014 support userLoginFinalize() for UF classes (fix
 civimobile)

Conflicts:

	CRM/Utils/System/Base.php
---
 CRM/Utils/System/Base.php    |  9 +++++++++
 CRM/Utils/System/Drupal.php  | 10 ++++++++++
 CRM/Utils/System/Drupal6.php | 10 ++++++++++
 3 files changed, 29 insertions(+)

diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php
index 5f7f1b7859..f9b7d75d50 100644
--- a/CRM/Utils/System/Base.php
+++ b/CRM/Utils/System/Base.php
@@ -124,5 +124,14 @@ abstract class CRM_Utils_System_Base {
   function flush() {
     // nullop by default
   }
+
+  /**
+   * Perform any post login activities required by the CMD -
+   * e.g. for drupal: records a watchdog message about the new session, saves the login timestamp,
+   * calls hook_user op 'login' and generates a new session.
+   * @param array params Params to be passed to the CMS function.
+   */
+  function userLoginFinalize($params = array()){
+  }
 }
 
diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php
index c1652527aa..236814f636 100644
--- a/CRM/Utils/System/Drupal.php
+++ b/CRM/Utils/System/Drupal.php
@@ -652,6 +652,16 @@ AND    u.status = 1
     return TRUE;
   }
 
+  /**
+   * Perform any post login activities required by the UF -
+   * e.g. for drupal: records a watchdog message about the new session, saves the login timestamp,
+   * calls hook_user op 'login' and generates a new session.
+   * @param array params Params to be passed to the CMS function. Note there are no require params as drupal instantiates the user global
+   */
+  function userLoginFinalize($params = array()){
+    user_login_finalize($params);
+  }
+
   /**
    * Set a message in the UF to display to a user
    *
diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php
index e7a3dfe5e7..78a0cf4d00 100644
--- a/CRM/Utils/System/Drupal6.php
+++ b/CRM/Utils/System/Drupal6.php
@@ -583,6 +583,16 @@ SELECT name, mail
     return TRUE;
   }
 
+  /**
+   * Perform any post login activities required by the UF -
+   * e.g. for drupal : records a watchdog message about the new session,
+   * saves the login timestamp, calls hook_user op 'login' and generates a new session.
+   * @param array params Params to be passed to the CMS function. Note there are no require params as drupal instantiates the user global
+   */
+  function userLoginFinalize($params = array()) {
+    user_authenticate_finalize($params);
+  }
+
   /**
    * Set a message in the UF to display to a user
    *
-- 
GitLab