We have a Joomla site (latest version) with a page that links to another system with a fixed username/pw, so like https://www.othersystem.com/login.php?un=[fixed_un]&pw=[fixed_pw].
Now we need to change that link based on the Joomla user credentials with an email address. I.e. https://www.othersystem.com/[email protected]. This preprocess page will only accept calls from the Joomla page - and, as the user is already logged in there - will lookup the correct other-system credentials based on the email address and foprward the user to login.php with the found credentials.
I'm a Joomla no-Know. What I've found so far is that we need to add extensions like Sourcerer or add-custom-PHP to be able to write code in the link page. And maybe adding JDatabase to access the db, but once I'm in PHP I should be able to set up my own connection if needed. I'm sure Joomla will have a session variable which is the username. And that is exactly what I need to grab as it's the email I need to send out.
My questions: (1) will this approach work? (2) is there a smarter way? I can hardly imagine you can't build a link based on variables in Joomla, but I'm too newbie to know and/or to find (3) could you give me a nudge in the right direction on tackling this? I'm fluent in PHP and SQL and good enough in Javascript etc.
Thank's for any input, Bob