/** * @return array */ public function AjaxUpdateIdentity() { $oAccount = $this->getAccountFromParam(); $iIdentityId = (int) $this->getParamValue('IdIdentity', 0); $oIdentity = $this->oApiUsers->GetIdentity($iIdentityId); if (0 >= $iIdentityId || !$oIdentity || $oIdentity->IdUser !== $oAccount->IdUser || $oIdentity->IdAccount !== $oAccount->IdAccount) { throw new \ProjectSeven\Exceptions\ClientException(\ProjectSeven\Notifications::InvalidInputParameter); } $oIdentity->Enabled = '1' === (string) $this->getParamValue('Enabled', '1'); $oIdentity->Email = trim((string) $this->getParamValue('Email', '')); $oIdentity->Signature = (string) $this->getParamValue('Signature', ''); $oIdentity->UseSignature = '1' === (string) $this->getParamValue('UseSignature', '0'); $oIdentity->FriendlyName = (string) $this->getParamValue('FriendlyName', ''); return $this->DefaultResponse($oAccount, __FUNCTION__, $this->oApiUsers->UpdateIdentity($oIdentity)); }