• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I do not want to allow access to a controller by url

#1
[eluser]MrAmine[/eluser]
hi evryone
I do not want to allow access to a controller by url
how can i do

#2
[eluser]mdvaldosta[/eluser]
Don't have an index function and prefix all your functions with an underscore.

#3
[eluser]MrAmine[/eluser]
i don't understand ??

#4
[eluser]eoinmcg[/eluser]
it's all in the manual:
http://ellislab.com/codeigniter/user-gui...llers.html

the index() method is what CI will load if no method is specified in the url
eg http://example.com/my_app/blog
will execute the index method in the blog controller.

if there is no index method for the blog controller a '404 not found' error will be shown.

also prefixing your methods with an underscore means that they are private and not accessible by url.

#5
[eluser]WanWizard[/eluser]
If you don't want access to the controller via the URL, what are you going to do with that controller then? Because in stock CI, you can't use controllers internally...

#6
[eluser]InsiteFX[/eluser]
If its a specific controller like only for an admin then check to see if the logged in user is an admin if not redirect them back to the home page!

InsiteFX

#7
[eluser]Nur Cholikul Anwar[/eluser]
Maybe you need a authentication programe


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.