X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fabook_local_file.php;h=65ae8256f24372c3976c47a07577a4cf65e7d68a;hb=1a219da922df1afc87719d4e8d8110c65cf09446;hp=fb215e27c3f525b0f8551fb1119d24188ef28f37;hpb=7311c377a04c1d713fcf090e120a6ac4fa93940a;p=squirrelmail.git diff --git a/functions/abook_local_file.php b/functions/abook_local_file.php index fb215e27..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,6 +579,4 @@ class abook_local_file extends addressbook_backend { } return $value; } - -} /* End of class abook_local_file */ -?> +}