From 372c0835f7c26cbb23c456e5dcfef21a9d41e4ba Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 16 Sep 2014 10:16:10 +0000 Subject: [PATCH] #988 Could not change the case of a login (cosmetic improvement to make sure this piece of code is the right example that can be shared amongst the developpers community) SVN:trunk[3342] --- core/userrights.class.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/userrights.class.inc.php b/core/userrights.class.inc.php index d9a3b22fd..5a42ccbdc 100644 --- a/core/userrights.class.inc.php +++ b/core/userrights.class.inc.php @@ -238,6 +238,10 @@ abstract class User extends cmdbAbstractObject { $sNewLogin = $aChanges['login']; $oSearch = DBObjectSearch::FromOQL_AllData("SELECT User WHERE login = :newlogin"); + if (!$this->IsNew()) + { + $oSearch->AddCondition('id', $this->GetKey(), '!='); + } $oSet = new DBObjectSet($oSearch, array(), array('newlogin' => $sNewLogin)); if ($oSet->Count() > 0) { @@ -251,7 +255,6 @@ abstract class User extends cmdbAbstractObject { $this->m_aCheckIssues[] = Dict::Format('Class:User/Error:AtLeastOneProfileIsNeeded'); } - } function GetGrantAsHtml($sClass, $iAction)