From 2ca2400b779484ff025b0705ff4fb84ead7c4b20 Mon Sep 17 00:00:00 2001 From: Angelo Cuccato Date: Tue, 31 Aug 2010 21:16:16 +0200 Subject: clean url handling --- default-conf/var_www_includes/config.php | 2 +- includes/error_handler.php | 2 - includes/footer.php | 10 ----- includes/funktion_flag.php | 4 +- includes/funktion_menu.php | 2 +- includes/funktion_user.php | 48 ++++++++++---------- includes/header.php | 77 ++++++++++++++++---------------- includes/header_start.php | 15 ++++++- includes/login_eingabefeld.php | 33 +++++++------- services/inc | 1 - www-ssl/logout.php | 2 +- www-ssl/nonpublic/einstellungen.php | 8 ++-- www-ssl/nonpublic/index.php | 2 +- www-ssl/nonpublic/myschichtplan_ical.php | 2 +- www-ssl/nonpublic/news_output.php | 2 +- www-ssl/nonpublic/schichtplan_beamer.php | 2 +- 16 files changed, 105 insertions(+), 107 deletions(-) delete mode 120000 services/inc diff --git a/default-conf/var_www_includes/config.php b/default-conf/var_www_includes/config.php index 68b51acc..54dbd5f3 100755 --- a/default-conf/var_www_includes/config.php +++ b/default-conf/var_www_includes/config.php @@ -1,6 +1,6 @@ @@ -57,11 +53,5 @@ if( $_SESSION['Menu'] =="R") include("menu.php"); - - - diff --git a/includes/funktion_flag.php b/includes/funktion_flag.php index 08c29ac1..56d8a993 100644 --- a/includes/funktion_flag.php +++ b/includes/funktion_flag.php @@ -6,7 +6,7 @@ if( strpos( $_SERVER["REQUEST_URI"], "?") >0) else $URL = $_SERVER["REQUEST_URI"]. "?SetLanguage="; -echo "\"DE\" "; -echo "\"EN\" "; +echo "\"DE\" "; +echo "\"EN\" "; ?> diff --git a/includes/funktion_menu.php b/includes/funktion_menu.php index e728e339..87196ede 100755 --- a/includes/funktion_menu.php +++ b/includes/funktion_menu.php @@ -27,7 +27,7 @@ function ShowMenu( $MenuName) if( $Key=="admin/faq.php") $TempName .= " (". noAnswer(). ")"; //ausgabe - $Text .= "\t\t\t
  • $TempName
  • \n"; + $Text .= "\t\t\t
  • $TempName
  • \n"; $Gefunden = TRUE; } } diff --git a/includes/funktion_user.php b/includes/funktion_user.php index 742b2624..58ee6ea4 100755 --- a/includes/funktion_user.php +++ b/includes/funktion_user.php @@ -41,29 +41,31 @@ function TID2Type($TID) } -function ReplaceSmilies($eckig) { +function ReplaceSmilies($eckig) +{ + global $url, $ENGEL_ROOT; $neueckig = $eckig; - $neueckig = str_replace(";o))","",$neueckig); - $neueckig = str_replace(":-))","",$neueckig); - $neueckig = str_replace(";o)","",$neueckig); - $neueckig = str_replace(":)","",$neueckig); - $neueckig = str_replace(":-)","",$neueckig); - $neueckig = str_replace(":(","",$neueckig); - $neueckig = str_replace(":-(","",$neueckig); - $neueckig = str_replace(":o(","",$neueckig); - $neueckig = str_replace(":o)","",$neueckig); - $neueckig = str_replace(";o(","",$neueckig); - $neueckig = str_replace(";(","",$neueckig); - $neueckig = str_replace(";-(","",$neueckig); - $neueckig = str_replace("8)","",$neueckig); - $neueckig = str_replace("8o)","",$neueckig); - $neueckig = str_replace(":P","",$neueckig); - $neueckig = str_replace(":-P","",$neueckig); - $neueckig = str_replace(":oP","",$neueckig); - $neueckig = str_replace(";P","",$neueckig); - $neueckig = str_replace(";oP","",$neueckig); - $neueckig = str_replace("?)","",$neueckig); + $neueckig = str_replace(";o))", "",$neueckig); + $neueckig = str_replace(":-))", "",$neueckig); + $neueckig = str_replace(";o)", "",$neueckig); + $neueckig = str_replace(":)", "",$neueckig); + $neueckig = str_replace(":-)", "",$neueckig); + $neueckig = str_replace(":(", "",$neueckig); + $neueckig = str_replace(":-(", "",$neueckig); + $neueckig = str_replace(":o(", "",$neueckig); + $neueckig = str_replace(":o)", "",$neueckig); + $neueckig = str_replace(";o(", "",$neueckig); + $neueckig = str_replace(";(", "",$neueckig); + $neueckig = str_replace(";-(", "",$neueckig); + $neueckig = str_replace("8)", "",$neueckig); + $neueckig = str_replace("8o)", "",$neueckig); + $neueckig = str_replace(":P", "",$neueckig); + $neueckig = str_replace(":-P", "",$neueckig); + $neueckig = str_replace(":oP", "",$neueckig); + $neueckig = str_replace(";P", "",$neueckig); + $neueckig = str_replace(";oP", "",$neueckig); + $neueckig = str_replace("?)", "",$neueckig); return $neueckig; } @@ -98,7 +100,7 @@ function displayPictur($UID, $height="30") [] */ function displayavatar( $UID, $height="30") { - global $con; + global $con, $url, $ENGEL_ROOT; if( GetPicturShow($UID) == 'Y') return " ". 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 (" "); + return (" "); } diff --git a/includes/header.php b/includes/header.php index 9a39ab53..e5d97a0c 100755 --- a/includes/header.php +++ b/includes/header.php @@ -7,7 +7,7 @@ echo "\n"; --- $title ---"; +echo "--- $title ---\n"; ?> @@ -16,61 +16,64 @@ echo "--- $title ---"; - - +.css"> \n"; - } - -if (isset($Page["AutoReload"])) { - echo "\n\n"; - } -?> - - -0) +if (isset($reload)) +{ + if ($reload=="") { - echo $SystemDisableMessage; - echo "\n\n\n"; - die(); - } + $reload=3330; + } + echo "\n\n"; +} + +if (isset($Page["AutoReload"])) +{ + echo "\n\n"; +} + +echo "\n"; + +///////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////// B O D Y +///////////////////////////////////////////////////////////////////////////////////////////// +echo "\n"; +echo "
    \n\n"; -if( !isset($Page["ShowTabel"]) ) $Page["ShowTabel"]="Y"; -if( $Page["ShowTabel"]=="Y" ) +if( isset($_SESSION['color']) && ($_SESSION['color']==6) ) { -//############################### ShowTable Start ############################## + echo "\t\"Unser\n"; +} +else +{ + echo "\t\"Unser\n"; +} +echo "
    \n\n"; + -?> -
    - .png" alt="Unser Himmel"> -

    - 0 ) - echo "
    ". Get_Text("pub_messages_new1"). " ". mysql_num_rows( $erg ). " ". Get_Text("pub_messages_new2"). "

    "; } +} ?> @@ -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 "".Get_Text("back")." geht's zurück...\n"; else - echo "".Get_Text("back")." geht's zurück...\n"; + echo "".Get_Text("back")." geht's zurück...\n"; exit (); } ?> diff --git a/includes/header_start.php b/includes/header_start.php index 218a30ec..997fa94e 100755 --- a/includes/header_start.php +++ b/includes/header_start.php @@ -9,17 +9,30 @@ include ("funktion_faq.php"); //f include ("funktion_menu.php"); include ("funktion_user.php"); + +if( isset($SystemDisableMessage) && ( strlen($SystemDisableMessage)>0) ) +{ + echo "\n". + "\n". $SystemDisableMessage. "\n\n". + ""; + 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"); diff --git a/includes/login_eingabefeld.php b/includes/login_eingabefeld.php index 437e030d..bed1a2fd 100755 --- a/includes/login_eingabefeld.php +++ b/includes/login_eingabefeld.php @@ -1,21 +1,18 @@ - - -nonpublic/index.php" method="post"> -
    - - - - - - - - -
    -
    -"> - + +echo "

    "; +echo "\n". + "\t". + "\t\t". + "\t\t". + "\t". + "\t". + "\t\t". + "\t\t". + "\t". + "
    ". Get_Text("index_lang_nick"). "
    ". Get_Text("index_lang_pass"). "
    ". + "
    "; +echo "
    "; diff --git a/services/inc b/services/inc deleted file mode 120000 index 54c38819..00000000 --- a/services/inc +++ /dev/null @@ -1 +0,0 @@ -../www-ssl/inc \ No newline at end of file diff --git a/www-ssl/logout.php b/www-ssl/logout.php index 38b3b575..e038be69 100755 --- a/www-ssl/logout.php +++ b/www-ssl/logout.php @@ -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); ?> diff --git a/www-ssl/nonpublic/einstellungen.php b/www-ssl/nonpublic/einstellungen.php index 191db729..aabcb830 100755 --- a/www-ssl/nonpublic/einstellungen.php +++ b/www-ssl/nonpublic/einstellungen.php @@ -175,12 +175,12 @@ if( $_SESSION['CVS'][ "Change T_Shirt Size" ] == "Y" ) echo "\t\t\n\t\t\t". Get_Text(23). "
    \n\t\t\n"; echo "\t\t\n"; echo "\t\t\t\n"; - echo "\t\t\t\t\n"; + for ($i=1; file_exists("". "../pic/avatar/avatar$i.gif"); $i++ ) echo "\t\t\t\t\t\n"; echo "\t\t\t\t  \n"; - echo "\t\t\t\t\n"; + echo "\t\t\t\t\n"; echo "\t\t\t\n\t\t\n"; echo "\t\n"; echo "\t\n"; diff --git a/www-ssl/nonpublic/index.php b/www-ssl/nonpublic/index.php index de833eb4..affb571e 100755 --- a/www-ssl/nonpublic/index.php +++ b/www-ssl/nonpublic/index.php @@ -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"])) diff --git a/www-ssl/nonpublic/myschichtplan_ical.php b/www-ssl/nonpublic/myschichtplan_ical.php index dfe06f07..9cbef3b2 100755 --- a/www-ssl/nonpublic/myschichtplan_ical.php +++ b/www-ssl/nonpublic/myschichtplan_ical.php @@ -35,7 +35,7 @@ for( $i=0; $i"; - echo "".mysql_result($Erg, $n, "Betreff")."\n"; + echo "". ReplaceSmilies(mysql_result($Erg, $n, "Betreff")) ."\n"; // Schow Admin Page if( $_SESSION['CVS'][ "admin/news.php" ] == "Y" ) diff --git a/www-ssl/nonpublic/schichtplan_beamer.php b/www-ssl/nonpublic/schichtplan_beamer.php index 25979db2..cd410fc2 100755 --- a/www-ssl/nonpublic/schichtplan_beamer.php +++ b/www-ssl/nonpublic/schichtplan_beamer.php @@ -12,7 +12,7 @@ $Time = time()+3600+3600; Schichtpläne für Beamer - +