Fix get_identities() for the case where the user has not set an email
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 22 May 2005 13:43:28 +0000 (13:43 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 22 May 2005 13:43:28 +0000 (13:43 +0000)
address: use the fallback $username@$domain that's used in compose aswell.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9437 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/identity.php

index 31e11c554e5bcb5d8b8b402ea944dacc4fd2c219..197077c52500f9371625a0ae58793cac020dd704 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -353,7 +353,9 @@ Version 1.5.1 -- CVS
   - Added peardb backend to change_password plugin.
   - Tweak IMAP connection error display (#1203154).
   - Gracefully recover from over quota error while sending a mail (#1145144).
   - Added peardb backend to change_password plugin.
   - Tweak IMAP connection error display (#1203154).
   - Gracefully recover from over quota error while sending a mail (#1145144).
-
+  - Fix get_identities() for the case where the user has not set an email
+    address: use the fallback $username@$domain that's used in compose aswell.
+    
 Version 1.5.0 - 2 February 2004
 -------------------------------
   - Added new preference that determines cursor focus when replying
 Version 1.5.0 - 2 February 2004
 -------------------------------
   - Added new preference that determines cursor focus when replying
index 65331253e82cf9e47e38406edbc81ad6fca228bb..b3538c69386b539b7efa135a8b6a799c2897613d 100644 (file)
@@ -26,17 +26,20 @@ include_once(SM_PATH . 'include/load_prefs.php');
 */
 function get_identities() {
 
 */
 function get_identities() {
 
-    global $username, $data_dir;
+    global $username, $data_dir, $domain;
+
+    $em = getPref($data_dir,$username,'email_address');
+    if ( ! $em )  $em = $username.'@'.$domain;
 
 
-    $num_ids = getPref($data_dir,$username,'identities');
     $identities = array();
     /* We always have this one, even if the user doesn't use multiple identities */
     $identities[] = array('full_name' => getPref($data_dir,$username,'full_name'),
     $identities = array();
     /* We always have this one, even if the user doesn't use multiple identities */
     $identities[] = array('full_name' => getPref($data_dir,$username,'full_name'),
-        'email_address' => getPref($data_dir,$username,'email_address'),
+        'email_address' => $em,
         'reply_to' => getPref($data_dir,$username,'reply_to'),
         'signature' => getSig($data_dir,$username,'g'),
         'index' => 0 );
 
         'reply_to' => getPref($data_dir,$username,'reply_to'),
         'signature' => getSig($data_dir,$username,'g'),
         'index' => 0 );
 
+    $num_ids = getPref($data_dir,$username,'identities');
     /* If there are any others, add them to the array */
     if (!empty($num_ids) && $num_ids > 1) {
         for ($i=1;$i<$num_ids;$i++) {
     /* If there are any others, add them to the array */
     if (!empty($num_ids) && $num_ids > 1) {
         for ($i=1;$i<$num_ids;$i++) {
@@ -51,4 +54,4 @@ function get_identities() {
     return $identities;
 }
 
     return $identities;
 }
 
-?>
\ No newline at end of file
+?>