Rev 12 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
12 | daniel-mar | 1 | <?php |
2 | |||
14 | daniel-mar | 3 | if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
12 | daniel-mar | 4 | |
5 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'rusername\').focus();"', $header); |
||
6 | |||
7 | if ($modulueberschrift == '') $modulueberschrift = $modul; |
||
8 | echo '<h1>'.my_htmlentities($modulueberschrift).'</h1>'; |
||
9 | |||
10 | $res = db_query("SELECT * FROM `".$mysql_zugangsdaten['praefix']."users` WHERE `creator_ip` = '".$_SERVER['REMOTE_ADDR']."' AND `created_database` >= DATE_SUB(NOW(), INTERVAL ".db_escape($konfiguration[$modul]['sperrdauer'])." MINUTE)"); |
||
11 | if (db_num($res)) |
||
12 | die($footer.'<font color="#FF0000">Sie können mit dieser IP-Adresse nur jede '.$konfiguration[$modul]['sperrdauer'].' Minuten ein neues Konto eröffnen!</font>'.$header); |
||
13 | |||
14 | if ($konfiguration[$modul]['enable_userreg']) |
||
15 | { |
||
16 | $ok = true; |
||
17 | if (isset($reg) && ($reg == '1')) |
||
18 | { |
||
19 | $ok = false; |
||
20 | if (($rusername == '') || ($rpersonenname == '') || ($rpasswort == '') || ($rpasswort2 == '')) |
||
21 | { |
||
22 | echo '<font color="#FF0000"><b>Fehler:</b> Sie müssen die erforderlichen Fehler ausfüllen, um sich zu registrieren.</font><br><br>'; |
||
23 | $ok = true; |
||
24 | } |
||
25 | else |
||
26 | { |
||
27 | if ($rpasswort != $rpasswort2) |
||
28 | { |
||
29 | echo '<font color="#FF0000"><b>Fehler:</b> Die zwei Passwörter stimmen nicht überein.</font><br><br>'; |
||
30 | $ok = true; |
||
31 | } |
||
32 | else |
||
33 | { |
||
34 | $res = db_query("SELECT `id` FROM `".$mysql_zugangsdaten['praefix']."users` WHERE `username` = '".db_escape($rusername)."'"); |
||
35 | if (db_num($res) > 0) |
||
36 | { |
||
37 | echo '<font color="#FF0000"><b>Fehler:</b> Der Benutzername "'.$rusername.'" ist bereits vergeben.</font><br><br>'; |
||
38 | $ok = true; |
||
39 | } |
||
40 | else |
||
41 | { |
||
42 | db_query("INSERT INTO `".$mysql_zugangsdaten['praefix']."users` (`username`, `personenname`, `passwort`, `email`, `created_database`, `creator_ip`) VALUES ('".db_escape($rusername)."', '".db_escape($rpersonenname)."', '".md5($rpasswort)."', '".db_escape($remail)."', NOW(), '".$_SERVER["REMOTE_ADDR"]."')"); // TODO: use sha3 hash, salted and peppered |
||
43 | echo '<b>Sie haben Ihr Konto auf diesem Personal WebBase-Server erfolgreich registriert.</b><br><br>Das Konto ist sofort verwendbar. Wir wünschen Ihnen viel Freude mit Personal WebBase!'; |
||
44 | } |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 | if ($ok) |
||
49 | { |
||
50 | |||
51 | if (!isset($rusername)) $rusername = ''; |
||
52 | if (!isset($rpersonenname)) $rpersonenname = ''; |
||
53 | if (!isset($rpasswort)) $rpasswort = ''; |
||
54 | if (!isset($rpasswort2)) $rpasswort2 = ''; |
||
55 | if (!isset($remail)) $remail = ''; |
||
56 | |||
57 | echo '<b>Hier können Sie sich ein Konto auf diesem Personal WebBase-Server errichten.</b><br><br> |
||
58 | |||
59 | Die Angabe einer E-Mail-Adresse ist optional.<br><br> |
||
60 | |||
61 | <form action="'.$_SERVER['PHP_SELF'].'" method="POST" name="frm"> |
||
62 | <input type="hidden" name="seite" value="'.$seite.'"> |
||
63 | <input type="hidden" name="modul" value="'.$modul.'"> |
||
64 | <input type="hidden" name="reg" value="1"> |
||
65 | |||
66 | <table cellspacing="0" cellpadding="2" border="0"> |
||
67 | <tr> |
||
68 | <td>Benutzername:</td> |
||
69 | <td><img src="design/spacer.gif" alt="" width="5" height="1"></td> |
||
70 | <td><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="rusername" id="rusername" value="'.$rusername.'"></td> |
||
71 | </tr> |
||
72 | <tr> |
||
73 | <td>Personenname:</td> |
||
74 | <td><img src="design/spacer.gif" alt="" width="5" height="1"></td> |
||
75 | <td><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="rpersonenname" value="'.$rpersonenname.'"></td> |
||
76 | </tr> |
||
77 | <tr> |
||
78 | <td>Passwort:</td> |
||
79 | <td><img src="design/spacer.gif" alt="" width="5" height="1"></td> |
||
80 | <td><input type="password" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="rpasswort" value="'.$rpasswort.'"></td> |
||
81 | </tr> |
||
82 | <tr> |
||
83 | <td>Wiederholung:</td> |
||
84 | <td><img src="design/spacer.gif" alt="" width="5" height="1"></td> |
||
85 | <td><input type="password" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="rpasswort2" value="'.$rpasswort2.'"></td> |
||
86 | </tr> |
||
87 | <tr> |
||
88 | <td>E-Mail-Adresse:</td> |
||
89 | <td><img src="design/spacer.gif" alt="" width="5" height="1"></td> |
||
90 | <td><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="remail" value="'.$remail.'"></td> |
||
91 | </tr> |
||
92 | </table><br> |
||
93 | |||
94 | <input type="submit" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';" value="Registrieren"> |
||
95 | |||
96 | </form>'; |
||
97 | } |
||
98 | } |
||
99 | else |
||
100 | { |
||
101 | echo '<font color="#FF0000">Das Registrieren bei Personal WebBase wurde von dem Administrator nicht aktiviert.</font>'; |
||
102 | } |
||
103 | |||
104 | echo $footer; |
||
105 | |||
106 | ?> |