Entering only from route address |
[eluser]Leo78[/eluser]
Hey, How can I set that only the route addresses will be valid? I mean for example I have a controller `myclass` and function `myfunction` so I can enter this function via domain.com/myclass/myfunction - that the addresses I want to block, any ideas? because now I have two addresses per page - one from the route and on the original. Thank you!
[eluser]solid9[/eluser]
Make your function private, http://ellislab.com/codeigniter/user-gui...ml#private
[eluser]Leo78[/eluser]
Tried it, but the route address doesn't work too (because of the private).
[eluser]solid9[/eluser]
Have you tried if else condition? You can filter the user origin by using if else.
[eluser]Leo78[/eluser]
Do you mean using $_SERVER and checking each time the address? it's the last solution I want to use, I hoped to find a solution in CI itself, there isn't?
[eluser]PhilTem[/eluser]
If you want to turn methods into private methods DO NOT add a private declaration for the method Code: private function hidden() {} However Code: public function _hidden() {} You need to distinguish between private PHP methods and "private CI methods"
[eluser]Aken[/eluser]
Why do you want to block it in the first place? Unless you link to it in your website, the only way people will ever know it exists is if they guess correctly.
[eluser]Leo78[/eluser]
@PhilTem, Again, I tried it but this option blocks the route too, so it doesn't help me. [quote author="Aken" date="1351643834"]Why do you want to block it in the first place? Unless you link to it in your website, the only way people will ever know it exists is if they guess correctly.[/quote] Absolutely right, but I want to prevent this 1% that the user will guess right. Is it possible?
[eluser]CroNiX[/eluser]
post your routes. If you have a route to bypass a method name in the url like: Code: $route['something/(:any)'] = 'controller/your_method/$1'; Then in your controller, you could: Code: function your_method($var1) |
Welcome Guest, Not a member yet? Register Sign In |