Browse Source

Bug #1219184.

Identity code wasn't checking username for domain portion, if email address
was not set, it re-appended domain name to username.
jangliss 20 years ago
parent
commit
5dbb3c0c19
2 changed files with 9 additions and 1 deletions
  1. 2 0
      ChangeLog
  2. 7 1
      functions/identity.php

+ 2 - 0
ChangeLog

@@ -362,6 +362,8 @@ Version 1.5.1 -- CVS
     508 or WAI fixes. Original idea and patch by dugan <at> passwall.com.
     508 or WAI fixes. Original idea and patch by dugan <at> passwall.com.
   - Fixed broken attachments caused by inconsistency of PHP chunk_split().
   - Fixed broken attachments caused by inconsistency of PHP chunk_split().
     Thanks to Roalt Zijlstra.
     Thanks to Roalt Zijlstra.
+  - Identity code was not checking for domain part in username before setting
+    email address (Bug #1219184).
 
 
 
 
 Version 1.5.0 - 2 February 2004
 Version 1.5.0 - 2 February 2004

+ 7 - 1
functions/identity.php

@@ -29,7 +29,13 @@ function get_identities() {
     global $username, $data_dir, $domain;
     global $username, $data_dir, $domain;
 
 
     $em = getPref($data_dir,$username,'email_address');
     $em = getPref($data_dir,$username,'email_address');
-    if ( ! $em )  $em = $username.'@'.$domain;
+    if ( ! $em ) {
+        if (strpos($username , '@') == false) {
+            $em = $username.'@'.$domain;
+        } else {
+            $em = $username;
+        }
+    }
 
 
     $identities = array();
     $identities = array();
     /* We always have this one, even if the user doesn't use multiple identities */
     /* We always have this one, even if the user doesn't use multiple identities */