first commit
This commit is contained in:
347
admin/pass_back.php
Executable file
347
admin/pass_back.php
Executable file
@ -0,0 +1,347 @@
|
||||
<?php
|
||||
$user_admin=$_COOKIE["user_admin"];
|
||||
$jahrgang=$_COOKIE["jahrgang"];
|
||||
|
||||
if ($jahrgang == ""){ require("jahrgang.php"); exit;} //Wenn man kein Jahrgang ausgewählt hat wird die Jahrgangsauswahlseite geladen
|
||||
include("kurs/datenbankanbindung.php"); // fügt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
|
||||
|
||||
// Rechteüberprüfung
|
||||
$db = dbconnect();
|
||||
if ($user_admin == ""){ require("index.php"); exit;} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
|
||||
$result = $db->query("SELECT 1 FROM sozkom_admin_rechte, sozkom_admin_rechte_zuord , sozkom_admin where sozkom_admin_rechte.sozkom_admin_rolle = sozkom_admin_rechte_zuord.sozkom_admin_rolle AND sozkom_admin_rechte_zuord.faid = sozkom_admin.faid AND sozkom_admin.user = '$user_admin' AND sozkom_admin_rechte_zuord.sozkom_admin_rolle = 'a_passb'");
|
||||
$row = $result->fetch_array();
|
||||
if ($row[0] != 1){ include("kurs/rechte.php"); exit;}
|
||||
// Rechteüberprüfung ende
|
||||
|
||||
if (isset($_GET['action']))
|
||||
$action = $_GET['action'];
|
||||
else
|
||||
$action = "";
|
||||
|
||||
switch($action){
|
||||
default:
|
||||
|
||||
echo "
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
|
||||
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
|
||||
<title>Kennwort zurücksetzen</title>
|
||||
</head>
|
||||
<body>
|
||||
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
|
||||
<tr>
|
||||
<td>
|
||||
<div align=\"center\">
|
||||
<table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
|
||||
<tr>
|
||||
<td width=\"10\" background=\"../images/box_e1.gif\">
|
||||
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
|
||||
<td width=\"95%\" background=\"../images/box_top.gif\">
|
||||
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
|
||||
<font class=\"hd\">Kennwort zurücksetzen</font><br>
|
||||
<img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
|
||||
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"1%\" background=\"../images/box_l.gif\">
|
||||
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td colspan=\"2\"><br>
|
||||
|
||||
|
||||
<form action="; echo $_SERVER['PHP_SELF'] . "?action=ruecksetzen"; echo" method=\"POST\" name=\"passback\">
|
||||
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse; border-width: 0\" bordercolor=\"#111111\" width=\"100%\" id=\"AutoNumber1\" height=\"115\">
|
||||
<tr>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
</td>
|
||||
<td width=\"25%\" height=\"17\"> </td>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
<p> </p>
|
||||
</td>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
<p></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
<p></p>
|
||||
</td>
|
||||
<td width=\"50%\" height=\"17\"> </td>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
<p></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
<p></p>
|
||||
</td>
|
||||
<td width=\"50%\" height=\"17\">
|
||||
<p align=\"center\">
|
||||
";
|
||||
|
||||
|
||||
$db = dbconnect();
|
||||
$query = "SELECT uid, nachname, vorname, AG, Jahrgang FROM stud where Jahrgang=\"$jahrgang\" AND durchgefallen !='Y' ORDER BY nachname";
|
||||
$result = $db->query ($query)
|
||||
or die ("Cannot execute query");
|
||||
echo "<select size=\"5\" name=\"back\">";
|
||||
while ($row = $result->fetch_array()){
|
||||
echo "<option value=\"".$row[uid]."\">".$row['nachname'].", ".$row['vorname']." (".$row['AG']."/".$row['Jahrgang'].") </option>\n";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "
|
||||
|
||||
|
||||
</td>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
<p></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
<p></p>
|
||||
</td>
|
||||
<td width=\"50%\" align=\"left\" height=\"17\">
|
||||
</td>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
<p></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
</td>
|
||||
<td width=\"50%\" align=\"center\" height=\"17\">
|
||||
<input type=\"submit\" value=\"Abschicken\" name=\"B1\"></td>
|
||||
<td width=\"25%\" height=\"17\">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"25%\" height=\"18\">
|
||||
</td>
|
||||
<td width=\"50%\" height=\"18\"> </td>
|
||||
<td width=\"25%\" height=\"18\">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
<td width=\"1%\" background=\"../images/box_r.gif\">
|
||||
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>";
|
||||
break;
|
||||
case "ruecksetzen":
|
||||
|
||||
|
||||
// Nachricht über Passwortrücksetzung: Hinzugefügt 19.09.2006
|
||||
$result2 = $db->query("SELECT uid, vorname, nachname, mail, geburtstag FROM stud where uid=\"". $_POST['back']."\"");
|
||||
$row2 = $result2->fetch_array();
|
||||
|
||||
|
||||
$geb_tag = trim(strtoupper(substr($row2[geburtstag], 8,2)));
|
||||
$geb_mon = trim(strtoupper(substr($row2[geburtstag], 5,2)));
|
||||
$geb_jahr = trim(strtoupper(substr($row2[geburtstag], 2,2)));
|
||||
$pwd = "$geb_tag$geb_mon$geb_jahr";
|
||||
|
||||
$db = dbconnect();
|
||||
|
||||
$passwd = md5($pwd);
|
||||
//$passwd= mysqli_escape_string($db,$passwd);
|
||||
$sql = $db->query ("UPDATE stud SET Pwd=\"$passwd\" WHERE uid=\"". $_POST['back']."\"");
|
||||
|
||||
if($sql){
|
||||
|
||||
|
||||
|
||||
$empfaenger = "$row2[mail]";
|
||||
$betreff = "Kurssystem: Passwort zurückgesetzt";
|
||||
$text = "
|
||||
<html>
|
||||
<head>
|
||||
<title>Passwort zurückgesetzt</title>
|
||||
</head>
|
||||
<body>
|
||||
<font face='Arial' size='2'>
|
||||
Guten Tag $row2[vorname] $row2[nachname]!<br><br>
|
||||
Ihr Passwort wurde von einem Administrator zurückgesetzt.<br>
|
||||
Nachfolgend finden Sie Ihre Zugangsdaten:
|
||||
<br>
|
||||
<br>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign='top'>
|
||||
<font face='Arial' size='2'>
|
||||
Benutzerkennung:
|
||||
</font>
|
||||
</td>
|
||||
<td valign='top'>
|
||||
<font face='Arial' size='2'>
|
||||
<b>$row2[uid]</b>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign='top'>
|
||||
<font face='Arial' size='2'>
|
||||
Passwort:
|
||||
</font>
|
||||
</td>
|
||||
<td valign='top'>
|
||||
<font face='Arial' size='2'>
|
||||
<b>$row2[uid]</b>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
Bitte beachten Sie, dass zwischen Groß- und<br>
|
||||
Kleinschreibung unterschieden wird.
|
||||
<p>
|
||||
Ändern Sie bitte zu Ihrer eigenen Sicherheit das<br>
|
||||
Passwort nach dem ersten Login.
|
||||
<p>
|
||||
Link zum Anmeldesystem: <a href=\"http://www.fh-ludwigsburg.de/kurs\">Kurssystem</a>
|
||||
<p>
|
||||
Diese Mail wurde automatisch generiert!<br>
|
||||
Antworten Sie daher nicht auf diese Mail<br>
|
||||
<br>
|
||||
Vielen Dank
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
|
||||
$headers = "MIME-Version: 1.0\r\n";
|
||||
$headers .= "Content-type: text/html; charset=utf-8\r\n";
|
||||
|
||||
$return = @mail($empfaenger, $betreff, $text, $headers);
|
||||
|
||||
// ENDE Nachricht über Passwortrücksetzung
|
||||
if($return){
|
||||
$status = "";
|
||||
}else{
|
||||
$status = "nicht";
|
||||
}
|
||||
echo "
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
|
||||
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
|
||||
<title>Kennwort zurückgesetzt</title>
|
||||
</head>
|
||||
<body>
|
||||
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
|
||||
<tr>
|
||||
<td>
|
||||
<div align=\"center\">
|
||||
<table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
|
||||
<tr>
|
||||
<td width=\"10\" background=\"../images/box_e1.gif\">
|
||||
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
|
||||
<td width=\"95%\" background=\"../images/box_top.gif\">
|
||||
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
|
||||
<font class=\"hd\">Kennwort zurückgesetzt</font><br>
|
||||
<img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
|
||||
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"1%\" background=\"../images/box_l.gif\">
|
||||
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td colspan=\"2\"><br><p align=\"center\">Das Kennwort wurde zurückgesetzt auf<br>
|
||||
<b><br>\"$pwd\"</b><br><br>
|
||||
Der Studierende wurde <b>$status</b> per Mail informiert.
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p align=\"center\"><a href=\"hauptframe_jahr.php\">
|
||||
<img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
|
||||
</td>
|
||||
<td width=\"1%\" background=\"../images/box_r.gif\">
|
||||
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>";
|
||||
}else{
|
||||
echo "
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
|
||||
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
|
||||
<title>Kennwort nicht zurückgesetzt</title>
|
||||
</head>
|
||||
<body>
|
||||
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
|
||||
<tr>
|
||||
<td>
|
||||
<div align=\"center\">
|
||||
<table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
|
||||
<tr>
|
||||
<td width=\"10\" background=\"../images/box_e1.gif\">
|
||||
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
|
||||
<td width=\"95%\" background=\"../images/box_top.gif\">
|
||||
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
|
||||
<font class=\"hd\">Kennwort zurückgesetzt</font><br>
|
||||
<img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
|
||||
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"1%\" background=\"../images/box_l.gif\">
|
||||
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td colspan=\"2\"><br><p align=\"center\">Das Kennwort wurde nicht zurückgesetzt!<br>Es ist ein Fehler aufgetreten
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p align=\"center\"><a href=\"hauptframe_jahr.php\">
|
||||
<img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
|
||||
</td>
|
||||
<td width=\"1%\" background=\"../images/box_r.gif\">
|
||||
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
|
||||
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
|
||||
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>";
|
||||
} // End if
|
||||
} // Ende Action script
|
||||
?>
|
Reference in New Issue
Block a user