clean url handling

This commit is contained in:
Angelo Cuccato 2010-08-31 21:16:16 +02:00
parent 18060e60cc
commit 2ca2400b77
16 changed files with 108 additions and 110 deletions

View File

@ -1,6 +1,6 @@
<?PHP
// Adresse des Webservers
$url = "https://SEDENGELURL/";
$url = "https://SEDENGELURL";
// Startverzeichnis des Engelhome
$ENGEL_ROOT = "/";

View File

@ -46,8 +46,6 @@
if (!$error_messages) return;
$url = $_SERVER['PHP_SELF'];
$message = "";
foreach($error_messages as $value)
$message .= $value."\n";

View File

@ -1,9 +1,5 @@
<?PHP
if( $Page["ShowTabel"]=="Y" )
{
//############################### ShowTable Start ##############################
?>
@ -57,11 +53,5 @@ if( $_SESSION['Menu'] =="R") include("menu.php");
</div>
<?PHP
//############################### ShowTable Start ##############################
} /* if (ShowTabel....*/
?>
</BODY>
</HTML>

View File

@ -6,7 +6,7 @@ if( strpos( $_SERVER["REQUEST_URI"], "?") >0)
else
$URL = $_SERVER["REQUEST_URI"]. "?SetLanguage=";
echo "<a href=\"". $URL. "DE\"><img src=\"". $url. substr( $ENGEL_ROOT, 1). "pic/flag/de.gif\" alt=\"DE\"></a> ";
echo "<a href=\"". $URL. "EN\"><img src=\"". $url. substr( $ENGEL_ROOT, 1). "pic/flag/en.gif\" alt=\"EN\"></a> ";
echo "<a href=\"". $URL. "DE\"><img src=\"". $url. $ENGEL_ROOT. "pic/flag/de.gif\" alt=\"DE\"></a> ";
echo "<a href=\"". $URL. "EN\"><img src=\"". $url. $ENGEL_ROOT. "pic/flag/en.gif\" alt=\"EN\"></a> ";
?>

View File

@ -27,7 +27,7 @@ function ShowMenu( $MenuName)
if( $Key=="admin/faq.php")
$TempName .= " (". noAnswer(). ")";
//ausgabe
$Text .= "\t\t\t<li><a href=\"". $url. substr( $ENGEL_ROOT, 1). $Key. "\">$TempName</a></li>\n";
$Text .= "\t\t\t<li><a href=\"". $url. $ENGEL_ROOT. $Key. "\">$TempName</a></li>\n";
$Gefunden = TRUE;
}
}

View File

