diff --git a/core/userrights.class.inc.php b/core/userrights.class.inc.php index 1dbb563e8..77e66b510 100644 --- a/core/userrights.class.inc.php +++ b/core/userrights.class.inc.php @@ -308,7 +308,7 @@ abstract class User extends cmdbAbstractObject if (count($aOrgs) > 0) { // Check that the modified User belongs to one of our organization - if (!in_array($this->GetOriginal('org_id'), $aOrgs) || !in_array($this->Get('org_id'), $aOrgs)) + if (!in_array($this->GetOriginal('org_id'), $aOrgs) && !in_array($this->Get('org_id'), $aOrgs)) { $this->m_aCheckIssues[] = Dict::Format('Class:User/Error:UserOrganizationNotAllowed'); } diff --git a/sources/application/search/searchform.class.inc.php b/sources/application/search/searchform.class.inc.php index 5705ca6d5..edcad8aac 100644 --- a/sources/application/search/searchform.class.inc.php +++ b/sources/application/search/searchform.class.inc.php @@ -562,6 +562,12 @@ class SearchForm foreach($aContextParams as $sParamCode => $sParamValue) { + // Check that the code exists in the concerned class + if (!MetaModel::IsValidAttCode($oSearch->GetClass(), $sParamCode)) + { + continue; + } + // Add Context criteria in read only mode $sAlias = $oSearch->GetClassAlias(); $oFieldExpression = new FieldExpression($sParamCode, $sAlias);