/** * @return array */ public function AjaxAccountIdentityCreate() { $oAccount = $this->getAccountFromParam(); $sEmail = trim((string) $this->getParamValue('Email', '')); if (empty($sEmail)) { throw new \ProjectSeven\Exceptions\ClientException(\ProjectSeven\Notifications::InvalidInputParameter); } $oIdentity = new \CIdentity(); $oIdentity->IdAccount = $oAccount->IdAccount; $oIdentity->IdUser = $oAccount->IdUser; $oIdentity->Enabled = '1' === (string) $this->getParamValue('Enabled', '1'); $oIdentity->Email = $sEmail; $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->CreateIdentity($oIdentity)); }