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 "\t\n"; - $usql="select * from User order by Nick"; + $usql="SELECT * FROM `User` ORDER BY `Nick`"; $uErg = mysql_query($usql, $con); $urowcount = mysql_num_rows($uErg); for ($k=0; $k<$urowcount; $k++) @@ -240,15 +240,15 @@ case 'engeladd': if( mysql_num_rows($ERG) != 0 ) { $chSQL = "UPDATE `ShiftEntry` SET ". - "`UID`='". $_GET["UIDs"]. "', `Comment`='shift added by ".$_SESSION['Nick']."' "; - $chSQL .= "WHERE (`SID`='". $_GET["SID"]. "' AND ". + "`UID`='". $_GET["UIDs"]. "', `Comment`='shift added by ".$_SESSION['Nick']."' ". + "WHERE (`SID`='". $_GET["SID"]. "' AND ". "`TID`='". $_GET["TID"]. "' AND `UID`='0' ) LIMIT 1"; } else { - $chSQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`, `UID`, `Comment`) VALUES ("; - $chSQL .= "'". $_GET["SID"]. "', '". $_GET["TID"]. "', ". - "'". $_GET["UIDs"]. "', 'shift added by ".$_SESSION['Nick']."')"; + $chSQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`, `UID`, `Comment`) VALUES (". + "'". $_GET["SID"]. "', '". $_GET["TID"]. "', ". + "'". $_GET["UIDs"]. "', 'shift added by ".$_SESSION['Nick']."')"; } echo "Es wird folgende Schicht zusätzlich eingetragen:
\n"; echo "Engel: ".UID2Nick($_GET["UIDs"])."
\n"; @@ -305,8 +305,8 @@ case 'changesave': break; case 'delete': - $chSQL = "DELETE FROM `Shifts` WHERE `SID`=". $_GET["SID"]. " LIMIT 1"; - $ch2SQL = "DELETE FROM `ShiftEntry` WHERE `SID`=". $_GET["SID"]; + $chSQL = "DELETE FROM `Shifts` WHERE `SID`='". $_GET["SID"]. "' LIMIT 1"; + $ch2SQL = "DELETE FROM `ShiftEntry` WHERE `SID`='". $_GET["SID"]. "'"; SetHeaderGo2Back(); break; diff --git a/www-ssl/admin/schichtplan_druck.php b/www-ssl/admin/schichtplan_druck.php index 55dc2041..bef2dc06 100755 --- a/www-ssl/admin/schichtplan_druck.php +++ b/www-ssl/admin/schichtplan_druck.php @@ -50,7 +50,7 @@ for ($i = 0 ; $i < mysql_fetch_row($Erg) ; $i++)