Esempio n. 1
0
 /**
  * @return array
  */
 public function AjaxAccountIdentityCreate()
 {
     $oAccount = $this->getAccountFromParam();
     $sEmail = trim((string) $this->getParamValue('Email', ''));
     if (empty($sEmail)) {
         throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\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));
 }