Hello,
I have a huge controller in codeigniter, with many functions. I want to limit access to certain functions. How should I proceed?
And can I call the functions using cron daemon???
Or should I place those functions in another controller??
Hello,
I have a huge controller in codeigniter, with many functions. I want to limit access to certain functions. How should I proceed?
And can I call the functions using cron daemon???
Or should I place those functions in another controller??
I have a huge controller in codeigniter, with many functions. I want to limit access to certain functions. How should I proceed?
You can use some access control based on session to limit access to certain controllers->functions only. At the start of the function you can place the code like if($_SESSION['user'] != 'xyz') exit('access denied') ;
And can I call the functions using cron daemon???
yes you can call any controller function in cron with this command wget https://www.example.com/controller-name/function-name
Or should I place those functions in another controller?? Its always a good idea to refactor the code if its getting very big and getting unmanageable.
Hi,
function _example_function() {...} USING the underscore!!
This way its impossible to call this function by URL.
2.) Yes you can use cron to run function just call the URL:
http://host/controller_name/FUNCTION
Regards,
Pedro