2005-09-10 19:25:43 +02:00
|
|
|
<?PHP
|
|
|
|
|
|
|
|
$title = "User-Liste";
|
|
|
|
$header = "Index";
|
|
|
|
include ("./inc/header.php");
|
|
|
|
include ("./inc/funktion_db_list.php");
|
|
|
|
include ("./inc/crypt.php");
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
if (IsSet($_GET["action"]))
|
2005-09-10 19:25:43 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
SetHeaderGo2Back();
|
2005-11-06 17:33:22 +01:00
|
|
|
echo "Gesendeter Befehl: ". $_GET["action"]. "<br>";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
switch ($_GET["action"])
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
case "change":
|
2005-11-06 17:33:22 +01:00
|
|
|
if (IsSet($_POST["enterUID"]))
|
2005-09-10 19:25:43 +02:00
|
|
|
{
|
2005-11-06 17:33:22 +01:00
|
|
|
if ($_POST["Type"] == "Normal")
|
2005-09-10 19:25:43 +02:00
|
|
|
{
|
|
|
|
$SQL = "UPDATE `User` SET ";
|
2005-11-06 17:33:22 +01:00
|
|
|
$SQL.= " `Nick` = '". $_POST["eNick"]. "', `Name` = '". $_POST["eName"]. "', ".
|
|
|
|
"`Vorname` = '". $_POST["eVorname"]. "', ".
|
|
|
|
"`Telefon` = '". $_POST["eTelefon"]. "', ".
|
|
|
|
"`Handy` = '". $_POST["eHandy"]. "', ".
|
|
|
|
"`DECT` = '". $_POST["eDECT"]. "', ".
|
|
|
|
"`email` = '". $_POST["eemail"]. "', ".
|
|
|
|
"`Size` = '". $_POST["eSize"]. "', ".
|
|
|
|
"`Gekommen`= '". $_POST["eGekommen"]. "', ".
|
|
|
|
"`Aktiv`= '". $_POST["eAktiv"]. "', ".
|
2005-11-21 19:34:30 +01:00
|
|
|
"`Tshirt` = '". $_POST["eTshirt"]. "', ".
|
2005-11-22 21:19:48 +01:00
|
|
|
"`Hometown` = '". $_POST["Hometown"]. "', ".
|
2005-11-21 19:34:30 +01:00
|
|
|
"`Menu` = '". $_POST["eMenu"]. "' ".
|
2005-11-06 17:33:22 +01:00
|
|
|
"WHERE `UID` = '". $_POST["enterUID"].
|
|
|
|
"' LIMIT 1;";
|
2005-09-10 19:25:43 +02:00
|
|
|
echo "User-";
|
2006-04-16 22:11:08 +02:00
|
|
|
$Erg = db_query($SQL, "change user details");
|
|
|
|
if ($Erg == 1) {
|
|
|
|
echo "Änderung wurde gesichert...\n";
|
|
|
|
} else {
|
|
|
|
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
2005-11-06 17:33:22 +01:00
|
|
|
if ($_POST["Type"] == "Secure")
|
2005-09-10 19:25:43 +02:00
|
|
|
{
|
|
|
|
$SQL2 = "UPDATE `UserCVS` SET ";
|
2005-11-06 17:33:22 +01:00
|
|
|
$SQL_CVS = "SELECT * FROM `UserCVS` WHERE UID=". $_POST["enterUID"];
|
2005-09-10 19:25:43 +02:00
|
|
|
$Erg_CVS = mysql_query($SQL_CVS, $con);
|
|
|
|
$CVS_Data = mysql_fetch_array($Erg_CVS);
|
|
|
|
$CVS_Data_i = 1;
|
|
|
|
foreach ($CVS_Data as $CVS_Data_Name => $CVS_Data_Value)
|
|
|
|
{
|
|
|
|
if( ($CVS_Data_i+1)%2 && $CVS_Data_Name!="UID")
|
2005-11-06 17:33:22 +01:00
|
|
|
$SQL2.= "`$CVS_Data_Name` = '". $_POST[$CVS_Data_i]."', ";
|
2005-09-10 19:25:43 +02:00
|
|
|
$CVS_Data_i++;
|
|
|
|
}
|
|
|
|
$SQL2 = substr( $SQL2, 0, strlen($SQL2)-2 );
|
2005-11-06 17:33:22 +01:00
|
|
|
$SQL2.= " WHERE `UID` = '". $_POST["enterUID"]. "' LIMIT 1;";
|
2005-09-10 19:25:43 +02:00
|
|
|
echo "<br>Secure-";
|
2006-04-16 22:11:08 +02:00
|
|
|
$Erg = db_query($SQL2, "change user CVS");
|
|
|
|
if ($Erg == 1) {
|
|
|
|
echo "Änderung wurde gesichert...\n";
|
|
|
|
} else {
|
|
|
|
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "delete":
|
2005-11-06 17:33:22 +01:00
|
|
|
if (IsSet($_POST["enterUID"]))
|
2005-09-10 19:25:43 +02:00
|
|
|
{
|
2005-11-06 17:33:22 +01:00
|
|
|
echo "delate User...";
|
2006-04-16 22:11:08 +02:00
|
|
|
$SQL="DELETE FROM `User` WHERE `UID` = '". $_POST["enterUID"]. "' LIMIT 1;";
|
|
|
|
$Erg = db_query($SQL, "User delete");
|
|
|
|
if ($Erg == 1) {
|
|
|
|
echo "Änderung wurde gesichert...\n";
|
|
|
|
} else {
|
|
|
|
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
|
|
|
|
}
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
echo "<br>\ndelate UserCVS...";
|
2006-04-16 22:11:08 +02:00
|
|
|
$SQL2="DELETE FROM `UserCVS` WHERE `UID` = '". $_POST["enterUID"]. "' LIMIT 1;";
|
|
|
|
$Erg = db_query($SQL2, "User CVS delete");
|
|
|
|
if ($Erg == 1) {
|
|
|
|
echo "Änderung wurde gesichert...\n";
|
|
|
|
} else {
|
|
|
|
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
|
|
|
|
}
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
echo "<br>\ndelate UserEntry...";
|
2005-09-10 19:25:43 +02:00
|
|
|
$SQL3="UPDATE `ShiftEntry` SET `UID` = '0', `Comment` = NULL ".
|
2005-11-06 17:33:22 +01:00
|
|
|
"WHERE `UID` = '". $_POST["enterUID"]. "' LIMIT 1;";
|
2006-04-16 22:11:08 +02:00
|
|
|
$Erg = db_query($SQL3, "delate UserEntry");
|
|
|
|
if ($Erg == 1) {
|
|
|
|
echo "Änderung wurde gesichert...\n";
|
|
|
|
} else {
|
|
|
|
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "newpw":
|
|
|
|
echo "Bitte neues Kennwort für <b>";
|
|
|
|
// Get Nick
|
2005-11-09 21:39:57 +01:00
|
|
|
$USQL = "SELECT * FROM User where UID=". $_GET["eUID"];
|
2005-09-10 19:25:43 +02:00
|
|
|
$Erg = mysql_query($USQL, $con);
|
|
|
|
echo mysql_result($Erg, 0, "Nick");
|
|
|
|
echo "</b> eingeben:<br>";
|
2005-11-09 21:39:57 +01:00
|
|
|
echo "<form action=\"./user2.php?action=newpwsave\" method=\"POST\">\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
echo "<input type=\"Password\" name=\"ePasswort\">";
|
|
|
|
echo "<input type=\"Password\" name=\"ePasswort2\">";
|
2005-11-09 21:39:57 +01:00
|
|
|
echo "<input type=\"hidden\" name=\"eUID\" value=\"". $_GET["eUID"]. "\">";
|
2005-09-10 19:25:43 +02:00
|
|
|
echo "<input type=\"submit\" value=\"sichern...\">\n";
|
|
|
|
echo "</form>";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "newpwsave":
|
2005-11-06 17:33:22 +01:00
|
|
|
if ($_POST["ePasswort"] == $_POST["ePasswort2"])
|
2005-09-10 19:25:43 +02:00
|
|
|
{ // beide Passwoerter passen...
|
2005-11-06 17:33:22 +01:00
|
|
|
$_POST["ePasswort"] = PassCrypt($_POST["ePasswort"]);
|
|
|
|
$SQL = "UPDATE `User` SET `Passwort`='". $_POST["ePasswort"]. "' ".
|
|
|
|
"where `UID` = '". $_POST["eUID"]. "'";
|
2006-04-16 22:11:08 +02:00
|
|
|
$Erg = db_query($SQL, "User new passwort");
|
|
|
|
if ($Erg == 1) {
|
|
|
|
echo "Änderung wurde gesichert...\n";
|
|
|
|
} else {
|
|
|
|
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
echo "Das Passwort wurde nicht übereinstimmend eingegeben!";
|
|
|
|
break;
|
|
|
|
} // end switch
|
|
|
|
|
|
|
|
// ende - Action ist gesetzt
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// kein Action gesetzt -> abbruch
|
2005-11-06 17:33:22 +01:00
|
|
|
echo "Unzulässiger Aufruf.<br>Bitte neu editieren...";
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
include ("./inc/footer.php");
|
|
|
|
?>
|
|
|
|
|