<?php
$username = $_POST["username"];
$password = $_POST["passwort"];
$password2 = $_POST["passwort2"];
$email = $_POST["email"];
$emaildatei = fopen("../adm/data/email.txt", "a");
fwrite($emaildatei, $email);
fclose($emaildatei);
if ($password == $password2)
{
$user_vorhanden = array();
$passwort = md5($password);
$userdatei = fopen ("../adm/data/user_adm.txt","a");
while (!feof($userdatei))
{
$zeile = fgets($userdatei,500);
$userdata = explode("|", $zeile);
array_push ($user_vorhanden,$userdata[0]);
}
fclose($userdatei);
if (in_array($username,$user_vorhanden))
{
echo "
<html>
<title>HempelCMS - Installation</title>
<head>
<link rel=\"shortcut icon\" href=\"h_images/favicon.ico\" type=\"image/x-icon\">
</head>
<style>
body { background: url();
margin: 0;
background-color: #CCCCCC;
font-family: Arial;
font-size: 11px;
color: black;
}
img { border: none
}
a:link { text-decoration:none; color: grey; }
a:visited { text-decoration:none; color: grey; }
a:hover { text-decoration:none;color: black; }
a:active { text-decoration:none;}
a:focus { text-decoration:none; }
#logo{
background: url(h_images/logo.png);
width: 250px;
height: 70px;
position: absolute;
top: 70px;
left: 50px;
}
#header{
background: url(h_images/header.png);
width: auto;
height: 150px;
margin-top: 10px;
opacity: 0.5;
}
#img{
background: url(h_images/img.png);
position: absolute;
bottom: 0px;
right: 30px;
height: 345px;
width: 621px;
}
#m_top{
background: url(h_images/m_top.png);
position: absolute;
top: 170px;
right: 500px;
width: 578px;
height: 51px;
opacity: 0.8;
}
#m_middle{
background: url(h_images/m_middle.png);
margin-top: 61px;
padding-left: 15px;
padding-right: 10px;
position: absolute;
right: 500px;
width: 553px;
height: 300px;;
opacity: 0.8;
}
#m_bottom{
background: url(h_images/m_bottom.png);
text-align: right;
padding-top: 6px;
padding-right: 8px;
margin-top: 361px;
position: absolute;
right: 500px;
width: 570px;
height: 14px;
opacity: 0.8;
}
</style>
<body>
<div id=\"logo\"></div>
<div id=\"header\"></div>
<div id=\"img\"></div>
<div id=\"m_top\"></div>
<div id=\"m_middle\">
<b>» Installation </b>
<br><br>
<u> Achtung: </u></u><br><br>
<i> Diese Daten solltest du dir gut merken, da dies später deine Login-Daten zum Admin-Panel werden.</i><br>
<i> Deine Emailadresse sollte existieren, so können wir dich bei eventuell auftauchenden Problemen informieren.</i>
<br><br>
<center><font color=\"red\">Fehler - Username bereits vergeben!</font></center>
<br>
<form action=\"register_adm_post.php\" method=\"post\">
<div style=\" float: left; margin-left: 40px;\"> Username </div>
<div style=\" float: left; margin-left: 100px;\"> Passwort </div> <br>
<input style=\"margin-top: 5px; font-size: 11px;\" type=\"text\" size=\"20\" maxlength=\"50\" name=\"username\" value=\"Username\">
<input style=\"margin-top: 5px; font-size: 11px;\" type=\"password\" size=\"35\" maxlength=\"50\" name=\"passwort\" value=\"XXXXX\">
<br><br>
<div style=\" float: left; margin-left: 60px;\"> Email-Adresse </div>
<div style=\" float: left; margin-left: 110px;\"> Passwort-Wiederholung </div> <br>
<input style=\"margin-top: 5px; font-size: 11px;\" type=\"text\" size=\"30\" maxlength=\"50\" name=\"email\" value=\"Email-Adresse\">
<input style=\"margin-top: 5px; font-size: 11px;\" type=\"password\" size=\"35\" maxlength=\"50\" name=\"passwort2\" value=\"XXXXX\">
<br><br><br><br>
<input style=\"margin-left: 100px; width: 200px; margin-top: 5px; font-size: 11px;\" \"type=\"submit\" value=\"Installation\">
</form>
</div>
<div id=\"m_bottom\"> <a href=\"http://www.hempel.de.vu%5c"><small>© Copyright 2012 by Hempel // Index of :: Hempel</small></a> </div>
</body>
</html>
";
}
else
{
$userdatei = fopen ("../adm/data/user_adm.txt","w");
fwrite($userdatei, $username);
fwrite($userdatei, "|");
fwrite($userdatei, $passwort);
fwrite($userdatei, "\n");
fclose($userdatei);
echo "
<html>
<title>HempelCMS - Installation</title>
<head>
<link rel=\"shortcut icon\" href=\"h_images/favicon.ico\" type=\"image/x-icon\">
<meta http-equiv=\"refresh\" content=\"20; URL=../admin.php\">
</head>
<style>
body { background: url();
margin: 0;
background-color: #CCCCCC;
font-family: Arial;
font-size: 11px;
color: black;
}
img { border: none
}
a:link { text-decoration:none; color: grey; }
a:visited { text-decoration:none; color: grey; }
a:hover { text-decoration:none;color: black; }
a:active { text-decoration:none;}
a:focus { text-decoration:none; }
#logo{
background: url(h_images/logo.png);
width: 250px;
height: 70px;
position: absolute;
top: 70px;
left: 50px;
}
#header{
background: url(h_images/header.png);
width: auto;
height: 150px;
margin-top: 10px;
opacity: 0.5;
}
#img{
background: url(h_images/img.png);
position: absolute;
bottom: 0px;
right: 30px;
height: 345px;
width: 621px;
}
#m_top{
background: url(h_images/m_top.png);
position: absolute;
top: 170px;
right: 500px;
width: 578px;
height: 51px;
opacity: 0.8;
}
#m_middle{
background: url(h_images/m_middle.png);
margin-top: 61px;
padding-left: 15px;
padding-right: 10px;
position: absolute;
right: 500px;
width: 553px;
height: 300px;;
opacity: 0.8;
}
#m_bottom{
background: url(h_images/m_bottom.png);
text-align: right;
padding-top: 6px;
padding-right: 8px;
margin-top: 361px;
position: absolute;
right: 500px;
width: 570px;
height: 14px;
opacity: 0.8;
}
</style>
<body>
<div id=\"logo\"></div>
<div id=\"header\"></div>
<div id=\"img\"></div>
<div id=\"m_top\"></div>
<div id=\"m_middle\">
<b>» Installation erfolgreich! </b>
<br><br>
<i> Lieber $username, </i><br><br>
<i> Die Installation ist erfolgreich abgeschlossen, der Admin wurde angelegt. </i><br>
<i> Du wirst nun zum Login weitergeleitet, falls die Weiterleitung bei dir nicht funktioniert, klicke bitte <a href=\"../admin.php\">hier</a>. </i>
<br><br>
<i> Bitte lösche das Verzeichnis '/install' von deinem Webserver, Danke. </i><br>
<br><br><br><br><br><br><br><br><br><br><br>
<i> Einloggen kannst du dich ab sofort unter 'http://www.deineseite.de/admin.php' </i><br>
</div>
<div id=\"m_bottom\"> <a href=\"http://www.hempel.de.vu%5c"><small>© Copyright 2012 by Hempel // Index of :: Hempel</small></a> </div>
</body>
</html>
";
}
}
else
{
echo "
<html>
<title>HempelCMS - Installation</title>
<head>
<link rel=\"shortcut icon\" href=\"h_images/favicon.ico\" type=\"image/x-icon\">
</head>
<style>
body { background: url();
margin: 0;
background-color: #CCCCCC;
font-family: Arial;
font-size: 11px;
color: black;
}
img { border: none
}
a:link { text-decoration:none; color: grey; }
a:visited { text-decoration:none; color: grey; }
a:hover { text-decoration:none;color: black; }
a:active { text-decoration:none;}
a:focus { text-decoration:none; }
#logo{
background: url(h_images/logo.png);
width: 250px;
height: 70px;
position: absolute;
top: 70px;
left: 50px;
}
#header{
background: url(h_images/header.png);
width: auto;
height: 150px;
margin-top: 10px;
opacity: 0.5;
}
#img{
background: url(h_images/img.png);
position: absolute;
bottom: 0px;
right: 30px;
height: 345px;
width: 621px;
}
#m_top{
background: url(h_images/m_top.png);
position: absolute;
top: 170px;
right: 500px;
width: 578px;
height: 51px;
opacity: 0.8;
}
#m_middle{
background: url(h_images/m_middle.png);
margin-top: 61px;
padding-left: 15px;
padding-right: 10px;
position: absolute;
right: 500px;
width: 553px;
height: 300px;;
opacity: 0.8;
}
#m_bottom{
background: url(h_images/m_bottom.png);
text-align: right;
padding-top: 6px;
padding-right: 8px;
margin-top: 361px;
position: absolute;
right: 500px;
width: 570px;
height: 14px;
opacity: 0.8;
}
</style>
<body>
<div id=\"logo\"></div>
<div id=\"header\"></div>
<div id=\"img\"></div>
<div id=\"m_top\"></div>
<div id=\"m_middle\">
<b>» Installation </b>
<br><br>
<u> Achtung: </u></u><br><br>
<i> Diese Daten solltest du dir gut merken, da dies später deine Login-Daten zum Admin-Panel werden.</i><br>
<i> Deine Emailadresse sollte existieren, so können wir dich bei eventuell auftauchenden Problemen informieren.</i>
<br><br>
<center><font color=\"red\">Fehler - Die beiden Passwörter stimmen nicht überein!</font></center>
<br>
<form action=\"register_adm_post.php\" method=\"post\">
<div style=\" float: left; margin-left: 40px;\"> Username </div>
<div style=\" float: left; margin-left: 100px;\"> Passwort </div> <br>
<input style=\"margin-top: 5px; font-size: 11px;\" type=\"text\" size=\"20\" maxlength=\"50\" name=\"username\" value=\"Username\">
<input style=\"margin-top: 5px; font-size: 11px;\" type=\"password\" size=\"35\" maxlength=\"50\" name=\"passwort\" value=\"XXXXX\">
<br><br>
<div style=\" float: left; margin-left: 60px;\"> Email-Adresse </div>
<div style=\" float: left; margin-left: 110px;\"> Passwort-Wiederholung </div> <br>
<input style=\"margin-top: 5px; font-size: 11px;\" type=\"text\" size=\"30\" maxlength=\"50\" name=\"email\" value=\"Email-Adresse\">
<input style=\"margin-top: 5px; font-size: 11px;\" type=\"password\" size=\"35\" maxlength=\"50\" name=\"passwort2\" value=\"XXXXX\">
<br><br><br><br>
<input style=\"margin-left: 100px; width: 200px; margin-top: 5px; font-size: 11px;\" \"type=\"submit\" value=\"Installation\">
</form>
</div>
<div id=\"m_bottom\"> <a href=\"http://www.hempel.de.vu%5c"><small>© Copyright 2012 by Hempel // Index of :: Hempel</small></a> </div>
</body>
</html>
";
}
?>