<?php
+
/**
* abook_database.php
*
- * Copyright (c) 1999-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
* @subpackage addressbook
/* See if user exist already */
$ret = $this->lookup($userdata['nickname']);
if (!empty($ret)) {
- return $this->set_error(sprintf(_("User %s already exists"),
- '"' . $ret['nickname'] . '"'));
+ return $this->set_error(sprintf(_("User \"%s\" already exists"),$ret['nickname']));
}
/* Create query */
$this->table, $this->owner,
$this->dbh->quoteString($userdata['nickname']),
$this->dbh->quoteString($userdata['firstname']),
- $this->dbh->quoteString($userdata['lastname']),
+ $this->dbh->quoteString((!empty($userdata['lastname'])?$userdata['lastname']:'')),
$this->dbh->quoteString($userdata['email']),
- $this->dbh->quoteString($userdata['label']) );
+ $this->dbh->quoteString((!empty($userdata['label'])?$userdata['label']:'')) );
/* Do the insert */
$r = $this->dbh->simpleQuery($query);
/* See if user exist */
$ret = $this->lookup($alias);
if (empty($ret)) {
- return $this->set_error(sprintf(_("User %s does not exist"),
- '&qout;' . $alias . '&qout;'));
+ return $this->set_error(sprintf(_("User \"%s\" does not exist"),$alias));
}
/* Create query */
$this->table,
$this->dbh->quoteString($userdata['nickname']),
$this->dbh->quoteString($userdata['firstname']),
- $this->dbh->quoteString($userdata['lastname']),
+ $this->dbh->quoteString((!empty($userdata['lastname'])?$userdata['lastname']:'')),
$this->dbh->quoteString($userdata['email']),
- $this->dbh->quoteString($userdata['label']),
+ $this->dbh->quoteString((!empty($userdata['label'])?$userdata['label']:'')),
$this->owner,
$this->dbh->quoteString($alias) );
} /* End of class abook_database */
// vim: et ts=4
-?>
\ No newline at end of file
+?>