Removed direct references to $_REQUEST and $_POST
This commit is contained in:
@@ -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,
|
||||
|
@@ -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()
|
||||
|
@@ -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
|
||||
|
@@ -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()
|
||||
|
@@ -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()
|
||||
|
@@ -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');
|
||||
|
Reference in New Issue
Block a user