CodeIgniter Forums
how to open a login page only for particular ip's? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: how to open a login page only for particular ip's? (/thread-74000.html)



how to open a login page only for particular ip's? - kvanaraj - 07-05-2019

I want to open a login page only for authenticated(ipaddress) users in codeigniter.


RE: how to open a login page only for particular ip's? - InsiteFX - 07-05-2019

1) create method to get the user's ip when they enter the login page.
2) You would need to create an array list of these ip's and save them to the database.
3) on start up you need to get the list of ip's from the database and save them to an array list.
4) Write a method to check the list against the users ip when they come to the login page.

Just a rough thought on this can not waste my time on things you should know.

You should search the internet for computer problem solving!


RE: how to open a login page only for particular ip's? - kvanaraj - 07-06-2019

(07-05-2019, 04:26 AM)InsiteFX Wrote: 1) create method to get the user's ip when they enter the login page.
2) You would need to create an array list of these ip's and save them to the database.
3) on start up you need to get the list of ip's from the database and save them to an array list.
4) Write a method to check the list against the users ip when they come to the login page.

Just a rough thought on this can not waste my time on things you should know.

You should search the internet for computer problem solving!

thanks for giving idea. i am also having that idea. If any shortcut or some coding to be useful for me . thats why.
No problem. I can able to do it.


RE: how to open a login page only for particular ip's? - Digital_Wolf - 07-06-2019

There is another more rigid way to make the so-called "white list"
in the file .htaccess or httpd.conf add the following lines:

Code:
Order Deny,Allow 
    Deny from all 
    Allow from 192.168.0.1, xxx.xxx.x.x



RE: how to open a login page only for particular ip's? - kvanaraj - 07-07-2019

(07-06-2019, 11:26 AM)Digital_Wolf Wrote: There is another more rigid way to make the so-called "white list"
in the file .htaccess or httpd.conf add the following lines:

Code:
Order Deny,Allow 
    Deny from all 
    Allow from 192.168.0.1, xxx.xxx.x.x
But it doesn't allow another application.