@ -41,29 +41,31 @@ function TID2Type($TID)
}
function ReplaceSmilies($eckig) {
function ReplaceSmilies($eckig)
{
global $url, $ENGEL_ROOT;
$neueckig = $eckig;
$neueckig = str_replace(";o))","<img src=\"/pic/smiles/icon_redface.gif\">",$neueckig);
$neueckig = str_replace(":-))","<img src=\"/pic/smiles/icon_redface.gif\">",$neueckig);
$neueckig = str_replace(";o)","<img src=\"/pic/smiles/icon_wind.gif\">",$neueckig);
$neueckig = str_replace(":)","<img src=\"/pic/smiles/icon_smile.gif\">",$neueckig);
$neueckig = str_replace(":-)","<img src=\"/pic/smiles/icon_smile.gif\">",$neueckig);
$neueckig = str_replace(":(","<img src=\"/pic/smiles/icon_sad.gif\">",$neueckig);
$neueckig = str_replace(":-(","<img src=\"/pic/smiles/icon_sad.gif\">",$neueckig);
$neueckig = str_replace(":o(","<img src=\"/pic/smiles/icon_sad.gif\">",$neueckig);
$neueckig = str_replace(":o)","<img src=\"/pic/smiles/icon_lol.gif\">",$neueckig);
$neueckig = str_replace(";o(","<img src=\"/pic/smiles/icon_cry.gif\">",$neueckig);
$neueckig = str_replace(";(","<img src=\"/pic/smiles/icon_cry.gif\">",$neueckig);
$neueckig = str_replace(";-(","<img src=\"/pic/smiles/icon_cry.gif\">",$neueckig);
$neueckig = str_replace("8)","<img src=\"/pic/smiles/icon_rolleyes.gif\">",$neueckig);
$neueckig = str_replace("8o)","<img src=\"/pic/smiles/icon_rolleyes.gif\">",$neueckig);
$neueckig = str_replace(":P","<img src=\"/pic/smiles/icon_evil.gif\">",$neueckig);
$neueckig = str_replace(":-P","<img src=\"/pic/smiles/icon_evil.gif\">",$neueckig);
$neueckig = str_replace(":oP","<img src=\"/pic/smiles/icon_evil.gif\">",$neueckig);
$neueckig = str_replace(";P","<img src=\"/pic/smiles/icon_mad.gif\">",$neueckig);
$neueckig = str_replace(";oP","<img src=\"/pic/smiles/icon_mad.gif\">",$neueckig);
$neueckig = str_replace("?)","<img src=\"/pic/smiles/icon_question.gif\">",$neueckig);
$neueckig = str_replace(";o))", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_redface.gif\">",$neueckig);
$neueckig = str_replace(":-))", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_redface.gif\">",$neueckig);
$neueckig = str_replace(";o)", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_wind.gif\">",$neueckig);
$neueckig = str_replace(":)", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_smile.gif\">",$neueckig);
$neueckig = str_replace(":-)", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_smile.gif\">",$neueckig);
$neueckig = str_replace(":(", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_sad.gif\">",$neueckig);
$neueckig = str_replace(":-(", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_sad.gif\">",$neueckig);
$neueckig = str_replace(":o(", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_sad.gif\">",$neueckig);
$neueckig = str_replace(":o)", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_lol.gif\">",$neueckig);
$neueckig = str_replace(";o(", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_cry.gif\">",$neueckig);
$neueckig = str_replace(";(", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_cry.gif\">",$neueckig);
$neueckig = str_replace(";-(", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_cry.gif\">",$neueckig);
$neueckig = str_replace("8)", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_rolleyes.gif\">",$neueckig);
$neueckig = str_replace("8o)", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_rolleyes.gif\">",$neueckig);
$neueckig = str_replace(":P", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_evil.gif\">",$neueckig);
$neueckig = str_replace(":-P", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_evil.gif\">",$neueckig);
$neueckig = str_replace(":oP", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_evil.gif\">",$neueckig);
$neueckig = str_replace(";P", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_mad.gif\">",$neueckig);
$neueckig = str_replace(";oP", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_mad.gif\">",$neueckig);
$neueckig = str_replace("?)", "<img src=\"". $url. $ENGEL_ROOT. "pic/smiles/icon_question.gif\">",$neueckig);
return $neueckig;
}
@ -98,7 +100,7 @@ function displayPictur($UID, $height="30")
[<Höhe des Bildes (wenn die höhe kleiner 1 ist wird die höhe nicht begrenzt)>] */
function displayavatar( $UID, $height="30")
{
global $con;
global $con, $url, $ENGEL_ROOT;
if( GetPicturShow($UID) == 'Y')
return "&nbsp;". displayPictur( $UID, $height);
@ -108,7 +110,7 @@ function displayavatar( $UID, $height="30")
$aerg = mysql_query ($asql, $con);
if( mysql_num_rows($aerg) )
if( mysql_result($aerg, 0, "Avatar") > 0)
return ("&nbsp;<img src=\"/pic/avatar/avatar". mysql_result($aerg, 0, "Avatar"). ".gif\">");
return ("&nbsp;<img src=\"". $url. $ENGEL_ROOT. "pic/avatar/avatar". mysql_result($aerg, 0, "Avatar"). ".gif\">");
}

View File

@ -7,7 +7,7 @@ echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
<HEAD>
<?PHP
echo "<TITLE>--- $title ---</TITLE>";
echo "<TITLE>--- $title ---</TITLE>\n";
?>
<meta name="keywords" content="Engel, Himmelsverwaltung">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
@ -16,61 +16,64 @@ echo "<TITLE>--- $title ---</TITLE>";
<meta name="robots" content="index">
<meta name="revisit-after" content="1 days">
<meta http-equiv="content-language" content="de">
<script type="text/javascript" src="<?PHP echo $url. substr( $ENGEL_ROOT, 1); ?>/css/grossbild.js"></script>
<link rel=stylesheet type="text/css" href="<?PHP echo $url. substr( $ENGEL_ROOT, 1); ?>css/style<?PHP
<script type="text/javascript" src="<?PHP echo $url. $ENGEL_ROOT; ?>/css/grossbild.js"></script>
<link rel=stylesheet type="text/css" href="<?PHP echo $url. $ENGEL_ROOT; ?>css/style<?PHP
if (!IsSet($_SESSION['color']))
echo "6";
else
echo $_SESSION['color'];
?>.css">
<?PHP
if (isset($reload)) {
if ($reload=="") $reload=3330;
if (isset($reload))
{
if ($reload=="")
{
$reload=3330;
}
echo "\n<meta http-equiv=\"refresh\" content=\"".$reload.
"; URL=./?reload=".$reload."\">\n";
}
}
if (isset($Page["AutoReload"])) {
echo "\n<meta http-equiv=\"refresh\" content=\"". $Page["AutoReload"].
"; URL=". substr($url, 0, strlen($url)-1). $ENGEL_ROOT. $Page["Name"]."\">\n";
}
?>
</HEAD>
<BODY>
<?PHP
if( isset($SystemDisableMessage))
if( strlen($SystemDisableMessage)>0)
{
echo $SystemDisableMessage;
echo "\n\n<BODY>\n</HTML>";
die();
}
if( !isset($Page["ShowTabel"]) ) $Page["ShowTabel"]="Y";
if( $Page["ShowTabel"]=="Y" )
if (isset($Page["AutoReload"]))
{
//############################### ShowTable Start ##############################
echo "\n<meta http-equiv=\"refresh\" content=\"". $Page["AutoReload"].
"; URL=". $url. $ENGEL_ROOT. $Page["Name"]."\">\n";
}
echo "</HEAD>\n";
/////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////// B O D Y
/////////////////////////////////////////////////////////////////////////////////////////////
echo "<BODY>\n";
echo "<div name=\"topic\" align=\"center\">\n\n";
if( isset($_SESSION['color']) && ($_SESSION['color']==6) )
{
echo "\t<a name=\"#top\"><img src=\"". $url. $ENGEL_ROOT. "pic/himmel_w.png\" alt=\"Unser Himmel\"></a>\n";
}
else
{
echo "\t<a name=\"#top\"><img src=\"". $url. $ENGEL_ROOT. "pic/himmel.png\" alt=\"Unser Himmel\"></a>\n";
}
echo "</div>\n\n";
?>
<div align="center">
<a name="#top"><img src="<?PHP echo $url. substr( $ENGEL_ROOT, 1); ?>pic/himmel<?PHP if( isset($_SESSION['color']))
if ($_SESSION['color']==6) echo "_w"; ?>.png" alt="Unser Himmel"></a>
<p>
<?PHP
//ausgabe new message
if( isset($_SESSION['CVS']["nonpublic/messages.php"]))
{
if( $_SESSION['CVS']["nonpublic/messages.php"] == "Y")
{
$SQL = "SELECT `Datum` FROM `Messages` WHERE `RUID`=". $_SESSION["UID"]. " AND `isRead`='N'";
$erg = mysql_query($SQL, $con);
if( mysql_num_rows( $erg ) > 0 )
echo "<br><a href=\"". $url. substr($ENGEL_ROOT, 1).
echo "<br><a href=\"". $url. $ENGEL_ROOT.
"nonpublic/messages.php\">". Get_Text("pub_messages_new1").
" ". mysql_num_rows( $erg ). " ".
Get_Text("pub_messages_new2"). "</a><br><br>";
}
}
?>
<table width="95%" align="center" border="0" cellpadding="7" cellspacing="0">
<tr>
@ -109,10 +112,6 @@ if (IsSet($_SESSION['UID'])) {
}
//############################### ShowTable Start ##############################
} /* if (ShowTabel....*/
function SetHeaderGo2Back ()
{
global $BACKUP_SESSION_OLDURL;
@ -126,7 +125,7 @@ if ( $Page["CVS"] != "Y" )
If (IsSet($_SESSION['oldurl']))
echo "<a href=\"". $_SESSION["oldurl"]. "\">".Get_Text("back")."</a> geht's zur&uuml;ck...\n";
else
echo "<a href=\"". $url. substr($ENGEL_ROOT, 0, -1 )."\">".Get_Text("back")."</a> geht's zur&uuml;ck...\n";
echo "<a href=\"". $url. $ENGEL_ROOT. "\">".Get_Text("back")."</a> geht's zur&uuml;ck...\n";
exit ();
}
?>

