当前位置: 首页>>代码示例>>PHP>>正文


PHP api_Utils::RecRmdir方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:7,代码来源:storage.php

示例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;
//.........这里部分代码省略.........
开发者ID:Git-Host,项目名称:email,代码行数:101,代码来源:manager.php


注:本文中的api_Utils::RecRmdir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。