Solved

Make new automatic redirection after login in Joomla

Posted on 2008-10-29
4
1,606 Views
Last Modified: 2010-05-18
Hi all I'm not sure if any of you here are familar with the Joomla CMS, but anyway what I want to do is to have the administration automatically take me to a page after I login

I have attached the code for the login page.

Bascially when I login it takes me to /administrator/index.php but I would like for it to take me to /administrator/index2.php?option=com_virtuemart&tmpl=component&vmLayout=extended    instead

How do I do this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr" >

<head>

  <meta http-equiv="content-type" content="text/html; charset=utf-8" />

  <meta name="robots" content="index, follow" />

  <meta name="keywords" content="" />

  <meta name="description" content="" />

  <meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />

  <title>ePet Express - Administration</title>

  <link href="/administrator/templates/khepri/favicon.ico" rel="shortcut icon" type="image/x-icon" />
 

  <script type="text/javascript" src="/media/system/js/mootools.js"></script>
 
 

<link rel="stylesheet" href="templates/system/css/system.css" type="text/css" />

<link href="templates/khepri/css/login.css" rel="stylesheet" type="text/css" />
 
 

<!--[if IE 7]>

<link href="templates/khepri/css/ie7.css" rel="stylesheet" type="text/css" />

<![endif]-->
 

<!--[if lte IE 6]>

<link href="templates/khepri/css/ie6.css" rel="stylesheet" type="text/css" />

<![endif]-->
 

	<link rel="stylesheet" type="text/css" href="templates/khepri/css/rounded.css" />
 

<script language="javascript" type="text/javascript">

	function setFocus() {

		document.login.username.select();

		document.login.username.focus();

	}
 

</script>

</head>

<body onload="javascript:setFocus()">

	<div id="border-top" class="h_green">

		<div>

			<div>

				<span class="title">ePet Express</span>

			</div>

		</div>

	</div>
 

	<div id="content-box">

		<div class="padding">

			<div id="element-box" class="login">

				<div class="t">

					<div class="t">

						<div class="t"></div>

					</div>

				</div>

				<div class="m">
 

					<h1>Joomla! Administration Login</h1>

					

							<div id="section-box">

			<div class="t">

				<div class="t">

					<div class="t"></div>

		 		</div>

	 		</div>

			<div class="m">
 

				<form action="index.php" method="post" name="login" id="form-login" style="clear: both;">

	<p id="form-login-username">

		<label for="modlgn_username">Username</label>

		<input name="username" id="modlgn_username" type="text" class="inputbox" size="15" />

	</p>
 

	<p id="form-login-password">

		<label for="modlgn_passwd">Password</label>
 

		<input name="passwd" id="modlgn_passwd" type="password" class="inputbox" size="15" />

	</p>

		<p id="form-login-lang" style="clear: both;">

		<label for="lang">Language</label>

		<select name="lang" id="lang"  class="inputbox"><option value=""  selected="selected">Default</option><option value="en-GB" >English (United Kingdom)</option></select>	</p>

	<div class="button_holder">

	<div class="button1">
 

		<div class="next">

			<a onclick="login.submit();">

				Login</a>
 

		</div>

	</div>

	</div>

	<div class="clr"></div>

	<input type="submit" style="border: 0; padding: 0; margin: 0; width: 0px; height: 0px;" value="Login" />
 

	<input type="hidden" name="option" value="com_login" />

	<input type="hidden" name="task" value="login" />

	<input type="hidden" name="3e20d029d87ff4c18ba5a717b9876a83" value="1" /></form>

				<div class="clr"></div>

			</div>

			<div class="b">

				<div class="b">

		 			<div class="b"></div>

				</div>
 

			</div>

		</div>

		

					<p>Use a valid username and password to gain access to the Administrator Back-end.</p>

					<p>

						<a href="http://epetexpress.com.au/">Return to site Home Page</a>

					</p>

					<div id="lock"></div>

					<div class="clr"></div>
 

				</div>

				<div class="b">

					<div class="b">

						<div class="b"></div>

					</div>

				</div>

			</div>

			<noscript>

				Warning! JavaScript must be enabled for proper operation of the Administrator back-end.			</noscript>
 

			<div class="clr"></div>

		</div>

	</div>

	<div id="border-bottom"><div><div></div></div>

