First attempt at placing logintasks in the proper place.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 22 Jul 2009 03:49:28 +0000 (21:49 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 22 Jul 2009 03:49:28 +0000 (21:49 -0600)
This is the only place guaranteed to run logintasks on both regular and
transparent auth. However, it may not be appropriate to run logintasks
if we are doing some kind of API call.  It might be better to simply run
all login tasks for all applications on initial login.

framework/Core/lib/Horde/Registry.php
framework/LoginTasks/lib/Horde/LoginTasks.php

index f74c050..dd5afd1 100644 (file)
@@ -854,6 +854,10 @@ class Horde_Registry
         /* Call post-push hook. */
         Horde::callHook('_horde_hook_post_pushapp', array($app), 'horde');
 
+        /* Do login tasks. */
+        $tasks = Horde_LoginTasks::singleton($app, Horde::selfUrl(true, true, true));
+        $tasks->runTasks();
+
         return true;
     }
 
index 4d084b8..43dc186 100644 (file)
@@ -130,7 +130,8 @@ class Horde_LoginTasks
         /* If this application handles Horde auth, need to add Horde tasks
          * here. */
         $app_list = array($this->_app);
-        if (strnatcasecmp($this->_app, Horde_Auth::getProvider()) === 0) {
+        if (($this->_app != 'horde') &&
+            !isset($_SESSION['horde_logintasks']['horde'])) {
             array_unshift($app_list, 'horde');
         }
 
@@ -236,8 +237,10 @@ class Horde_LoginTasks
         if (empty($need_display)) {
             $lasttasks = unserialize($GLOBALS['prefs']->getValue('last_logintasks'));
             $lasttasks[$this->_app] = time();
-            if (strnatcasecmp($this->_app, Horde_Auth::getProvider()) === 0) {
+            if (($this->_app != 'horde') &&
+                !isset($_SESSION['horde_logintasks']['horde'])) {
                 $lasttasks['horde'] = time();
+                $_SESSION['horde_logintasks']['horde'] = true;
             }
             $GLOBALS['prefs']->setValue('last_logintasks', serialize($lasttasks));