X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fabook_local_file.php;h=65ae8256f24372c3976c47a07577a4cf65e7d68a;hb=aa84daced451fe171b6b606939dba8df6bcab26c;hp=e9986c6e403082a9fc325958e8e710fc04c2f70f;hpb=6c99d1de81366bceab6c9d6cf12179eedc81f9bc;p=squirrelmail.git diff --git a/functions/abook_local_file.php b/functions/abook_local_file.php index e9986c6e..65ae8256 100644 --- a/functions/abook_local_file.php +++ b/functions/abook_local_file.php @@ -3,7 +3,7 @@ /** * abook_local_file.php * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright © 1999-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -512,7 +512,15 @@ class abook_local_file extends addressbook_backend { // i18n: don't use html formating in translation return $this->set_error(sprintf(_("User \"%s\" does not exist"),$alias)); } - + + /* If the alias changed, see if the new alias exists */ + if (strtolower($alias) != strtolower($userdata['nickname'])) { + $ret = $this->lookup($userdata['nickname']); + if (!empty($ret)) { + return $this->set_error(sprintf(_("User \"%s\" already exists"), $userdata['nickname'])); + } + } + /* Lock the file to make sure we're the only process working * on it. */ if(!$this->lock()) { @@ -571,5 +579,4 @@ class abook_local_file extends addressbook_backend { } return $value; } - -} /* End of class abook_local_file */ +}