View File

@ -9,17 +9,30 @@ include ("funktion_faq.php"); //f
include ("funktion_menu.php");
include ("funktion_user.php");
if( isset($SystemDisableMessage) && ( strlen($SystemDisableMessage)>0) )
{
echo "<HTML>\n".
"<BODY>\n". $SystemDisableMessage. "\n<BODY>\n".
"</HTML>";
die();
}
if( !isset($_SESSION))
{
session_start();
}
include ("secure.php");
if( !isset($_SESSION['IP']))
{
$_SESSION['IP'] = $_SERVER['REMOTE_ADDR'];
}
if (IsSet($_SESSION['UID']) and ($_SESSION['IP'] <> $_SERVER['REMOTE_ADDR']))
{
session_destroy ();
header("Location: $url". substr($ENGEL_ROOT,1) );
header("Location: $url". $ENGEL_ROOT );
}
include ("UserCVS.php");

View File

@ -1,21 +1,18 @@
<form action="<?PHP
<?PHP
include ("config.php");
echo substr($url, 0, strlen($url)-1). $ENGEL_ROOT
?>nonpublic/index.php" method="post">
<table>
<tr>
<td align="right"><?PHP echo Get_Text("index_lang_nick");?></td>
<td><input type="text" name="user" size="23"></td>
</tr>
<tr>
<td align="right"><?PHP echo Get_Text("index_lang_pass");?></td>
<td><input type="password" name="password" size="23"></td>
</tr>
</table>
<br>
<input type="submit" value="<?PHP echo Get_Text("index_lang_send");?>">
</form>
echo "<form action=\"". $url. $ENGEL_ROOT. "nonpublic/index.php\" method=\"post\">";
echo "<table>\n".
"\t<tr>".
"\t\t<td align=\"right\">". Get_Text("index_lang_nick"). "</td>".
"\t\t<td><input type=\"text\" name=\"user\" size=\"23\"></td>".
"\t</tr>".
"\t<tr>".
"\t\t<td align=\"right\">". Get_Text("index_lang_pass"). "</td>".
"\t\t<td><input type=\"password\" name=\"password\" size=\"23\"></td>".
"\t</tr>".
"</table>".
"<br><input type=\"submit\" value=\"". Get_Text("index_lang_send"). "\">";
echo "</form>";

