?
Solved

Make new automatic redirection after login in Joomla

Posted on 2008-10-29
4
Medium Priority
?
1,626 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
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.
Suggested Courses

752 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