remove old ISS specific redirect code and default of $_SERVER[PHP_SELF] for $url parameter of egw::redirect (not used in current EGroupware)

This commit is contained in:
Ralf Becker 2011-11-30 20:32:45 +00:00
parent 2d906d7a3e
commit e9ba37173a
2 changed files with 9 additions and 25 deletions

View File

@ -444,12 +444,12 @@ class egw extends egw_minimal
/**
* Link url generator
*
* @param string='' $string The url the link is for
* @param string $string The url the link is for
* @param string|array $extravars='' Extra params to be passed to the url
* @param string $link_app=null if appname or true, some templates generate a special link-handler url
* @return string The full url after processing
*/
static function link($url = '', $extravars = '', $link_app=null)
static function link($url, $extravars = '', $link_app=null)
{
return $GLOBALS['egw']->framework->link($url, $extravars, $link_app);
}
@ -461,7 +461,7 @@ class egw extends egw_minimal
* @param string/array $extravars Extra params to be passed to the url
* @return string The full url after processing
*/
static function redirect_link($url = '',$extravars='')
static function redirect_link($url, $extravars='')
{
return $GLOBALS['egw']->framework->redirect_link($url, $extravars);
}
@ -473,28 +473,12 @@ class egw extends egw_minimal
*
* @param string The url ro redirect to
*/
static function redirect($url = '')
static function redirect($url)
{
/* global $HTTP_ENV_VARS; */
$iis = @strpos($GLOBALS['HTTP_ENV_VARS']['SERVER_SOFTWARE'], 'IIS', 0);
// Determines whether the current output buffer should be flushed
$do_flush = true;
if(!$url)
{
$url = $_SERVER['PHP_SELF'];
}
if($iis)
{
echo "\n<HTML>\n<HEAD>\n<TITLE>Redirecting to $url</TITLE>";
echo "\n<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=$url\">";
echo "\n</HEAD><BODY>";
echo "<H3>Please continue to <a href=\"$url\">this page</a></H3>";
echo "\n</BODY></HTML>";
}
else if (egw_json_response::isJSONResponse() || egw_json_request::isJSONRequest())
if (egw_json_response::isJSONResponse() || egw_json_request::isJSONRequest())
{
$response = egw_json_response::get();
$response->redirect($url);

View File

@ -113,11 +113,11 @@ abstract class egw_framework
/**
* Link url generator
*
* @param string $string The url the link is for
* @param string $url The url the link is for
* @param string/array $extravars Extra params to be passed to the url
* @return string The full url after processing
*/
static function link($url = '', $extravars = '')
static function link($url, $extravars = '')
{
return $GLOBALS['egw']->session->link($url, $extravars);
}
@ -125,11 +125,11 @@ abstract class egw_framework
/**
* Redirects direct to a generated link
*
* @param string $string The url the link is for
* @param string $url The url the link is for
* @param string/array $extravars Extra params to be passed to the url
* @return string The full url after processing
*/
static function redirect_link($url = '',$extravars='')
static function redirect_link($url, $extravars='')
{
egw::redirect(self::link($url, $extravars));
}