diff --git a/application/classes/Auth/OSB.php b/application/classes/Auth/OSB.php
index 8354e5fe..081df456 100644
--- a/application/classes/Auth/OSB.php
+++ b/application/classes/Auth/OSB.php
@@ -182,7 +182,7 @@ class Auth_OSB extends Auth_ORM {
$uo = parent::get_user($default);
// If we are not logged in, see if there is token for the user
- if (is_null($uo) AND $tokenuser AND ($token=Session::instance()->get('token')) OR (! empty($_REQUEST['token']) AND $token=$_REQUEST['token']))
+ if (is_null($uo) AND $tokenuser AND ($token=Session::instance()->get('token')) OR ($token=Arr::get($_REQUEST,'token')))
$uo = $this->_get_token_user($token);
return $uo;
diff --git a/application/classes/Controller/Admin/Module/Method.php b/application/classes/Controller/Admin/Module/Method.php
index 3c095b6d..55a0a7a5 100644
--- a/application/classes/Controller/Admin/Module/Method.php
+++ b/application/classes/Controller/Admin/Module/Method.php
@@ -23,14 +23,14 @@ class Controller_Admin_Module_Method extends Controller_Admin_Module {
if (! $mo->loaded() OR ! in_array($method,$mm['methods']))
HTTP::redirect(URL::link('admin','module/list'));
- if ($_POST) {
+ if ($this->request->post()) {
$mmo = $mo->module_method;
$mmo->name = $method;
$mmo->module_id = $mo->id;
- $mmo->values($_POST);
+ $mmo->values($this->request->post());
if (! $this->save($mmo))
- throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($_POST)));
+ throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($this->request->post())));
HTTP::redirect(URL::link('admin','module/edit/'.$mo->id));
}
@@ -61,15 +61,15 @@ class Controller_Admin_Module_Method extends Controller_Admin_Module {
HTTP::redirect(URL::link('admin','module/list'));
}
- if ($_POST) {
- $mmo->values($_POST);
+ if ($this->request->post()) {
+ $mmo->values($this->request->post());
if (! $this->save($mmo))
- throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($_POST)));
+ throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($this->request->post())));
foreach (ORM::factory('Group')->find_all() as $go) {
// If the group was defined and no longer
- if ($mmo->has('group',$go) AND (! isset($_POST['groups']) OR ! in_array($go->id,$_POST['groups']))) {
+ if ($mmo->has('group',$go) AND (! $this->request->post('groups')) OR ! in_array($go->id,$this->request->post('groups'))) {
$gmo = ORM::factory('Group_Method',array('method_id'=>$mmo->id,'group_id'=>$go->id));
if (! $gmo->delete())
@@ -79,7 +79,7 @@ class Controller_Admin_Module_Method extends Controller_Admin_Module {
->body(sprintf(_('Unable to delete Group Method for method %s and group %s'),$mmo->name,$go->name));
// If the group was not defined and now is
- } elseif (! $mmo->has('group',$go) AND isset($_POST['groups']) AND in_array($go->id,$_POST['groups'])) {
+ } elseif (! $mmo->has('group',$go) AND $this->request->post('groups') AND in_array($go->id,$this->request->post('groups'))) {
$gmo = ORM::factory('Group_Method')
->values(array(
'method_id'=>$mmo->id,
diff --git a/application/classes/Controller/Admin/Setup.php b/application/classes/Controller/Admin/Setup.php
index 84f833ef..1c5bcc97 100644
--- a/application/classes/Controller/Admin/Setup.php
+++ b/application/classes/Controller/Admin/Setup.php
@@ -20,7 +20,7 @@ class Controller_Admin_Setup extends Controller_TemplateDefault {
public function action_edit() {
$o = Company::instance()->so();
- if ($_POST AND $o->values($_POST)->changed() AND (! $this->save($o)))
+ if ($this->request->post() AND $o->values($this->request->post())->changed() AND (! $this->save($o)))
$o->reload();
Block::factory()
diff --git a/application/classes/Controller/Login.php b/application/classes/Controller/Login.php
index 4731e4f5..9308cae9 100644
--- a/application/classes/Controller/Login.php
+++ b/application/classes/Controller/Login.php
@@ -36,9 +36,9 @@ class Controller_Login extends lnApp_Controller_Login {
HTTP::redirect('welcome/index');
// If the user posted their details to reset their password
- if ($_POST) {
+ if ($this->request->post()) {
// If the username is correct, create a method token
- if (! empty($_POST['username']) AND ($ao=ORM::factory('Account',array('username'=>$_POST['username']))) AND $ao->loaded()) {
+ if ($this->request->post('username') AND ($ao=ORM::factory('Account',array('username'=>$this->request->post('username')))) AND $ao->loaded()) {
$mmto = ORM::factory('Module_Method_Token')
->method(array('account','user:resetpassword'))
->account($ao)
@@ -66,12 +66,12 @@ class Controller_Login extends lnApp_Controller_Login {
}
// Redirect to our password reset, the Auth will validate the token.
- } elseif (! empty($_REQUEST['token'])) {
- HTTP::redirect(URL::link('user','account/resetpassword?token='.$_REQUEST['token']));
+ } elseif ($this->request->query('token')) {
+ HTTP::redirect(URL::link('user','account/resetpassword?token='.$this->request->query('token')));
}
// Show our token screen even if the email was invalid.
- if (isset($_POST['username']))
+ if ($this->request->post('username'))
$output = View::factory('pages/login_reset_sent');
else
diff --git a/application/classes/Controller/TemplateDefault.php b/application/classes/Controller/TemplateDefault.php
index 47ad8896..144d30ad 100644
--- a/application/classes/Controller/TemplateDefault.php
+++ b/application/classes/Controller/TemplateDefault.php
@@ -42,8 +42,8 @@ abstract class Controller_TemplateDefault extends lnApp_Controller_TemplateDefau
if (! $mo->loaded())
throw HTTP_Exception::factory(501,'Unknown module :module',array(':module'=>Request::current()->controller()));
- if ($_POST AND isset($_POST['module_config'][$mo->id]))
- Config::instance()->module_config($mo->name,$_POST['module_config'][$mo->id])->save();
+ if ($this->request->post() AND array_key_exists($mo->id,$this->request->post('module_config')))
+ Config::instance()->module_config($mo->name,$this->request->post('module_config.'.$mo->id))->save();
if ($config_items) {
Block::factory()
diff --git a/application/classes/Controller/User/Account.php b/application/classes/Controller/User/Account.php
index f5d90d2b..4bc6fb0e 100644
--- a/application/classes/Controller/User/Account.php
+++ b/application/classes/Controller/User/Account.php
@@ -19,7 +19,7 @@ class Controller_User_Account extends Controller_Account {
* Enable User to Edit their Account Details
*/
public function action_edit() {
- if ($_POST AND $this->ao->values($_POST)->changed() AND (! $this->save($this->ao)))
+ if ($this->request->post() AND $this->ao->values($this->request->post())->changed() AND (! $this->save($this->ao)))
$this->ao->reload();
Block::factory()
diff --git a/application/classes/Controller/User/Search.php b/application/classes/Controller/User/Search.php
index 6fbf3dde..1d15eee0 100644
--- a/application/classes/Controller/User/Search.php
+++ b/application/classes/Controller/User/Search.php
@@ -20,13 +20,13 @@ class Controller_User_Search extends Controller_Search {
public function action_ajaxlist() {
$result = array();
- if (isset($_REQUEST['term']) AND trim($_REQUEST['term'])) {
- $result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($_REQUEST['term'],'url','id',array('ACC %s: %s'=>array('id','name()')),array(),array('urlprefix'=>URL::link('reseller','account/view/'))));
- $result = Arr::merge($result,ORM::factory('Service')->list_autocomplete($_REQUEST['term'],'url','id',array('SVC %s: %s'=>array('id','name()')),array(),array('urlprefix'=>URL::link('user','service/view/'))));
- $result = Arr::merge($result,ORM::factory('Invoice')->list_autocomplete($_REQUEST['term'],'url','id',array('INV %s: %s'=>array('id','account->name()')),array(),array('urlprefix'=>URL::link('user','invoice/view/'))));
+ if ($this->request->query('term')) {
+ $result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($this->request->query('term'),'url','id',array('ACC %s: %s'=>array('id','name()')),array(),array('urlprefix'=>URL::link('reseller','account/view/'))));
+ $result = Arr::merge($result,ORM::factory('Service')->list_autocomplete($this->request->query('term'),'url','id',array('SVC %s: %s'=>array('id','name()')),array(),array('urlprefix'=>URL::link('user','service/view/'))));
+ $result = Arr::merge($result,ORM::factory('Invoice')->list_autocomplete($this->request->query('term'),'url','id',array('INV %s: %s'=>array('id','account->name()')),array(),array('urlprefix'=>URL::link('user','invoice/view/'))));
foreach (array('Service_Plugin_Adsl','Service_Plugin_Domain','Service_Plugin_Host') as $o)
- $result = Arr::merge($result,ORM::factory($o)->list_autocomplete($_REQUEST['term'],'url','service_id',array('SVC %s: %s'=>array('service_id','service->name()')),array(),array('urlprefix'=>URL::link('user','service/view/'))));
+ $result = Arr::merge($result,ORM::factory($o)->list_autocomplete($this->request->query('term'),'url','service_id',array('SVC %s: %s'=>array('service_id','service->name()')),array(),array('urlprefix'=>URL::link('user','service/view/'))));
}
$this->response->headers('Content-Type','application/json');
diff --git a/includes/kohana b/includes/kohana
index 0a7e8b34..64156527 160000
--- a/includes/kohana
+++ b/includes/kohana
@@ -1 +1 @@
-Subproject commit 0a7e8b349df4e965b30b3de3af3c23b6bdee40b6
+Subproject commit 6415652743526a9b25a53b0cab4ffa0db020f42b
diff --git a/modules/adsl/classes/Controller/Admin/Adsl.php b/modules/adsl/classes/Controller/Admin/Adsl.php
index d698ffa8..5d782fa6 100644
--- a/modules/adsl/classes/Controller/Admin/Adsl.php
+++ b/modules/adsl/classes/Controller/Admin/Adsl.php
@@ -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'));
diff --git a/modules/adsl/classes/Controller/Reseller/Adsl.php b/modules/adsl/classes/Controller/Reseller/Adsl.php
index 214fef5b..ad5618a5 100644
--- a/modules/adsl/classes/Controller/Reseller/Adsl.php
+++ b/modules/adsl/classes/Controller/Reseller/Adsl.php
@@ -19,10 +19,10 @@ class Controller_Reseller_Adsl extends Controller_Adsl {
* Reconcile billing for an ADSL supplier
*/
public function action_billing() {
- if (empty($_POST['sid']) OR ! $_FILES)
+ if (! $this->request->post('sid') OR ! $_FILES)
HTTP::redirect(URL::link('reseller','adsl/index'));
- $aso = ORM::factory('ADSL_Supplier',$_POST['sid']);
+ $aso = ORM::factory('ADSL_Supplier',$this->request->post('sid'));
// Process upload
$files = Validation::factory($_FILES)
@@ -59,8 +59,8 @@ class Controller_Reseller_Adsl extends Controller_Adsl {
public function action_index() {
$output = '';
- if ($_POST and isset($_POST['sid'])) {
- $aso = ORM::factory('ADSL_Supplier',$_POST['sid']);
+ if ($this->request->post() AND $this->request->post('sid')) {
+ $aso = ORM::factory('ADSL_Supplier',$this->request->post('sid'));
if (! $aso->loaded())
HTTP::redirect('adsl/index');
diff --git a/modules/adsl/classes/Model/Service/Plugin/Adsl.php b/modules/adsl/classes/Model/Service/Plugin/Adsl.php
index 4d60c7fb..f2859da8 100644
--- a/modules/adsl/classes/Model/Service/Plugin/Adsl.php
+++ b/modules/adsl/classes/Model/Service/Plugin/Adsl.php
@@ -333,8 +333,8 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
$c=0;
// If we came in via a post to show a particular month, then show that, otherwise show the yearly result
if (! is_null($month) AND trim($month)) {
- $highchart->title(sprintf('DSL traffic usage for %s',$_POST['month']));
- $x = $this->get_traffic_typedaily(strtotime($_POST['month'].'-01'));
+ $highchart->title(sprintf('DSL traffic usage for %s',Arr::get($_POST,'month')));
+ $x = $this->get_traffic_typedaily(strtotime(Arr::get($_POST,'month').'-01'));
} else {
$highchart->title(sprintf('Monthly DSL traffic usage as at %s',$this->traffic->find_last()->date));
@@ -417,7 +417,7 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
public function traffic_table($month=NULL) {
// If we came in via a post to show a particular month, then show that, otherwise show the yearly result
if (! is_null($month) AND trim($month)) {
- $x = $this->get_traffic_dailytype(strtotime($_POST['month'].'-01'));
+ $x = $this->get_traffic_dailytype(strtotime(Arr::get($_POST,'month').'-01'));
$index = 'Date';
} else {
diff --git a/modules/adsl/views/adsl/reseller/billing/exetelvisp.php b/modules/adsl/views/adsl/reseller/billing/exetelvisp.php
index 62ef272f..c5182ebe 100644
--- a/modules/adsl/views/adsl/reseller/billing/exetelvisp.php
+++ b/modules/adsl/views/adsl/reseller/billing/exetelvisp.php
@@ -2,7 +2,7 @@