2005-09-10 19:25:43 +02:00
|
|
|
|
<?PHP
|
|
|
|
|
|
|
|
|
|
$title = "User-Liste";
|
|
|
|
|
$header = "Index";
|
2008-09-10 20:30:16 +02:00
|
|
|
|
include ("../../includes/header.php");
|
|
|
|
|
include ("../../includes/funktion_db_list.php");
|
|
|
|
|
include ("../../includes/crypt.php");
|
|
|
|
|
include ("../../includes/funktion_db.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
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"]. "', ".
|
2006-08-29 12:21:50 +02:00
|
|
|
|
"`ICQ` = '". $_POST["eICQ"]. "', ".
|
|
|
|
|
"`jabber` = '". $_POST["ejabber"]. "', ".
|
2005-11-06 17:33:22 +01:00
|
|
|
|
"`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
|
|
|
|
}
|
2006-11-10 14:43:13 +01:00
|
|
|
|
else
|
2006-11-10 19:17:24 +01:00
|
|
|
|
echo "<h1>Fehler: Unbekanter Type (". $_POST["Type"]. ") <20>bergeben\n</h1>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
2006-11-10 14:43:13 +01:00
|
|
|
|
else
|
2006-11-10 19:17:24 +01:00
|
|
|
|
echo "<h1>Fehler: UserID (enterUID) wurde nicht per POST <20>bergeben</h1>\n";
|
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-12-04 20:54:51 +01:00
|
|
|
|
$SQL="DELETE FROM `User` WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;";
|
2006-04-16 22:11:08 +02:00
|
|
|
|
$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-12-04 20:54:51 +01:00
|
|
|
|
$SQL2="DELETE FROM `UserCVS` WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;";
|
2006-04-16 22:11:08 +02:00
|
|
|
|
$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...";
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL3="UPDATE `ShiftEntry` SET `UID`='0', `Comment`=NULL ".
|
|
|
|
|
"WHERE `UID`='". $_POST["enterUID"]. "';";
|
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
|
2006-12-04 20:54:51 +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"]. "' ".
|
2006-12-04 20:54:51 +01:00
|
|
|
|
"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
|
|
|
|
}
|
|
|
|
|
|
2008-09-10 20:30:16 +02:00
|
|
|
|
include ("../../includes/footer.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|
|
|
|
|
|