SAAS-1229 - add default bandwidth limit values

This commit is contained in:
Duncan Sommerville 2015-11-25 15:04:45 -05:00
parent 82544f34d9
commit 3f241b2f25
2 changed files with 45 additions and 1 deletions

View file

@ -1591,7 +1591,14 @@ class Application_Model_Preference
public static function getBandwidthLimit() {
$val = self::getValue("bandwidth_limit");
return empty($val) ? 0 : $val;
if (empty($val)) {
// Set and return the plan defaults
// TODO: remove this once all existing customers have this pref set
$planType = self::GetPlanLevel();
$val = Billing::$PLAN_TYPE_DEFAULTS[$planType]["bandwidth_limit"];
self::setBandwidthLimit($val);
}
return $val;
}
public static function setBandwidthLimit($value) {