public function getQuotaInfo() { $Size = 0; $aResult = \api_Utils::GetDirectorySize($this->path); if ($aResult && $aResult['size']) { $Size = (int) $aResult['size']; } return array($Size, 0); }
public function getFullQuotaInfo() { $iFreeSize = 0; $sRootPath = $this->getRootPath(\EFileStorageTypeStr::Personal); $aSize = \api_Utils::GetDirectorySize($sRootPath); $iUsageSize = (int) $aSize['size']; $sRootPath = $this->getRootPath(\EFileStorageTypeStr::Corporate); $aSize = \api_Utils::GetDirectorySize($sRootPath); $iUsageSize += (int) $aSize['size']; $oAccount = $this->getAccount(); if ($oAccount) { $oTenant = $this->getTenant(); if ($oTenant) { $iFreeSize = $oTenant->FilesUsageDynamicQuotaInMB * 1024 * 1024 - $iUsageSize; } } return array($iUsageSize, $iFreeSize); }
public function GetRealQuota($oAccount, $sType) { $iUsageSize = 0; $iFreeSize = 0; if ($oAccount) { $sRootPath = $this->getRootPath($oAccount, \EFileStorageTypeStr::Personal, true); $aSize = \api_Utils::GetDirectorySize($sRootPath); $iUsageSize += (int) $aSize['size']; $sRootPath = $this->getRootPath($oAccount, \EFileStorageTypeStr::Corporate, true); $aSize = \api_Utils::GetDirectorySize($sRootPath); $iUsageSize += (int) $aSize['size']; $oApiTenants = \CApi::Manager('tenants'); if ($oApiTenants) { $oTenant = $oApiTenants->GetTenantById($oAccount->IdTenant); if ($oTenant) { $iFreeSize = $oTenant->FilesUsageDynamicQuotaInMB * 1024 * 1024 - $iUsageSize; } } } return array($iUsageSize, $iFreeSize); }