/** * @return array $limits */ public function getLimits() { $l = array(Scalr_Limits::ACCOUNT_ENVIRONMENTS, Scalr_Limits::ACCOUNT_FARMS, Scalr_Limits::ACCOUNT_SERVERS, Scalr_Limits::ACCOUNT_USERS); $limits = array(); foreach ($l as $limitName) { $limit = Scalr_Limits::init()->Load($limitName, $this->id); $limits[$limitName] = array('limit' => $limit->getLimitValue(), 'usage' => $limit->getCurrentUsage()); } return $limits; }
public function getAccount() { $account = Scalr_Account::init()->loadById($this->getParam(self::CALL_PARAM_NAME)); $result = array('id' => $account->id, 'name' => $account->name, 'comments' => $account->comments, 'limitEnv' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_ENVIRONMENTS, $account->id)->getLimitValue(), 'limitFarms' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_FARMS, $account->id)->getLimitValue(), 'limitServers' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_SERVERS, $account->id)->getLimitValue(), 'limitUsers' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_USERS, $account->id)->getLimitValue()); if ($this->getContainer()->config->get('scalr.auth_mode') == 'ldap') { $result['ownerEmail'] = $account->getOwner()->getEmail(); } $result['ccs'] = []; if ($this->getContainer()->analytics->enabled) { foreach (AccountCostCenterEntity::findByAccountId($account->id) as $accountCcsEntity) { $result['ccs'][] = $accountCcsEntity->ccId; } } return $result; }
public function getAccount() { $account = Scalr_Account::init()->loadById($this->getParam(self::CALL_PARAM_NAME)); $result = array('id' => $account->id, 'name' => $account->name, 'comments' => $account->comments, 'limitEnv' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_ENVIRONMENTS, $account->id)->getLimitValue(), 'limitFarms' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_FARMS, $account->id)->getLimitValue(), 'limitServers' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_SERVERS, $account->id)->getLimitValue(), 'limitUsers' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_USERS, $account->id)->getLimitValue()); if ($this->getContainer()->config->get('scalr.auth_mode') == 'ldap') { $result['ownerEmail'] = $account->getOwner()->getEmail(); } return $result; }
public function buyEnvironmentsAction() { $limit = Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_ENVIRONMENTS, $this->user->getAccountId()); $this->response->page('ui/billing/buyEnvironments.js', array('currentLimit' => $limit->getLimitValue())); }
public function getAccount() { $account = Scalr_Account::init()->loadById($this->getParam(self::CALL_PARAM_NAME)); return array('id' => $account->id, 'name' => $account->name, 'comments' => $account->comments, 'limitEnv' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_ENVIRONMENTS, $account->id)->getLimitValue(), 'limitFarms' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_FARMS, $account->id)->getLimitValue(), 'limitServers' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_SERVERS, $account->id)->getLimitValue(), 'limitUsers' => Scalr_Limits::init()->Load(Scalr_Limits::ACCOUNT_USERS, $account->id)->getLimitValue()); }