Joomla! Discussion Forums



It is currently Thu Nov 26, 2009 10:11 am (All times are UTC )

 




Post new topic Reply to topic  [ 8 posts ] 
Author Message
Posted: Fri Dec 23, 2005 1:39 am 
User avatar
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Fri Dec 23, 2005 1:20 am
Posts: 4
In our site, whatever the login module options are; if you login or logout, the browser goes directly to the frontpage.

I made a little research about it and found this reason:

mod_login.php file contains the line
$return = mosGetParam( $_SERVER, 'REQUEST_URI', null );
This is the command for getting back to the referer page after login/logout. Apache servers can run the parameter REQUEST_URI command but Microsoft IIS can not.

We run our site on a Microsoft IIS. Because of this after every login or logout we can't get back to the referer page and we go directly to the frontpage.

Is there any replacement of REQUEST_URI command working on Microsoft IIS or is there anybody knows any solution to fix this problem?


Top
  E-mail  
 
Posted: Sat Dec 24, 2005 1:17 pm 
User avatar
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Fri Dec 23, 2005 1:20 am
Posts: 4
"REQUEST_URI" do not work on Microsoft IIS. Some Joomla files containing this command (for example mod_login.php) can not work properly on IIS. Can anyone find a solution tu run this command on IIS or know any command which substitute "REQUEST_URI".

I think this should be fixed in future versions of joomla.


Last edited by Jinx on Sun Dec 25, 2005 9:38 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Sun Dec 25, 2005 9:38 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
There seems to be no easy answer for this problem. Currently found the following blog post on sitepoint : http://www.sitepoint.com/blogs/2005/11/ ... fferences/. I'll try to dig some deeper.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
Posted: Mon Dec 26, 2005 3:22 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Wed Aug 17, 2005 10:12 pm
Posts: 1686
Location: Germany-Bad Abbach
Maybe a small check would help:

Code:
if ( empty( $_SERVER[ 'REQUEST_URI' ] ) ) {         // Not defined by IIS
        // Under some configs, IIS makes SCRIPT_NAME point to php.exe :-(
        if ( !( $_SERVER[ 'REQUEST_URI' ] = @$_SERVER['PHP_SELF'] ) ) {
            $_SERVER[ 'REQUEST_URI' ] = $_SERVER['SCRIPT_NAME'];
        }
        if ( isset( $_SERVER[ 'QUERY_STRING' ] ) ) {
            $_SERVER[ 'REQUEST_URI' ] .= '?' . $_SERVER[ 'QUERY_STRING' ];
        }
    }

_________________
The "Humor, Fun and Games" forum has  more than 2500 Posts, so why not build a "Humor, Fun and Games Working" Group?
.....
Malicious tongues say we have this WG right from the start, they call it core team :D


Top
   
 
Posted: Mon Dec 26, 2005 4:11 pm 
User avatar
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Fri Dec 23, 2005 1:20 am
Posts: 4
I put this code at the top of the mod_login.php at modules folder, login.php at components folder and index.php at main folder but can't get a result. The browser still goes to the frontpage.

Did I supposed to put the code to any other file?


Top
  E-mail  
 
Posted: Wed Dec 28, 2005 4:35 pm 
User avatar
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Fri Dec 23, 2005 1:20 am
Posts: 4
Some guy in a forum gives me this code to solve the problem:

if(!isset($_SERVER['REQUEST_URI'])) {
$arr = explode("/", $_SERVER['PHP_SELF']);
$_SERVER['REQUEST_URI'] = "/" . $arr[count($arr)-1];
if ($_SERVER['argv'][0]!="")
$_SERVER['REQUEST_URI'] .= "?" . $_SERVER['argv'][0];
}

I simply added this to the top of the mod_ login.php but it did not work out.

I think this code is for a standalone normal PHP operation. But in joomla, things are different. mod_login.php includes this code:

$return = mosGetParam( $_SERVER, 'REQUEST_URI', null );
// converts & to & for xtml compliance
$return = str_replace( '&', '&', $return );

It try to use $_SERVER command by mosGetParam command. If we can entegrate the first code to the second in the way that joomla understands (i.e. after MosGetParam in the correct suffix which I do not know yet), everything will work fine.


Top
  E-mail  
 
Posted: Thu Dec 20, 2007 11:02 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Thu Jul 26, 2007 1:22 pm
Posts: 4
Just came across this problem myself.

thought you'd like to know that i have a hack to fix this.

put this code at the top of your joomla.php file (or anywhere that is loaded before that variable is needed)


  $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],1 ); 
          if (isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING']; }

Many thanks must go to the guy who came up with the code as it wasn't me. but it works perfectly.


Top
   
 
Posted: Mon Oct 13, 2008 6:09 am 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4490
Location: Toronto, Canada
[quote="Steveyboy"]Just came across this problem myself.

thought you'd like to know that i have a hack to fix this.

put this code at the top of your joomla.php file (or anywhere that is loaded before that variable is needed)


  $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],1 ); 
          if (isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING']; }

Many thanks must go to the guy who came up with the code as it wasn't me. but it works perfectly.[/quote]
In case anybody comes along to this topic in the meantime, please be advised that as of 1.5.1 it is now possible to add a live_site parameter in your configuration.php file so that you can hard code the value in the event that it is not detected properly.

Ian


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group