engelsystem/www-ssl/makeuser.php.en

139 lines
6.0 KiB
Plaintext
Raw Normal View History

<?PHP
$title = "Chaos-Angel Registration";
$header = "Chaos-Angel Registration";
include ("./inc/header.php");
include ("./inc/db.php");
include ("./inc/crypt.php");
if( $_POST)
{
$eNick = trim($_POST["Nick"]);
if( strlen($_POST["Nick"]) < 2 ) {
$error= "error: your nick '".$_POST["Nick"]."' is to short (min. 2 characters)";
} elseif( strlen($_POST["email"]) <= 6 && strstr($_POST["email"], "@") == FALSE && strstr($_POST["email"], ".") == FALSE ) {
$error= "error: e-mail address is not correct";
} elseif( $_POST["Passwort"] != $_POST["Passwort2"] ) {
$error= "error: your passswords are not identical";
} elseif( strlen($_POST["Passwort"]) < 6 ) {
$error= "error: your password is to short (min. 6 characters)";
} else {
$_POST["Passwort"] = PassCrypt($_POST["Passwort"]);
unset($_POST["Passwort2"]);
function mysqlinsert($table, $con, $array){
foreach($array as $key => $value){
$value = strtr($value, get_html_translation_table(HTML_ENTITIES));
$keys .= $key.", ";
$values .= "'".$value."', ";
}
$keys = substr($keys, 0, -2);
$values = substr($values, 0, -2);
$sql = "INSERT INTO $table (".$keys.") VALUES (".$values.")";
mysql_query($sql, $con);
}
mysqlinsert('User', $con, $_POST);
$Erg = mysql_affected_rows();
if ($Erg != 1) {
echo "error: can't save your data...<br><h6>(error: ".mysql_error($con).")</h6>";
} else {
echo "<p class=\"important\">transmitted. Thank you for your participation..</p><p></p>\n<br><br>";
$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 "error: can't save userright... <br><h6>(".mysql_error($con).")</h6>";
}
else
{
echo "userright was saved...<br>";
echo "<br><br> Your acount was sucsessfull creat, hafe al lot of fun.";
}
}
}
if( !isset($error) ){
echo "If you would like to be an chaos angel please insert following details into this form: <br>";
} else {
echo "<p class=\"warning\">\n$error\n</p>";
}
}
else
{
//init vars
$_POST["Nick"] = "";
$_POST["Name"] = "";
$_POST["Vorname"] = "";
$_POST["Alta"] = "";
$_POST["Telefon"] = "";
$_POST["DECT"] = "";
$_POST["Handy"] = "";
$_POST["email"] = "";
$_POST["Size"] = "";
$_POST["Art"] = "";
}
?>
<h1>Chaos-Angel registration</h1>
By completing this form you're registering as a Chaos-Angel. This script will create you an account in the congress angel task system.
<form action="https://<?php echo $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];?>" method="post">
<table>
<tr><td>nick*</td><td><input type="text" size="40" name="Nick" value="<?php echo $_POST["Nick"]; ?>"/></td></tr>
<tr><td>last name</td><td><input type="text" size="40" name="Name" value="<?php echo $_POST["Name"]; ?>"/></td></tr>
<tr><td>first name</td><td><input type="text" size="40" name="Vorname" value="<?php echo $_POST["Vorname"]; ?>"/></td></tr>
<tr><td>age</td><td><input type="text" size="40" name="Alta" value="<?php echo $_POST["Alta"]; ?>"/></td></tr>
<tr><td>phone</td><td><input type="text" size="40" name="Telefon" value="<?php echo $_POST["Telefon"]; ?>"/></td></tr>
<tr><td>DECT</td><td><input type="text" size="40" name="DECT" value="<?php echo $_POST["DECT"]; ?>"/></td><td><!--a href="https://21c3.ccc.de/wiki/index.php/POC"><img src="./pic/external.png" alt="external: " /> DECT</a--></td></tr>
<tr><td>mobile</td><td><input type="text" size="40" name="Handy" value="<?php echo $_POST["Handy"]; ?>"/></td></tr>
<tr><td>e-mail*</td><td><input type="text" size="40" name="email" value="<?php echo $_POST["email"]; ?>"/></td></tr>
<tr><td>shirt size*</td><td align="left">
<select name="Size">
<option value="S"<?php if ($_POST["Size"]=="S") {echo " selected";}; ?>>S</option>
<option value="M"<?php if ($_POST["Size"]=="M") {echo " selected";}; ?>>M</option>
<option value="L"<?php if ($_POST["Size"]=="L") {echo " selected";}; ?>>L</option>
<option value="XL"<?php if ($_POST["Size"]=="XL") {echo " selected";}; ?>>XL</option>
<option value="XXL"<?php if ($_POST["Size"]=="XXL") {echo " selected";}; ?>>XXL</option>
</select>
</td></tr>
<tr><td>type of angel</td><td align="left">
<select name="Art">
<option value="Konferenz"<?php if ($_POST["Art"]=="Konferenz") {echo " selected";}; ?>>Conference</option>
<option value="Dokumentation"<?php if ($_POST["Art"]=="Dokumentation") {echo " selected";}; ?>>Documentation</option>
<option value="Eingang"<?php if ($_POST["Art"]=="Eingang") {echo " selected";}; ?>>Entrance</option>
<option value="Schutzengel"<?php if ($_POST["Art"]=="Schutzengel") {echo " selected";}; ?>>Guardian Angel</option>
<option value="Netzengel"<?php if ($_POST["Art"]=="Netzengel") {echo " selected";}; ?>>Netangels</option>
<option value="Rettung"<?php if ($_POST["Art"]=="Rettung") {echo " selected";}; ?>>Rescue</option>
<option value="Verpflegung"<?php if ($_POST["Art"]=="Verpflegung") {echo " selected";}; ?>>Catering</option>
<option value="egal"<?php if ($_POST["Art"]=="egal") {echo " selected";}; ?>>any kind</option>
</select>
</td><td><!--a href="https://www.ccc.de/congress/2005/engel.en.html#d5e75"><img src="./pic/external.png" alt="external: " /> Congress 21C3</a--></td></tr>
<tr>
<td>
Did you help at former <br />
congresses and which tasks <br />
have you performed then? <br />
</td>
<td><textarea rows="5" cols="40" name="qualifikationen"></textarea>
</td>
</tr>
<tr><td>password*</td><td><input type="password" size="40" name="Passwort"/></td></tr>
<tr><td>password confirm*</td><td><input type="password" size="40" name="Passwort2"/></td></tr>
<tr><td>&nbsp;</td><td><input type="submit" value="register me..."/></td></tr>
</table>
</form>
* entry required!
<?php
include ("./inc/footer.php");
?>