本文整理汇总了PHP中api_Utils::RecRmdir方法的典型用法代码示例。如果您正苦于以下问题:PHP api_Utils::RecRmdir方法的具体用法?PHP api_Utils::RecRmdir怎么用?PHP api_Utils::RecRmdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api_Utils
的用法示例。
在下文中一共展示了api_Utils::RecRmdir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ClearPrivateFiles
public function ClearPrivateFiles($oAccount)
{
if ($oAccount) {
$sRootPath = $this->getRootPath($oAccount, \EFileStorageTypeStr::Personal, true);
api_Utils::RecRmdir($sRootPath);
}
}
示例2: deleteAccount
/**
* Deletes account from WebMail Pro database.
*
* @api
*
* @param CAccount $oAccount Object instance with prepopulated account properties.
*
* @return bool
*/
public function deleteAccount($oAccount)
{
$bResult = false;
try {
if (!$oAccount) {
$this->setLastException(new CApiManagerException(Errs::Main_UnknownError));
return false;
}
if ($oAccount->IsDefaultAccount) {
if (0 === $oAccount->IdTenant && \strtolower($oAccount->Email) === \strtolower($this->oSettings->GetConf('Helpdesk/AdminEmailAccount'))) {
$this->setLastException(new CApiManagerException(Errs::HelpdeskManager_AccountCannotBeDeleted));
return false;
} else {
if (0 < $oAccount->IdTenant) {
$oApiTenantsManager = CApi::Manager('tenants');
/* @var $oApiTenantsManager CApiTenantsManager */
if ($oApiTenantsManager) {
$oTenant = $oApiTenantsManager->getTenantById($oAccount->IdTenant);
/* @var $oTenant CTenant */
if (\strtolower($oAccount->Email) === $oTenant->HelpdeskAdminEmailAccount) {
$this->setLastException(new CApiManagerException(Errs::HelpdeskManager_AccountCannotBeDeleted));
return false;
}
}
}
}
}
if ($oAccount && $this->oStorage->deleteAccount($oAccount->IdAccount)) {
if ($oAccount->IsInternal) {
/* @var $oApiMailSuiteManager CApiMailSuiteManager */
$oApiMailSuiteManager = CApi::Manager('mailsuite');
if ($oApiMailSuiteManager) {
$oApiMailSuiteManager->deleteMailAliases($oAccount);
$oApiMailSuiteManager->deleteMailForwards($oAccount);
$oApiMailSuiteManager->deleteMailDir($oAccount);
}
}
if ($oAccount->IsDefaultAccount) {
/* @var $oApiContactsManager CApiContactsManager */
$oApiContactsManager = CApi::Manager('contacts');
if ($oApiContactsManager) {
$oApiContactsManager->clearAllContactsAndGroups($oAccount);
}
/* @var $oApiCalendarManager CApiCalendarManager */
$oApiCalendarManager = CApi::Manager('calendar');
if ($oApiCalendarManager) {
$oApiCalendarManager->clearAllCalendars($oAccount);
}
/* @var $oApiDavManager CApiDavManager */
$oApiDavManager = CApi::Manager('dav');
if ($oApiDavManager) {
$oApiDavManager->deletePrincipal($oAccount);
}
/* @var $oApiFilestorageManager CApiFilestorageManager */
$oApiFilestorageManager = CApi::Manager('filestorage');
if ($oApiFilestorageManager) {
$oApiFilestorageManager->clearAllFiles($oAccount);
}
/* @var $oApiSocialManager CApiSocialManager */
$oApiSocialManager = CApi::Manager('social');
if ($oApiSocialManager) {
$oApiSocialManager->deleteSocialByAccountId($oAccount->IdAccount);
}
if (0 < $oAccount->User->IdHelpdeskUser) {
/* @var $oApiHelpdeskManager CApiHelpdeskManager */
$oApiHelpdeskManager = CApi::Manager('helpdesk');
if ($oApiHelpdeskManager) {
//$oApiHelpdeskManager->setUserAsBlocked($oAccount->IdTenant, $oAccount->User->IdHelpdeskUser);
$oApiHelpdeskManager->deleteUser($oAccount->IdTenant, $oAccount->User->IdHelpdeskUser);
}
}
}
CApi::Log('FS: Delete "/mail/" and "/temp/" folders');
// TODO move in storage
$sMailRoot = CApi::DataPath() . '/mail/';
$sTmpRoot = CApi::DataPath() . '/temp/';
$sPath = strtolower($oAccount->Email . '.' . $oAccount->IdAccount);
$sPath = $sPath[0] . '/' . $sPath;
api_Utils::RecRmdir($sMailRoot . $sPath);
api_Utils::RecRmdir($sTmpRoot . $sPath);
$bResult = true;
} else {
if (null === $oAccount) {
$this->setLastException(new CApiManagerException(Errs::UserManager_AccountDoesNotExist));
}
}
} catch (CApiBaseException $oException) {
$bResult = false;
$this->setLastException($oException);
}
return $bResult;
//.........这里部分代码省略.........