Esempio n. 1
0
 /**
  * @return array
  */
 public function AjaxMessageMove()
 {
     $sFromFolderFullNameRaw = (string) $this->getParamValue('Folder', '');
     $sToFolderFullNameRaw = (string) $this->getParamValue('ToFolder', '');
     $aUids = \ProjectCore\Base\Utils::ExplodeIntUids((string) $this->getParamValue('Uids', ''));
     if (0 === strlen(trim($sFromFolderFullNameRaw)) || 0 === strlen(trim($sToFolderFullNameRaw)) || !is_array($aUids) || 0 === count($aUids)) {
         throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\Notifications::InvalidInputParameter);
     }
     $oAccount = $this->getAccountFromParam();
     try {
         $this->oApiMail->moveMessage($oAccount, $sFromFolderFullNameRaw, $sToFolderFullNameRaw, $aUids);
     } catch (\MailSo\Imap\Exceptions\NegativeResponseException $oException) {
         $oResponse = $oException->GetLastResponse();
         throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\Notifications::CanNotMoveMessageQuota, $oException, $oResponse instanceof \MailSo\Imap\Response ? $oResponse->Tag . ' ' . $oResponse->StatusOrIndex . ' ' . $oResponse->HumanReadable : '');
     } catch (\Exception $oException) {
         throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\Notifications::CanNotMoveMessage, $oException, $oException->getMessage());
     }
     return $this->TrueResponse($oAccount, __FUNCTION__);
 }