Removed direct references to $_REQUEST and $_POST

This commit is contained in:
Deon George
2016-08-03 16:20:25 +10:00
parent 5f84d2c14f
commit 7adcd1d983
24 changed files with 85 additions and 85 deletions

View File

@@ -65,23 +65,23 @@ class Controller_Admin_Adsl extends Controller_Adsl {
public function action_edit() {
$apo = ORM::factory('Product_Plugin_Adsl',$this->request->param('id'));
if (! $qpo->loaded())
if (! $apo->loaded())
throw HTTP_Exception::factory(403,'Plan either doesnt exist, or you are not authorised to see it');
$this->meta->title = 'ADSL Plan: '.$qpo->name();
$this->meta->title = 'ADSL Plan: '.$apo->name();
$test_result = array();
if (! $apo->loaded())
HTTP::redirect(URL::link('admin','adsl/list'));
if ($_POST) {
if ($apo->values($_POST)->changed() AND (! $this->save($apo)))
if ($this->request->post()) {
if ($apo->values($this->request->post())->changed() AND (! $this->save($apo)))
$apo->reload();
if (isset($_POST['test'])) {
$charge = isset($_POST['test']['charge']) ? $_POST['test']['charge'] : FALSE;
$test_result = $apo->allowance($_POST['test'],FALSE,$charge,TRUE);
if ($this->request->post('test')) {
$charge = $this->request->post('test.charge');
$test_result = $apo->allowance($this->request->post('test'),FALSE,$charge,TRUE);
}
}
@@ -161,10 +161,10 @@ class Controller_Admin_Adsl extends Controller_Adsl {
* Reconcile billing for an ADSL supplier
*/
public function action_traffic() {
if (empty($_POST['sid']))
if (! $this->request->post('sid'))
HTTP::redirect(URL::link('admin','adsl/index'));
$aso = ORM::factory('ADSL_Supplier',$_POST['sid']);
$aso = ORM::factory('ADSL_Supplier',$this->request->post('sid'));
if (! $aso->loaded())
HTTP::redirect(URL::link('admin','adsl/index'));