summaryrefslogtreecommitdiff
path: root/www-ssl/makeuser.php.en
blob: 8c13c5493cdd3aca5884e47c269b2363416f9870 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?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)
		{
			$keys = "";
			$values = "";
			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>";
			echo "<h6>(error: ".mysql_error($con).")</h6>";
		} 
		else 
		{
                        echo "<p class=\"important\">transmitted. ";

			$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 "<h1>error: can't save userright... <br><h6>(".mysql_error($con).")</h6></h1>";
			}
			else
			{
				echo "userright was saved...<br>";
				echo "<h1>Your acount was sucsessfull creat, hafe al lot of fun.</h1>";
			}
			echo "Thank you for your participation..</p><p></p>\n<br><br>";
		}
	}
	  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["Alter"] = "";
	$_POST["Telefon"] = "";
	$_POST["DECT"] = "";
	$_POST["Handy"] = "";
	$_POST["email"] = "";
	$_POST["Size"] = "";
	$_POST["Art"] = "";
	$_POST["kommentar"] = "";
}
?>

<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="Alter" value="<?php echo $_POST["Alter"]; ?>"/></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="kommentar"><?php echo $_POST["kommentar"]; ?></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");
?>