views:

240

answers:

2

We've created a highly customized Joomla 1.5 based site and want our super administrator to be able to log into registered user accounts so we can provide better phone support and help them configure their accounts remotely.

This will obviously take some coding. Ideally we want a link from the admin side that will take us to the front end and automatically log us in as the registered user. We'll lock it down by IP address and also have some sort of password as well.

Where does the login get processed? It looks like /components/com_user/controller.php calls a function called $mainframe -> login(); Where does that function reside?

Our thought is to send a mock login form along with an additional super-user password field. Then we'll modify the login code to authorize the login if the password is present and the IP address is correct.

Any words of wisdom or caution with this approach?

A: 

You'll want to build an authentication plugin to handle this. You can enable as many authentication plugins as you like (the core plugin, OpenID, your own plugin, etc...). Joomla will run down the list of enabled plugins until one of them sets the status variable of the $response object to JAUTHENTICATE_STATUS_SUCCESS. The $response object gets passed in to your plugin's onAuthenticate method. Take a look at plugins/authentication/example.php for a clear example. You will probably end up cloning plugins/authentication/joomla.php and repurposing it for your needs.

I would publish your custom plugin after the core Joomla authentication plugin so that normal users will be able to log in faster.

Also, if you do want to go with a form as well, you will need to build a small component so that you can get the username and super-user password into the request.

jlleblanc
Thanks! If bucabay hadn't found a plugin that already does it, you're guidance would have gotten me there.
So goes Joomla. ;) Chances are, someone's already written something close to what you want.
jlleblanc
+2  A: 

There is actually a plugin that will do just this: http://extensions.joomla.org/extensions/access-a-security/authentication/4806

bucabay
Perfect! That's exactly what I was looking for.
you're welcome.
bucabay