Welcome Guest, Not a member yet? Register   Sign In
How to build an admin panel [SOLVED]
#5

Well this is what I got so far, I do nt want to create another views,etc. I just wat to block all the IP address, or set one Io to have the accesss to these pages. And to do that I put this in my __construct

       public function __construct()
       {
               parent::__construct();
$this->load->model('about_model');
$this->load->model('blog_model');
$this->load->model('categorias_model');
$this->load->model('cookies_model');
$this->load->model('news_model');
$this->load->model('portfolio_model');
$this->load->model('privacy_model');
$this->load->model('terms_model');
$this->load->model('skills_model');
$this->load->model('profesion_model');
$this->load->model('slider_model');
$this->load->library('pagination');


//// Block access to admin pages ////

           //Here you check ip allowed or not
           if (!in_array($this->input->ip_address(), array('107.208.103.39','2602:306:bd06:7270:fcdd:74c5:c591:dc4')))
           {
              // Either show 404
              show_404();

              // OR redirect somewhere else
              redirect('admin');
           }


       }

I found ths tutorial on Stackoverflow, byt apprently I have to create an input as called "ip_address" and I do not know where should I create it, but as I said before I would like to avoid the creating of new controller, views/models etc.
I do Front-End development most of the time 
Reply


Messages In This Thread
RE: How to build an admin panel - by stebo - 02-17-2017, 02:16 AM
RE: How to build an admin panel - by ignitedcms - 02-17-2017, 07:08 AM
RE: How to build an admin panel - by Avenirer - 02-17-2017, 09:30 AM
RE: How to build an admin panel - by kirasiris - 02-18-2017, 09:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB