public function AjaxFilesRename() { $oAccount = $this->getDefaultAccountFromParam(); if (!$this->oApiCapability->isFilesSupported($oAccount)) { throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\Notifications::FilesNotAllowed); } $sType = $this->getParamValue('Type'); $sPath = $this->getParamValue('Path'); $sName = $this->getParamValue('Name'); $sNewName = $this->getParamValue('NewName'); $bIsLink = !!$this->getParamValue('IsLink'); $oResult = null; $sNewName = \trim(\MailSo\Base\Utils::ClearFileName($sNewName)); $sNewName = $this->oApiFilestorage->getNonExistingFileName($oAccount, $sType, $sPath, $sNewName); $oResult = $this->oApiFilestorage->rename($oAccount, $sType, $sPath, $sName, $sNewName, $bIsLink); return $this->DefaultResponse($oAccount, __FUNCTION__, $oResult); }