From a52ee4a288ec57c2983173460237e4137440a873 Mon Sep 17 00:00:00 2001
From: cookie
Date: Mon, 4 Dec 2006 19:54:51 +0000
Subject: [PATCH] SQL injektion behoben
git-svn-id: svn://svn.cccv.de/engel-system@198 29ba0400-6e00-0410-a75a-ca02368028f8
---
www-ssl/admin/EngelType.php | 6 +++---
www-ssl/admin/aktiv.php | 14 +++++++-------
www-ssl/admin/debug.php | 2 +-
www-ssl/admin/dect.php | 2 +-
www-ssl/admin/faq.php | 26 +++++++++++++-------------
www-ssl/admin/free.php | 2 +-
www-ssl/admin/news.php | 10 +++++-----
www-ssl/admin/room.php | 2 +-
www-ssl/admin/schichtplan.php | 24 ++++++++++++------------
www-ssl/admin/schichtplan_druck.php | 2 +-
www-ssl/admin/shiftadd.php | 2 +-
www-ssl/admin/tshirt.php | 4 ++--
www-ssl/admin/user.php | 10 +++++-----
www-ssl/admin/user2.php | 16 ++++++++--------
www-ssl/admin/userDefaultSetting.php | 2 +-
www-ssl/makeuser.php | 2 +-
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 +++++-----
25 files changed, 99 insertions(+), 100 deletions(-)
diff --git a/www-ssl/admin/EngelType.php b/www-ssl/admin/EngelType.php
index 03f89b85..192a0d91 100755
--- a/www-ssl/admin/EngelType.php
+++ b/www-ssl/admin/EngelType.php
@@ -47,7 +47,7 @@ function runSQL_log( $SQL, $commed)
-$Sql = "SELECT * FROM `EngelType` ORDER BY NAME";
+$Sql = "SELECT * FROM `EngelType` ORDER BY `NAME`";
$Erg = mysql_query($Sql, $con);
if( !IsSet($_GET["action"]) )
@@ -177,9 +177,9 @@ case 'changesave':
case 'delete':
if (IsSet($_GET["TID"]))
{
- if( runSQL_log( "DELETE FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'", "delate EngelType"))
+ if( runSQL_log( "DELETE FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'", "delete EngelType"))
runSQL_log( "ALTER TABLE `Room` DROP `DEFAULT_EID_". $_GET["TID"]. "`;",
- "delate EngelType in Room Table");
+ "delete EngelType in Room Table");
}
else
echo "Fehlerhafter Aufruf";
diff --git a/www-ssl/admin/aktiv.php b/www-ssl/admin/aktiv.php
index 35eab81e..1bf7fbe1 100755
--- a/www-ssl/admin/aktiv.php
+++ b/www-ssl/admin/aktiv.php
@@ -27,7 +27,7 @@ echo "\n";
if( Isset($_POST["ResetActive"]) )
{
- $SQLreset = "UPDATE `User` SET `Aktiv` = '0'";
+ $SQLreset = "UPDATE `User` SET `Aktiv`='0'";
$ErgReset = db_query($SQLreset, "Reset Active");
if ($ErgReset != 1)
echo "Fehler beim zuruecksetzen der Activ\n";
@@ -50,11 +50,11 @@ echo "\t". Get_Text("pub_aktive_Active"). " | \n";
echo "\n";
$SQL = "SELECT ShiftEntry.UID, COUNT(ShiftEntry.UID) AS NR, SUM(Shifts.Len) as LEN ".
- "FROM `ShiftEntry` ".
- "LEFT JOIN `Shifts` ON ShiftEntry.SID=Shifts.SID ".
- "WHERE NOT UID=0 ".
- "GROUP BY UID ".
- "ORDER BY LEN DESC, NR DESC, UID ";
+ "FROM `ShiftEntry` ".
+ "LEFT JOIN `Shifts` ON ShiftEntry.SID=Shifts.SID ".
+ "WHERE NOT UID=0 ".
+ "GROUP BY UID ".
+ "ORDER BY LEN DESC, NR DESC, UID ";
$Erg = mysql_query($SQL, $con);
echo mysql_error($con);
$rowcount = mysql_num_rows($Erg);
@@ -76,7 +76,7 @@ for ($i=0; $i<$rowcount; $i++)
echo "show set";
else
{
- $SQL2="UPDATE `User` SET Aktiv=1 WHERE UID=". mysql_result($Erg, $i, "UID"). " LIMIT 1";
+ $SQL2="UPDATE `User` SET `Aktiv`='1' WHERE `UID`='". mysql_result($Erg, $i, "UID"). "' LIMIT 1";
$Erg2 = db_query($SQL2, "update Active State");
if ($Erg2 != 1)
echo "Fehler beim speichern bei Engel ".UID2Nick(mysql_result($Erg, $i, "UID"));
diff --git a/www-ssl/admin/debug.php b/www-ssl/admin/debug.php
index aaf1bcb4..961a8164 100755
--- a/www-ssl/admin/debug.php
+++ b/www-ssl/admin/debug.php
@@ -32,7 +32,7 @@ echo "Deaktiviert";
echo "Tshirt-Size
";
-$SQL="SELECT `Size`, COUNT(`Size`) FROM User GROUP BY `Size`";
+$SQL="SELECT `Size`, COUNT(`Size`) FROM `User` GROUP BY `Size`";
$Erg = mysql_query($SQL, $con);
echo mysql_error($con);
$rowcount = mysql_num_rows($Erg);
diff --git a/www-ssl/admin/dect.php b/www-ssl/admin/dect.php
index 49cb72bc..1092542d 100755
--- a/www-ssl/admin/dect.php
+++ b/www-ssl/admin/dect.php
@@ -38,7 +38,7 @@ if( $_GET["dial"]=="dial")
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");
|