51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class provides OSB service task capabilities.
|
|
*
|
|
* @package OSB
|
|
* @subpackage Service
|
|
* @category Controllers/Task
|
|
* @author Deon George
|
|
* @copyright (c) 2010 Open Source Billing
|
|
* @license http://dev.osbill.net/license.html
|
|
*/
|
|
class Controller_Task_Service extends Controller_Template {
|
|
/**
|
|
* List all services by their default checkout method
|
|
*/
|
|
public function action_gettraffic() {
|
|
// @todo This things to collect traffic on needs to be configurable
|
|
foreach (array('ExetelVisp','ExetelHSPA','PeopleAgent','iiNetADSL') as $source) {
|
|
$traffic = Service_Traffic_ADSL::instance($source);
|
|
|
|
$traffic->update_traffic();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Charges for excess traffic usage
|
|
*/
|
|
public function action_chargetraffic() {
|
|
// @todo This things to collect traffic on needs to be configurable
|
|
foreach (array('ExetelVisp','ExetelHSPA','PeopleAgent','iiNetADSL') as $source) {
|
|
$traffic = Service_Traffic_ADSL::instance($source);
|
|
|
|
$traffic->charge_excess_traffic();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Send alerts to users when they exceed their traffic allowance
|
|
*/
|
|
public function action_alerttraffic() {
|
|
// @todo This things to collect traffic on needs to be configurable
|
|
foreach (array('ExetelVisp','ExetelHSPA','PeopleAgent','iiNetADSL') as $source) {
|
|
$traffic = Service_Traffic_ADSL::instance($source);
|
|
|
|
$traffic->alert_traffic();
|
|
}
|
|
}
|
|
}
|
|
?>
|