Welcome Guest, Not a member yet? Register   Sign In
How to block URL access to the controller
#4

[eluser]flacznik[/eluser]
So for example the validate function is called by AJAX and if I am right it has to be declared as public otherwise there will be no URI access possible. That is why I use $this->input->is_ajax_request() to check if call is done by AJAX. (the same thing regarding dashboard function where AJAX redirect the user to secure page):

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Login extends CI_Controller {

public function __construct(){
     parent::__construct();
}

public function validate(){
  if (!$this->input->is_ajax_request()) {...}
}


private function check_database(){

}
  
private function logout(){
      
}


public function dashboard(){
   $this->load->view('secure_header');
   $this->load->view('secure_contentt');
   $this->load->view('secure_footer');
  }
}


Messages In This Thread
How to block URL access to the controller - by El Forum - 05-20-2013, 05:29 PM
How to block URL access to the controller - by El Forum - 05-21-2013, 11:59 AM
How to block URL access to the controller - by El Forum - 05-21-2013, 01:05 PM
How to block URL access to the controller - by El Forum - 05-21-2013, 02:19 PM
How to block URL access to the controller - by El Forum - 05-21-2013, 03:43 PM
How to block URL access to the controller - by El Forum - 05-21-2013, 05:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB