The app I'm working on has a vacation module. Employee X registers a request for a vacation and his manager receives an email saying that X wants a vacation. Until now, the manager had to login and then navigate to the vacation section and approve or reject the request, but I added buttons in the email to directly approve or reject the request. The only problem I have is that I do not know how to redirect the manager to the link in the email after the login. If he's already logged in, the app works great, but if he is not I need a way to store the link he got in the email and use it afterwards.
I have a User class where I hold all the information in the database about the logged user after the login and I tried to add a call to the uri_string()
method there, but as User is an autoloaded library, it calls the method on every page refresh. So I tried to check using strpos()
if I have a portion of the desired link in the URI and then store it, but for some reason the link from the email does not get stored.
So how to store the referring link if it is from an external source?
The app is developed in PHP, using the CodeIgniter framework.
EDIT: It didn't work because of several reasons:
- I was overthinking the problem.
- In the User library that I have I was overwriting over and over again the variable where I was supossed to store the link (it was one of the little things you miss when you are tired); So I always ended up with an empty string there.
- The guy who worked here before (the one that developed the app) had a very chaotic way of writing code
- I WAS WAY OVERTHINKING IT!
Thank you!