</div>

<div id="footer">

	<p class="copyright">

		<a href="http://www.joomla.org" target="_blank">Joomla!</a>

		is Free Software released under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU/GPL License</a>.	</p>
 

</div>

</body>

</html>

Open in new window

0
Comment
Question by:hubfub
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:hubfub
ID: 22829596
Sorry please also see the contents of administrator/index.php

which is the file the form connects to
<?php

/**

* @version		$Id: index.php 10381 2008-06-01 03:35:53Z pasamio $

* @package		Joomla

* @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.

* @license		GNU/GPL, see LICENSE.php

* Joomla! is free software. This version may have been modified pursuant

* to the GNU General Public License, and as distributed it includes or

* is derivative of works licensed under the GNU General Public License or

* other free or open source software licenses.

* See COPYRIGHT.php for copyright notices and details.

*/
 

// Set flag that this is a parent file

define( '_JEXEC', 1 );
 

define('JPATH_BASE', dirname(__FILE__) );
 

define('DS', DIRECTORY_SEPARATOR);
 

require_once( JPATH_BASE .DS.'includes'.DS.'defines.php' );

require_once( JPATH_BASE .DS.'includes'.DS.'framework.php' );

require_once( JPATH_BASE .DS.'includes'.DS.'helper.php' );

require_once( JPATH_BASE .DS.'includes'.DS.'toolbar.php' );
 

JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;
 

/**

 * CREATE THE APPLICATION

 *

 * NOTE :

 */

$mainframe =& JFactory::getApplication('administrator');
 

/**

 * INITIALISE THE APPLICATION

 *

 * NOTE :

 */

$mainframe->initialise(array(

	'language' => $mainframe->getUserState( "application.lang", 'lang' )

));
 

JPluginHelper::importPlugin('system');
 

// trigger the onAfterInitialise events

JDEBUG ? $_PROFILER->mark('afterInitialise') : null;

$mainframe->triggerEvent('onAfterInitialise');
 

/**

 * ROUTE THE APPLICATION

 *

 * NOTE :

 */

$mainframe->route();
 

// trigger the onAfterRoute events

JDEBUG ? $_PROFILER->mark('afterRoute') : null;

$mainframe->triggerEvent('onAfterRoute');
 

/**

 * DISPATCH THE APPLICATION

 *

 * NOTE :

 */

$option = JAdministratorHelper::findOption();

$mainframe->dispatch($option);
 

// trigger the onAfterDispatch events

JDEBUG ? $_PROFILER->mark('afterDispatch') : null;

$mainframe->triggerEvent('onAfterDispatch');
 

/**

 * RENDER THE APPLICATION

 *

 * NOTE :

 */

$mainframe->render();
 

// trigger the onAfterRender events

JDEBUG ? $_PROFILER->mark( 'afterRender' ) : null;

$mainframe->triggerEvent( 'onAfterRender' );
 

/**

 * RETURN THE RESPONSE

 */

echo JResponse::toString($mainframe->getCfg('gzip'));

?>

Open in new window

0
 
LVL 6

Accepted Solution

by:
gxp071 earned 500 total points
ID: 22830065
you need to edit

administrator/components/com_login/admin.login.php

on line 67

$mainframe->redirect('index.php');

add the correct path, job done :)
0
 
LVL 6

Expert Comment

by:gxp071
ID: 22830073
p.s. that for Joomla 1.5 not sure if that the same for 1.0.x
0
 
LVL 1

Author Comment

by:hubfub
ID: 22830770
YOU ARE A GENIUS MAN
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now