throw new Horde_Auth_Exception($e->getMessage());
}
- if (!empty($_SESSION['imp']['logintasks'])) {
- self::_loginTasks();
- }
-
return $retval;
}
* 'imap' -- Config for various IMAP resources (acl, admin,
* namespace, quota)
* 'imap_ob' -- The serialized Horde_Imap_Client object.
- * 'logintasks' -- Have the login tasks been completed?
* 'maildomain' -- See config/servers.php.
* 'notepadavail' -- Is listing of notepads available?
* 'protocol' -- Either 'imap' or 'pop'.
$_SESSION['imp'] = array(
'cache' => array(),
'imap' => array(),
- 'logintasks' => false,
'server_key' => $credentials['server'],
'showunsub' => false
);
/* Set up search information for the session. */
$GLOBALS['imp_search']->sessionSetup();
- IMP_Auth::logMessage('login', __FILE__, __LINE__, PEAR_LOG_NOTICE);
- }
-
- /**
- * Perform IMP login tasks.
- */
- static protected function _loginTasks()
- {
- /* Do login tasks. */
- $tasks = Horde_LoginTasks::singleton('imp', Horde::selfUrl(true, true, true));
- $tasks->runTasks();
-
/* If the user wants to run filters on login, make sure they get
run. */
if ($GLOBALS['prefs']->getValue('filter_on_login')) {
$imp_compose = IMP_Compose::singleton();
$imp_compose->recoverSessionExpireDraft();
- $_SESSION['imp']['logintasks'] = true;
+ IMP_Auth::logMessage('login', __FILE__, __LINE__, PEAR_LOG_NOTICE);
}
/**
/* Initialize Kronolith session if we don't have one */
if (!isset($_SESSION['kronolith_session'])) {
$_SESSION['kronolith_session'] = array();
- self::loginTasksFlag(1);
}
/* Fetch display preferences. */
}
/**
- * Either sets or checks the value of the logintasks flag.
- *
- * @param integer $set The value of the flag.
- *
- * @return integer The value of the flag.
- * 0 = No login tasks pending
- * 1 = Login tasks pending
- * 2 = Login tasks pending, previous tasks interrupted
- */
- public static function loginTasksFlag($set = null)
- {
- if (($set !== null)) {
- $_SESSION['kronolith_session']['_logintasks'] = $set;
- }
-
- return isset($_SESSION['kronolith_session']['_logintasks']) ?
- $_SESSION['kronolith_session']['_logintasks'] : 0;
- }
-
- /**
* Returns the real name, if available, of a user.
*/
public static function getUserName($uid)
$GLOBALS['kronolith_shares'] = Horde_Share::singleton($registry->getApp());
Kronolith::initialize();
-
-// TODO - Maintenance operations need to be refactored to a more global
-// operation and then we can get rid of these hackish checks
-/* Do login tasks - need to check for a number of conditions to be
- * sure that we aren't here due to alarm notifications (which would occur after
- * headers are sent), we aren't on any of the portal pages, and that we haven't
- * already performed login tasks.
- */
-if (empty($no_maint) && Kronolith::loginTasksFlag() &&
- !strstr($_SERVER['PHP_SELF'], 'maintenance.php') &&
- !headers_sent() && !defined('AUTH_HANDLER')) {
- Kronolith::loginTasksFlag(2);
-
- $tasks = Horde_LoginTasks::singleton('kronolith', Horde_Util::addParameter(Horde::selfUrl(true, true, true), array('logintasks_done' => true)));
- $tasks->runTasks();
-
- Kronolith::loginTasksFlag(0);
-} elseif (Horde_Util::getFormData('logintasks_done') &&
- Kronolith::loginTasksFlag()) {
- $tasks = Horde_LoginTasks::singleton('kronolith', Horde_Util::addParameter(Horde::selfUrl(true, true, true), array('logintasks_done' => true)));
- $tasks->runTasks();
-
- Kronolith::loginTasksFlag(0);
-}
/**
* Turba base inclusion file.
*
- * The following global variables are used:
- * $turba_no_maintenance - Don't perform maintenance tasks.
- *
* This file brings in all of the dependencies that every Turba script will
* need, and sets up objects that all scripts use.
*/
$GLOBALS['cfgSources'] = Turba::permissionsFilter($GLOBALS['cfgSources']);
$GLOBALS['attributes'] = $attributes;
-// Check for any login tasks needed. Don't need a URL argument since we will
-// never redirect to the confirmation screen.
-if (empty($_SESSION['turba']['maintenance']) &&
- !Horde_Util::nonInputVar('turba_no_maintenance')) {
- $tasks = Horde_LoginTasks::singleton('turba', null);
- $tasks->runTasks();
- $_SESSION['turba']['maintenance'] = true;
-}
-
// Build the directory sources select widget.
$default_source = Horde_Util::nonInputVar('source');
if (empty($default_source)) {
$this->assertTrue($world['auth']->authenticate('wrobel@example.org',
array('password' => 'none')));
- // Disable maintenance
- $GLOBALS['turba_no_maintenance'] = true;
+ // TODO: Disable maintenance
$GLOBALS['registry']->pushApp('turba');
// Find the base file path of Turba.