}
$curr_acl = $ACLDriver->getACL($folder);
-$canEdit = $ACLDriver->canEdit($folder, $_SESSION['imp']['uniquser']);
+$canEdit = $ACLDriver->canEdit($folder, Horde_Auth::getAuth());
require_once 'Horde/Prefs/UI.php';
$hidden = array(
'actionID' => '',
- 'user' => $_SESSION['imp']['uniquser'],
+ 'user' => Horde_Auth::getAuth(),
'compose_requestToken' => Horde::getRequestToken('imp.compose'),
'compose_formToken' => Horde_Token::generateId('compose'),
'composeCache' => $composeCacheID,
* have an effect. By default, IMAP messages are output in the IMAP
* server default language. (IMAP only)
*
- * realm: (string) ONLY USE REALM IF YOU ARE USING IMP FOR HORDE
- * AUTHENTICATION, YOU HAVE MULTIPLE SERVERS, AND USERNAMES OVERLAP
- * BETWEEN THOSE SERVERS.
- *
- * If you only have one server, or have multiple servers with no
- * username clashes, or have full user@example.com usernames, you DO
- * NOT need a realm setting. If realm is set, a '@' symbol plus the
- * realm value will be appended to the username that users login to
- * IMP with to create the username that Horde treats the user as.
- *
- * Example: with a realm of 'example.com', the username 'jane' would
- * be treated by Horde (NOT your IMAP/POP server) as 'jane@example.com',
- * and the username 'jane@example.com' would be treated as
- * 'jane@example.com@example.com' - an occasion where you probably
- * don't need a realm setting.
- *
* preferred: (string) Only useful if you want to use the same servers.php file
* for different machines: if the hostname of the IMP machine is
* identical to one of those in the preferred list, then the
supported.
+Server Options
+--------------
+
+The 'realm' option has been removed. Altering usernames at runtime should
+instead by accomplished by using Horde's authusername() and/or IMP's
+preauthenticate() hooks.
+
+
Configuration Options
---------------------
$_SESSION['imp']['cache']['select_view'] = empty($credentials['imp_select_view'])
? ''
: $credentials['imp_select_view'];
-
- /* Set the Horde ID, since it may have been altered by the 'realm'
- * setting. */
- $credentials['auth_ob']->setCredential('userId', $_SESSION['imp']['uniquser']);
}
}
break;
}
+ $auth_id = Horde_Auth::getAuth();
$imap_ob = $GLOBALS['imp_imap']->ob();
$msg = sprintf(
- $status_msg . ' for %s [%s]%s to {%s:%s [%s]}',
- empty($_SESSION['imp']['uniquser']) ? '' : $_SESSION['imp']['uniquser'],
+ $status_msg . '%s [%s]%s to {%s:%s [%s]}',
+ $auth_id ? '' : ' for ' . $auth_id,
$_SERVER['REMOTE_ADDR'],
empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? '' : ' (forwarded for [' . $_SERVER['HTTP_X_FORWARDED_FOR'] . '])',
$imap_ob ? $imap_ob->getParam('hostspec') : '',
* 'smtp' -- SMTP options ('host' and 'port')
* 'showunsub' -- Show unsusubscribed mailboxes on the folders screen.
* 'tasklistavail' -- Is listing of tasklists available?
- * 'uniquser' -- The unique user name.
* 'view' -- The imp view mode (currently dimp, imp, or mimp)
*
* @param array $credentials An array of login credentials.
throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
}
- /* Determine the unique user name. */
- if (Horde_Auth::getAuth()) {
- $_SESSION['imp']['uniquser'] = Horde_Auth::getOriginalAuth();
- } else {
- $_SESSION['imp']['uniquser'] = $credentials['userId'];
- if (!empty($ptr['realm'])) {
- $_SESSION['imp']['uniquser'] .= '@' . $ptr['realm'];
- }
- }
-
/* Try authentication. */
try {
self::authenticate(array(
}
}
- $entry = sprintf("%s Message sent to %s from %s", $_SERVER['REMOTE_ADDR'], $recipients, $_SESSION['imp']['uniquser']);
+ $entry = sprintf("%s Message sent to %s from %s", $_SERVER['REMOTE_ADDR'], $recipients, Horde_Auth::getAuth());
Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_INFO);
/* Should we save this message in the sent mail folder? */
return;
}
- $filename = hash('md5', $_SESSION['imp']['uniquser']);
+ $filename = hash('md5', Horde_Auth::getAuth());
$vfs = VFS::singleton($GLOBALS['conf']['vfs']['type'], Horde::getDriverConfig('vfs', $GLOBALS['conf']['vfs']['type']));
if ($vfs->exists(self::VFS_DRAFTS_PATH, $filename)) {
$data = $vfs->read(self::VFS_DRAFTS_PATH, $filename);
if (!is_null($from_line)) {
$spam_headers->addHeader('From', $from_line);
}
- $spam_headers->addHeader('Subject', sprintf(_("%s report from %s"), $action, $_SESSION['imp']['uniquser']));
+ $spam_headers->addHeader('Subject', sprintf(_("%s report from %s"), $action, Horde_Auth::getAuth()));
/* Send the message. */
try {
}
$entry = sprintf("%s Redirected message sent to %s from %s",
- $_SERVER['REMOTE_ADDR'], $recipients, $_SESSION['imp']['uniquser']);
+ $_SERVER['REMOTE_ADDR'], $recipients, Horde_Auth::getAuth());
Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_INFO);
if ($GLOBALS['conf']['sentmail']['driver'] != 'none') {