* Support for LIST-SUBSCRIBED capability.
[squirrelmail.git] / functions / abook_local_file.php
index 202d641da763db6a981c6c7af1f7bc3095ac6ac7..762377c3a09ee6835bd679ebead5ffc07ce140c6 100644 (file)
@@ -1,10 +1,10 @@
 <?php
+
 /**
  * abook_local_file.php
  *
- * Copyright (c) 1999-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
+ * @copyright &copy; 1999-2005 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  * @subpackage addressbook
@@ -361,16 +361,16 @@ class abook_local_file extends addressbook_backend {
         /* See if user exists already */
         $ret = $this->lookup($userdata['nickname']);
         if(!empty($ret)) {
-            return $this->set_error(sprintf(_("User %s already exists"),
-                        '&quot;' . $ret['nickname'] . '&quot;'));
+            // i18n: don't use html formating in translation
+            return $this->set_error(sprintf(_("User \"%s\" already exists"),$ret['nickname']));
         }
 
         /* Here is the data to write */
         $data = $this->quotevalue($userdata['nickname']) . '|' .
                 $this->quotevalue($userdata['firstname']) . '|' .
-                $this->quotevalue($userdata['lastname']) . '|' .
+                $this->quotevalue((!empty($userdata['lastname'])?$userdata['lastname']:'')) . '|' .
                 $this->quotevalue($userdata['email']) . '|' .
-                $this->quotevalue($userdata['label']);
+                $this->quotevalue((!empty($userdata['label'])?$userdata['label']:''));
 
         /* Strip linefeeds */
         $data = ereg_replace("[\r\n]", ' ', $data);
@@ -454,8 +454,8 @@ class abook_local_file extends addressbook_backend {
         /* See if user exists */
         $ret = $this->lookup($alias);
         if(empty($ret)) {
-            return $this->set_error(sprintf(_("User %s does not exist"),
-                        '&quot;' . $alias . '&quot;'));
+            // i18n: don't use html formating in translation
+            return $this->set_error(sprintf(_("User \"%s\" does not exist"),$alias));
         }
 
         /* Lock the file to make sure we're the only process working
@@ -476,9 +476,9 @@ class abook_local_file extends addressbook_backend {
             } else {
                 $rows[$i++] = array(0 => $userdata['nickname'],
                                     1 => $userdata['firstname'],
-                                    2 => $userdata['lastname'],
+                                    2 => (!empty($userdata['lastname'])?$userdata['lastname']:''),
                                     3 => $userdata['email'],
-                                    4 => $userdata['label']);
+                                    4 => (!empty($userdata['label'])?$userdata['label']:''));
             }
         }
 
@@ -507,4 +507,4 @@ class abook_local_file extends addressbook_backend {
     }
 
 } /* End of class abook_local_file */
-?>
\ No newline at end of file
+?>