From 849164a1d414e4cacdb57c8091cd82565e1bd58b Mon Sep 17 00:00:00 2001 From: stevetruckstuff Date: Tue, 15 Aug 2006 20:41:20 +0000 Subject: [PATCH] When modifying an entry, if the nick name is different, check that the new nick name doesn't exist in the address book. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11602 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/abook_local_file.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/functions/abook_local_file.php b/functions/abook_local_file.php index 1929226b..4b2b9a75 100644 --- a/functions/abook_local_file.php +++ b/functions/abook_local_file.php @@ -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()) { -- 2.25.1