From a52ee4a288ec57c2983173460237e4137440a873 Mon Sep 17 00:00:00 2001
From: cookie
Date: Mon, 4 Dec 2006 19:54:51 +0000
Subject: SQL injektion behoben
git-svn-id: svn://svn.cccv.de/engel-system@198 29ba0400-6e00-0410-a75a-ca02368028f8
---
www-ssl/nonpublic/einstellungen.php | 22 +++++++++++-----------
www-ssl/nonpublic/faq.php | 6 +++---
www-ssl/nonpublic/index.php | 4 ++--
www-ssl/nonpublic/myschichtplan.php | 7 +++----
www-ssl/nonpublic/news_comments.php | 6 +++---
www-ssl/nonpublic/news_output.php | 12 ++++++------
www-ssl/nonpublic/schichtplan_add.php | 4 ++--
www-ssl/nonpublic/waeckliste.php | 2 +-
www-ssl/nonpublic/wecken.php | 10 +++++-----
9 files changed, 36 insertions(+), 37 deletions(-)
(limited to 'www-ssl/nonpublic')
diff --git a/www-ssl/nonpublic/einstellungen.php b/www-ssl/nonpublic/einstellungen.php
index faf72be5..eaec09fb 100755
--- a/www-ssl/nonpublic/einstellungen.php
+++ b/www-ssl/nonpublic/einstellungen.php
@@ -140,13 +140,13 @@ switch ($_POST["action"]) {
case 'set':
if ($_POST["new1"]==$_POST["new2"]){
Print_Text(25);
- $sql = "select * from User where UID=".$_SESSION['UID'];
+ $sql = "SELECT * FROM `User` WHERE `UID`='".$_SESSION['UID']. "'";
$Erg = mysql_query($sql, $con);
if (PassCrypt($_POST["old"])==mysql_result($Erg, 0, "Passwort")) {
Print_Text(26);
Print_Text(27);
- $usql = "update User set Passwort='".PassCrypt($_POST["new1"])."' ".
- "where UID=".$_SESSION['UID']." limit 1";
+ $usql = "UPDATE `User` SET `Passwort`='". PassCrypt($_POST["new1"]). "' ".
+ " WHERE `UID`='". $_SESSION['UID']. "' LIMIT 1";
$Erg = mysql_query($usql, $con);
if ($Erg==1) {
Print_Text(28);
@@ -163,10 +163,10 @@ case 'set':
case 'colour':
- $chsql="Update User set ".
- "`color` = \"". $_POST["colourid"]. "\", ".
- "`Menu`= \"". $_POST["eMenu"]. "\" ".
- "where UID = \"".$_SESSION['UID']."\" limit 1";
+ $chsql="UPDATE `User` SET ".
+ "`color`= '". $_POST["colourid"]. "', ".
+ "`Menu`= '". $_POST["eMenu"]. "' ".
+ "WHERE `UID`='". $_SESSION['UID']. "' LIMIT 1";
$Erg = mysql_query($chsql, $con);
echo mysql_error($con);
$_SESSION['color']=$_POST["colourid"];
@@ -180,7 +180,7 @@ case 'colour':
case 'sprache':
- $chsql="Update User set Sprache = \"". $_POST["language"]. "\" where UID = \"".$_SESSION['UID']."\" limit 1";
+ $chsql="UPDATE `User` SET `Sprache` = '". $_POST["language"]. "' WHERE `UID`='". $_SESSION['UID']. "' LIMIT 1";
$Erg = mysql_query($chsql, $con);
$_SESSION['Sprache']=$_POST["language"];
if ($Erg==1) {
@@ -191,7 +191,7 @@ case 'sprache':
break;
case 'avatar':
- $chsql="Update User set Avatar = \"". $_POST["eAvatar"]. "\" where UID = \"". $_SESSION['UID']. "\" limit 1";
+ $chsql="UPDATE `User` SET `Avatar`='". $_POST["eAvatar"]. "' WHERE `UID`='". $_SESSION['UID']. "' LIMIT 1";
$Erg = mysql_query($chsql, $con);
$_SESSION['Avatar']=$_POST["eAvatar"];
if ($Erg==1) {
@@ -202,14 +202,14 @@ case 'avatar':
break;
case 'setUserData':
- $chsql= "UPDATE User SET ".
+ $chsql= "UPDATE `User` SET ".
"`Nick`='". $_POST["eNick"]. "', `Name`='". $_POST["eName"]. "', ".
"`Vorname`='". $_POST["eVorname"]. "', `Alter`='". $_POST["eAlter"]. "', ".
"`Telefon`='". $_POST["eTelefon"]. "', `Handy`='". $_POST["eHandy"]. "', ".
"`DECT`='". $_POST["eDECT"]. "', `email`='". $_POST["eemail"]. "', ".
"`ICQ`='". $_POST["eICQ"]. "', `jabber`='". $_POST["ejabber"]."', ".
"`Hometown`='". $_POST["Hometown"]. "' ".
- "WHERE UID='". $_SESSION['UID']. "' LIMIT 1;";
+ "WHERE `UID`='". $_SESSION['UID']. "' LIMIT 1;";
$Erg = mysql_query($chsql, $con);
if ($Erg==1)
diff --git a/www-ssl/nonpublic/faq.php b/www-ssl/nonpublic/faq.php
index fb7dab8c..b7d01835 100755
--- a/www-ssl/nonpublic/faq.php
+++ b/www-ssl/nonpublic/faq.php
@@ -23,7 +23,7 @@ if (!IsSet($_POST["eUID"]))
echo "".Get_Text(37)."
\n".nl2br($_POST["frage"])."
\n".Get_Text(38)."
\n";
-$SQL = "INSERT into Questions VALUES (\"\", \"".$_SESSION['UID']."\", \"". $_POST["frage"]. "\", \"\", \"\")";
+$SQL = "INSERT INTO `Questions` VALUES ('', '".$_SESSION['UID']."', '". $_POST["frage"]. "', '', '')";
$Erg = mysql_query($SQL, $con);
}
@@ -32,7 +32,7 @@ echo "
\n".Get_Text(39)."
\n";
echo "
\n";
echo "
".Get_Text(40)."
\n";
-$SQL = "SELECT * from Questions where UID = ".$_SESSION['UID']." and AID=\"0\" ORDER BY 'QID' DESC";
+$SQL = "SELECT * FROM `Questions` WHERE `UID` = ". $_SESSION['UID']. " AND `AID`='0' ORDER BY 'QID' DESC";
$Erg = mysql_query($SQL, $con);
// anzahl zeilen
@@ -52,7 +52,7 @@ if ($Zeilen==0){
echo "
\n";
echo "
".Get_Text(42)."
\n";
-$SQL = "SELECT * from Questions where UID = ".$_SESSION['UID']." and AID<>\"0\" ORDER BY 'QID' DESC";
+$SQL = "SELECT * FROM `Questions` WHERE `UID`='".$_SESSION['UID']."' and `AID`<>'0' ORDER BY 'QID' DESC";
$Erg = mysql_query($SQL, $con);
// anzahl zeilen
diff --git a/www-ssl/nonpublic/index.php b/www-ssl/nonpublic/index.php
index 20b32c00..ba47e4d9 100755
--- a/www-ssl/nonpublic/index.php
+++ b/www-ssl/nonpublic/index.php
@@ -20,7 +20,7 @@ if ( !IsSet($_POST["user"]))
}
else
{ // User ist noch nicht angemeldet
- $sql = "select * from User where Nick = '". $_POST["user"]. "'";
+ $sql = "SELECT * FROM `User` WHERE `Nick`='". $_POST["user"]. "'";
$userstring = mysql_query($sql, $con);
// anzahl zeilen
@@ -54,7 +54,7 @@ else
$_SESSION['IP'] = $_SERVER['REMOTE_ADDR'];
// CVS import Data
- $SQL = "SELECT * FROM `UserCVS` WHERE UID='".$_SESSION['UID']."'";
+ $SQL = "SELECT * FROM `UserCVS` WHERE `UID`='".$_SESSION['UID']."'";
$Erg_CVS = mysql_query($SQL, $con);
$_SESSION['CVS'] = mysql_fetch_array($Erg_CVS);
diff --git a/www-ssl/nonpublic/myschichtplan.php b/www-ssl/nonpublic/myschichtplan.php
index 5aac2b61..be10951b 100755
--- a/www-ssl/nonpublic/myschichtplan.php
+++ b/www-ssl/nonpublic/myschichtplan.php
@@ -88,8 +88,7 @@ else
{
echo Get_Text("pub_mywake_delate1")."
\n";
- $sql = "SELECT * FROM `Shifts` WHERE ";
- $sql.= "(SID = \"". $_GET["SID"]. "\")";
+ $sql = "SELECT * FROM `Shifts` WHERE (`SID` = '". $_GET["SID"]. "')";
$Erg = mysql_query($sql, $con);
$schichtdate = mysql_result( $Erg, 0, "DateS" );
@@ -124,7 +123,7 @@ else
echo Get_Text("pub_myshift_Edit_Text1"). "\n";
$sql = "SELECT * FROM `ShiftEntry` WHERE ";
- $sql.= "(SID=\"". $_GET["SID"]. "\" AND UID=\"". $_SESSION['UID']. "\" )";
+ $sql.= "(`SID`='". $_GET["SID"]. "' AND `UID`='". $_SESSION['UID']. "')";
$Erg = mysql_query($sql, $con);
echo "
\n";
echo "". ReplaceSmilies(nl2br(mysql_result($Erg, $n, "Text"))) ."
\n";
$RefID=mysql_result($Erg, $n, "ID");
- $countSQL="SELECT COUNT(*) from news_comments where Refid = '$RefID'";
+ $countSQL="SELECT COUNT(*) FROM `news_comments` WHERE `Refid`='$RefID'";
$countErg = mysql_query($countSQL, $con);
$countcom = mysql_result($countErg, 0, "COUNT(*)");
echo "\n\n";
}
echo "\n\n";
-$rowerg = mysql_query("select * from News", $con);
+$rowerg = mysql_query("SELECT * FROM `News`", $con);
$rows = mysql_num_rows($rowerg);
$dis_rows = round (($rows / $DISPLAY_NEWS)+0.5);
diff --git a/www-ssl/nonpublic/schichtplan_add.php b/www-ssl/nonpublic/schichtplan_add.php
index f12690c7..69170763 100755
--- a/www-ssl/nonpublic/schichtplan_add.php
+++ b/www-ssl/nonpublic/schichtplan_add.php
@@ -35,7 +35,7 @@ if (isset($_POST["newtext"]) && isset($_POST["SID"]) && isset($_POST["TID"])) {
{
//ermitteln der noch gesuchten
$SQL3 = "SELECT * FROM `ShiftEntry`".
- " WHERE ((`SID` = '". $_POST["SID"]. "') and (`TID` = '". $_POST["TID"]. "') and (`UID` = '0'));";
+ " WHERE ((`SID` = '". $_POST["SID"]. "') AND (`TID` = '". $_POST["TID"]. "') AND (`UID` = '0'));";
$Erg3 = mysql_query($SQL3, $con);
if( mysql_num_rows($Erg3) <= 0 )
@@ -65,7 +65,7 @@ elseif (isset($_GET["SID"]) && isset($_GET["TID"])) {
"
\n";
$SQL = "SELECT * FROM `Shifts` WHERE ";
- $SQL .="(SID = '". $_GET["SID"]. "')";
+ $SQL .="(`SID` = '". $_GET["SID"]. "')";
$Erg = mysql_query($SQL, $con);
echo "| ". Get_Text("pub_schichtplan_add_Date"). ": | ".
diff --git a/www-ssl/nonpublic/waeckliste.php b/www-ssl/nonpublic/waeckliste.php
index b2c2e420..15e1a4de 100755
--- a/www-ssl/nonpublic/waeckliste.php
+++ b/www-ssl/nonpublic/waeckliste.php
@@ -20,7 +20,7 @@ include ("./inc/header.php");
|