From a537f4bf73101c467af3b01db32fcdb9fd0a91ce Mon Sep 17 00:00:00 2001
From: Philip Häusler
Date: Wed, 1 Jun 2011 14:48:31 +0200
Subject: bootstrapping
---
www-ssl/makeuser.php | 391 ++++++++++++++++++++++++++++-----------------------
1 file changed, 212 insertions(+), 179 deletions(-)
(limited to 'www-ssl/makeuser.php')
diff --git a/www-ssl/makeuser.php b/www-ssl/makeuser.php
index 785de1e8..a67f4bd5 100644
--- a/www-ssl/makeuser.php
+++ b/www-ssl/makeuser.php
@@ -1,181 +1,214 @@
0)
- $error = Get_Text("makeuser_error_nick1") . $_POST["Nick"] . Get_Text("makeuser_error_nick3");
- elseif(strlen($_POST["email"]) <= 6 && strstr($_POST["email"], "@") == FALSE && strstr($_POST["email"], ".") == false)
- $error = Get_Text("makeuser_error_mail");
- elseif(!is_numeric($_POST["Alter"]))
- $error = Get_Text("makeuser_error_Alter");
- elseif($_POST["Passwort"] != $_POST["Passwort2"])
- $error = Get_Text("makeuser_error_password1");
- elseif(strlen($_POST["Passwort"]) < 6)
- $error = Get_Text("makeuser_error_password2");
- else {
- $_POST["Passwort"] = PassCrypt($_POST["Passwort"]);
- unset($_POST["Passwort2"]);
-
- $SQL = "INSERT INTO `User` (".
- "`Nick` , ". "`Name` , ".
- "`Vorname`, ". "`Alter` , ".
- "`Telefon`, ". "`DECT`, ".
- "`Handy`, ". "`email`, ".
- "`ICQ`, ". "`jabber`, ".
- "`Size`, ". "`Passwort`, ".
- "`Art` , ". "`kommentar`, ".
- "`Hometown`,". "`CreateDate` ) ".
- "VALUES ( ".
- "'". $_POST["Nick"]. "', ". "'". $_POST["Name"]. "', ".
- "'". $_POST["Vorname"]. "', ". "'". $_POST["Alter"]. "', ".
- "'". $_POST["Telefon"]. "', ". "'". $_POST["DECT"]. "', ".
- "'". $_POST["Handy"]. "', ". "'". $_POST["email"]. "', ".
- "'". $_POST["ICQ"]. "', ". "'". $_POST["jabber"]. "', ".
- "'". $_POST["Size"]. "', ". "'". $_POST["Passwort"]. "', ".
- "'". $_POST["Art"]. "', ". "'". $_POST["kommentar"]. "', ".
- "'". $_POST["Hometown"]. "',". "NOW());";
- $Erg = mysql_query($SQL, $con);
-
- if ($Erg != 1) {
- echo Get_Text("makeuser_error_write1") . "
\n";
- $error = mysql_error($con);
- } else {
- echo "" . Get_Text("makeuser_writeOK") . "\n";
-
- $SQL2 = "SELECT `UID` FROM `User` WHERE `Nick`='" . $_POST["Nick"] . "';";
- $Erg2 = mysql_query($SQL2, $con);
- $Data = mysql_fetch_array($Erg2);
-
- $SQL3 = "INSERT INTO `UserCVS` (`UID`) VALUES ('" . $Data["UID"] . "');";
- $Erg3 = mysql_query($SQL3, $con);
-
- if ($Erg3 != 1) {
- echo "
". Get_Text("makeuser_error_write2"). "
\n";
- $error = mysql_error($con);
- } else {
- echo Get_Text("makeuser_writeOK2") . "
\n";
- echo "" . Get_Text("makeuser_writeOK3") . "
\n";
- }
-
- echo Get_Text("makeuser_writeOK4") . "
\n
\n";
- $success = "any";
-
- if (isset($SubscribeMailinglist)) {
- if ($_POST["subscribe-mailinglist"] == "") {
- $headers = "From: " . $_POST["email"] . "\r\n" .
- "X-Mailer: PHP/" . phpversion();
- mail($SubscribeMailinglist, "subject", "message", $headers);
- }
- }
- }
- }
-
- if(isset($error))
- echo "\n" . $error . "\n
\n\n";
- } else {
- // init vars
- $_POST["Nick"] = "";
- $_POST["Name"] = "";
- $_POST["Vorname"] = "";
- $_POST["Alter"] = "";
- $_POST["Telefon"] = "";
- $_POST["DECT"] = "";
- $_POST["Handy"] = "";
- $_POST["email"] = "";
- $_POST["subscribe-mailinglist"] = "";
- $_POST["ICQ"] = "";
- $_POST["jabber"] = "";
- $_POST["Size"] = "L";
- $_POST["Art"] = "";
- $_POST["kommentar"] = "";
- $_POST["Hometown"] = "";
- }
-
- if($success == "none") {
- echo "" . Get_Text("makeuser_text0") . "
\n";
- echo "" . Get_Text("makeuser_text1") . "
\n";
- echo "\n";
- Print_Text("makeuser_text3");
- }
-
- include "../includes/footer.php";
+require_once ('bootstrap.php');
+
+$title = "Anmeldung zum Chaos-Engel";
+$header = "";
+$success = "none";
+
+include "config/config.php";
+include "includes/header.php";
+include "config/config_db.php";
+include "includes/crypt.php";
+
+if (isset ($_POST["send"])) {
+ $eNick = trim($_POST["Nick"]);
+
+ if ($_POST["Alter"] == "")
+ $_POST["Alter"] = 0;
+
+ // user vorhanden?
+ $SQLans = "SELECT UID FROM `User` WHERE `Nick`='" . $_POST["Nick"] . "'";
+ $Ergans = mysql_query($SQLans, $con);
+
+ if (strlen($_POST["Nick"]) < 2)
+ $error = Get_Text("makeuser_error_nick1") . $_POST["Nick"] . Get_Text("makeuser_error_nick2");
+ elseif (mysql_num_rows($Ergans) > 0) $error = Get_Text("makeuser_error_nick1") . $_POST["Nick"] . Get_Text("makeuser_error_nick3");
+ elseif (strlen($_POST["email"]) <= 6 && strstr($_POST["email"], "@") == FALSE && strstr($_POST["email"], ".") == false) $error = Get_Text("makeuser_error_mail");
+ elseif (!is_numeric($_POST["Alter"])) $error = Get_Text("makeuser_error_Alter");
+ elseif ($_POST["Passwort"] != $_POST["Passwort2"]) $error = Get_Text("makeuser_error_password1");
+ elseif (strlen($_POST["Passwort"]) < 6) $error = Get_Text("makeuser_error_password2");
+ else {
+ $_POST["Passwort"] = PassCrypt($_POST["Passwort"]);
+ unset ($_POST["Passwort2"]);
+
+ $SQL = "INSERT INTO `User` (" .
+ "`Nick` , " . "`Name` , " .
+ "`Vorname`, " . "`Alter` , " .
+ "`Telefon`, " . "`DECT`, " .
+ "`Handy`, " . "`email`, " .
+ "`ICQ`, " . "`jabber`, " .
+ "`Size`, " . "`Passwort`, " .
+ "`Art` , " . "`kommentar`, " .
+ "`Hometown`," . "`CreateDate` ) " .
+ "VALUES ( " .
+ "'" . $_POST["Nick"] . "', " . "'" . $_POST["Name"] . "', " .
+ "'" . $_POST["Vorname"] . "', " . "'" . $_POST["Alter"] . "', " .
+ "'" . $_POST["Telefon"] . "', " . "'" . $_POST["DECT"] . "', " .
+ "'" . $_POST["Handy"] . "', " . "'" . $_POST["email"] . "', " .
+ "'" . $_POST["ICQ"] . "', " . "'" . $_POST["jabber"] . "', " .
+ "'" . $_POST["Size"] . "', " . "'" . $_POST["Passwort"] . "', " .
+ "'" . $_POST["Art"] . "', " . "'" . $_POST["kommentar"] . "', " .
+ "'" . $_POST["Hometown"] . "'," . "NOW());";
+ $Erg = mysql_query($SQL, $con);
+
+ if ($Erg != 1) {
+ echo Get_Text("makeuser_error_write1") . "
\n";
+ $error = mysql_error($con);
+ } else {
+ echo "" . Get_Text("makeuser_writeOK") . "\n";
+
+ $SQL2 = "SELECT `UID` FROM `User` WHERE `Nick`='" . $_POST["Nick"] . "';";
+ $Erg2 = mysql_query($SQL2, $con);
+ $Data = mysql_fetch_array($Erg2);
+
+ $SQL3 = "INSERT INTO `UserCVS` (`UID`) VALUES ('" . $Data["UID"] . "');";
+ $Erg3 = mysql_query($SQL3, $con);
+
+ if ($Erg3 != 1) {
+ echo "
" . Get_Text("makeuser_error_write2") . "
\n";
+ $error = mysql_error($con);
+ } else {
+ echo Get_Text("makeuser_writeOK2") . "
\n";
+ echo "" . Get_Text("makeuser_writeOK3") . "
\n";
+ }
+
+ echo Get_Text("makeuser_writeOK4") . "
\n
\n";
+ $success = "any";
+
+ if (isset ($SubscribeMailinglist)) {
+ if ($_POST["subscribe-mailinglist"] == "") {
+ $headers = "From: " . $_POST["email"] . "\r\n" .
+ "X-Mailer: PHP/" . phpversion();
+ mail($SubscribeMailinglist, "subject", "message", $headers);
+ }
+ }
+ }
+ }
+
+ if (isset ($error))
+ echo "\n" . $error . "\n
\n\n";
+} else {
+ // init vars
+ $_POST["Nick"] = "";
+ $_POST["Name"] = "";
+ $_POST["Vorname"] = "";
+ $_POST["Alter"] = "";
+ $_POST["Telefon"] = "";
+ $_POST["DECT"] = "";
+ $_POST["Handy"] = "";
+ $_POST["email"] = "";
+ $_POST["subscribe-mailinglist"] = "";
+ $_POST["ICQ"] = "";
+ $_POST["jabber"] = "";
+ $_POST["Size"] = "L";
+ $_POST["Art"] = "";
+ $_POST["kommentar"] = "";
+ $_POST["Hometown"] = "";
+}
+
+if ($success == "none") {
+ echo "" . Get_Text("makeuser_text0") . "
\n";
+ echo "" . Get_Text("makeuser_text1") . "
\n";
+ echo "\n";
+ Print_Text("makeuser_text3");
+}
+
+include "includes/footer.php";
?>
--
cgit v1.2.3-54-g00ecf