Merge branch 'saas' into saas-paginagte-rest-media-index-action

This commit is contained in:
drigato 2015-03-05 14:27:32 -05:00
commit 7607888257
2 changed files with 9 additions and 5 deletions

View file

@ -60,8 +60,7 @@ class Amazon_S3StorageBackend extends StorageBackend
public function getFilePrefix() public function getFilePrefix()
{ {
$clientCurrentAirtimeProduct = Billing::getClientCurrentAirtimeProduct(); $hostingId = Billing::getClientInstanceId();
$hostingId = $clientCurrentAirtimeProduct["id"];
return substr($hostingId, -2)."/".$hostingId; return substr($hostingId, -2)."/".$hostingId;
} }
} }

View file

@ -14,8 +14,13 @@ class Billing
/** Get the Airtime instance ID of the instance the customer is currently viewing. */ /** Get the Airtime instance ID of the instance the customer is currently viewing. */
public static function getClientInstanceId() public static function getClientInstanceId()
{ {
$currentProduct = Billing::getClientCurrentAirtimeProduct(); #$currentProduct = Billing::getClientCurrentAirtimeProduct();
return $currentProduct["id"]; #return $currentProduct["id"];
//XXX: Major hack attack. Since this function gets called often, rather than querying WHMCS
// we're just going to extract it from airtime.conf since it's the same as the rabbitmq username.
$CC_CONFIG = Config::getConfig();
$instanceId = $CC_CONFIG['rabbitmq']['username'];
return $instanceId;
} }
public static function getProducts() public static function getProducts()
@ -318,4 +323,4 @@ class Billing
$result = Billing::makeRequest($credentials["url"], $query_string); $result = Billing::makeRequest($credentials["url"], $query_string);
} }
} }