View File

@ -1 +0,0 @@
../www-ssl/inc

View File

@ -8,6 +8,6 @@ session_destroy ();
session_start();
header("HTTP/1.1 302 Moved Temporarily");
header("Location: ". substr($url, 0, strlen($url)-1). $ENGEL_ROOT);
header("Location: ". $url. $ENGEL_ROOT);
?>

View File

@ -175,12 +175,12 @@ if( $_SESSION['CVS'][ "Change T_Shirt Size" ] == "Y" )
echo "\t\t<tr>\n\t\t\t<td>". Get_Text(23). "<br></td>\n\t\t</tr>\n";
echo "\t\t<tr>\n";
echo "\t\t\t<td>\n";
echo "\t\t\t\t<select name=\"eAvatar\" onChange=\"document.avatar.src = '../pic/avatar/avatar' + this.value + '.gif'\"".
"onKeyup=\"document.avatar.src = '../pic/avatar/avatar' + this.value + '.gif'\">\n";
for ($i=1; file_exists("../pic/avatar/avatar$i.gif"); $i++ )
echo "\t\t\t\t<select name=\"eAvatar\" onChange=\"document.avatar.src = '". $url. $ENGEL_ROOT. "pic/avatar/avatar' + this.value + '.gif'\"".
"onKeyup=\"document.avatar.src = '". $url. $ENGEL_ROOT. "pic/avatar/avatar' + this.value + '.gif'\">\n";
for ($i=1; file_exists("". "../pic/avatar/avatar$i.gif"); $i++ )
echo "\t\t\t\t\t<option value=\"$i\"". ($_SESSION['Avatar'] == $i ? " selected":""). ">avatar$i</option>\n";
echo "\t\t\t\t</select>&nbsp;&nbsp;\n";
echo "\t\t\t\t<img src=\"../pic/avatar/avatar". $_SESSION['Avatar']. ".gif\" name=\"avatar\" border=\"0\" align=\"top\">\n";
echo "\t\t\t\t<img src=\"". $url. $ENGEL_ROOT. "pic/avatar/avatar". $_SESSION['Avatar']. ".gif\" name=\"avatar\" border=\"0\" align=\"top\">\n";
echo "\t\t\t</td>\n\t\t</tr>\n";
echo "\t</table>\n";
echo "\t<input type=\"submit\" value=\"". Get_Text("save"),"\">\n";

