<?php

/**
 * Provides a global endpoint for access to Zend_Cache
 *
 * @package Atmail
 * @subpackage Quota
 * @copyright Copyright (C) 2011 Atmail. All rights reserved.
 * @author Atmail
 */
class Atmail_Quota_Imap extends Atmail_Quota
{
	public $currentQuota = false;

	private function _getQuota()
	{
		$globalConfig = Zend_Registry::get('config')->global;
		$userData = Zend_Auth::getInstance()->getStorage()->read();
		$mailStoreConfig = array_merge($globalConfig, $userData, array(), Zend_Registry::get('UserSettings'));
		$AtmailMailStorage = Atmail_Mail_Storage::getInstance($mailStoreConfig);
		$AtmailMailStorageMain = &$AtmailMailStorage->getMailStore($mailStoreConfig['namespaceName']);
		$this->currentQuota = $AtmailMailStorageMain->getQuota();
	}

	public function _getUsedQuota()
	{
		throw new Exception(__METHOD__ . ": NOT IMPLEMENTED");
		return false;
	}

	public function _getTotalQuota()
	{
		$this->_getQuota();
		self::log(__METHOD__ . ": Quota = " . print_r($this->currentQuota, true));
		return $this->currentQuota;
	}
}
