N°1706 - Fix problem with user_manager profile

This commit is contained in:
Eric
2018-11-12 16:08:30 +01:00
parent 6f79c16ba0
commit c722d64850
2 changed files with 8 additions and 1 deletions

View File

@@ -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');
}

View File

@@ -480,6 +480,7 @@ class SearchForm
*
* @return array
* @throws \MissingQueryArgument
* @throws \Exception
*/
public function GetCriterion($oSearch, $aFields, $aArgs = array(), $bIsRemovable = true)
{
@@ -554,6 +555,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);