View File

@ -11,7 +11,7 @@ function LoginOK()
{
include ("../../includes/config.php");
header("HTTP/1.1 302 Moved Temporarily");
header("Location: ". substr($url, 0, strlen($url)-1). $ENGEL_ROOT. "nonpublic/news.php");
header("Location: ". $url. $ENGEL_ROOT. "nonpublic/news.php");
}
if ( !IsSet($_POST["user"]))

View File

@ -35,7 +35,7 @@ for( $i=0; $i<mysql_num_rows( $erg ); $i++ )
echo "SUMMARY:". str_replace( ',', '\\,',mysql_result( $erg, $i, "Man" ) ). "\n";
echo "CLASS:PUBLIC\n";
echo "STATUS:CONFIRMED\n";
echo "URL:". $url. substr($ENGEL_ROOT,1). "nonpublic/myschichtplan.php\n";
echo "URL:". $url. $ENGEL_ROOT. "nonpublic/myschichtplan.php\n";
echo "LOCATION:". $RoomID[mysql_result( $erg, $i, "RID" )]. "\n";
echo "BEGIN:VALARM\n";
echo "TRIGGER;VALUE=DURATION:-PT5M\n";

View File

@ -32,7 +32,7 @@ for ($n = 0 ; $n < $news_rows ; $n++)
else
echo "<p class='engeltreffen'>";
echo "<u>".mysql_result($Erg, $n, "Betreff")."</u>\n";
echo "<u>". ReplaceSmilies(mysql_result($Erg, $n, "Betreff")) ."</u>\n";
// Schow Admin Page
if( $_SESSION['CVS'][ "admin/news.php" ] == "Y" )

View File

@ -12,7 +12,7 @@ $Time = time()+3600+3600;
<HEAD>
<TITLE>Schichtpl&auml;ne f&uuml;r Beamer</TITLE>
<!--<link rel=stylesheet type="text/css" href="/css/style1.css">-->
<meta http-equiv="refresh" content="30; URL=<?PHP echo substr($url, 0, strlen($url)-1). $_SERVER['PHP_SELF']?>">
<meta http-equiv="refresh" content="30; URL=<?PHP echo $url. $_SERVER['PHP_SELF']?>">
</HEAD>
<BODY>
<?PHP