Admin Login Re-Direct (J!1.5.x)

Your code modifications and patches you want to share with others.
Locked
nedge2k
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Sep 05, 2008 2:39 pm

Admin Login Re-Direct (J!1.5.x)

Post by nedge2k » Tue Jun 08, 2010 11:02 am

I tend to visit the admin section using direct links to the page I'm after. Unfortunately, (unless I'm already logged in) when I do log in, the com_login admin.login.php script redirects to index.php instead of the requested URI. Now, a simple hack fixes this:

In administrator\modules\mod_login\mod_login.php add:

Code: Select all

<input type="hidden" name="request_uri" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
to the login form (around line 73).

In administrator\components\com_login\admin.login.php change the login redirect on line 65 to:

Code: Select all

if (!JError::isError($result)) {
	$mainframe->redirect($_POST['request_uri']);
}
Now, this works fine until there's an update and you have to do it again - is there a better way?

Locked

Return to “Core Hacks and Patches”