Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once('emailfunctions.php');
- $succes="";
- if(!empty($_POST['aanmelden']))
- {
- session_start();
- if (md5($_POST['norobot']) == $_SESSION['randomnr2'])
- {
- $foutenmelding="";
- }
- else
- {
- $foutenmelding="You haven't retyped the image correctly!<br>";
- }
- }
- $title="Home4DSi - Register";
- $keywords="Home4DSi register";
- include("../members/db_leden.php");
- $disabledfile = '../members/registering_disabled.txt';
- if(file_exists($disabledfile))
- {
- $contents = file_get_contents($disabledfile);
- if($contents == 'yes')
- {
- exit('Registering is currently disabled. Please check back later.');
- }
- }
- include_once('../members/inloggen_automatisch.php');
- if(isset($inlogbericht))
- {
- die('You cannot register while you are logged in');
- }
- include_once('../members/inloggen.php');
- if(isset($inlogbericht))
- {
- die('You cannot register while you are logged in');
- }
- $mysql_id=mysql_connect($dbhost,$dbuser,$dbpass);
- mysql_select_db($db);
- if(!empty($_POST['aanmelden']) && empty($captcha))
- {
- $gebruikersnaam=htmlentities($_POST['gebruikersnaam']);
- $email=mysql_real_escape_string(strtolower($_POST['email']));
- $ip=$_SERVER['REMOTE_ADDR'];
- $allow_mailing = 0;
- if($_POST['allow_mailing'] == 1)
- {
- $allow_mailing = 1;
- }
- /*$ip = get_ip();
- if(!$ip)
- {
- $foutenmelding.="Sorry, but we do not accept accounts that use a proxy. Please turn off your proxy.";
- }*/
- $wachtwoord=htmlentities($_POST['wachtwoord']);
- $wachtwoordcontrole=htmlentities($_POST['wachtwoordcontrole']);
- if(empty($wachtwoord) or $wachtwoord != $wachtwoordcontrole)
- {
- $foutenmelding.="Please enter a password that is the same as in the retype password field<br>";
- }
- if (!eregi("[[:alnum:]]", $gebruikersnaam) or strlen($gebruikersnaam) < 3 or strlen($gebruikersnaam) > 15)
- {
- $foutenmelding.="Usernames may only contain letters and numbers and must be 3 - 15 characters long<br>";
- }
- if(!valid_email($email))
- {
- $foutenmelding.="The email address you entered is incorrect!<br>";
- }
- $wachtwoord= md5($wachtwoord);
- $wachtwoord= sha1($wachtwoord);
- $wachtwoord= $wachtwoord . 'sl';
- function wordsExist(&$gebruikersnaam, $words) {
- foreach($words as &$word) {
- if(stripos($gebruikersnaam, $word) !== false) {
- return true;
- }
- }
- return false;
- }
- if (wordsExist($gebruikersnaam, array('fuck','shit','dick','pussy','bitch','cunt','penis','vagina','cock','semen')))
- {
- $foutenmelding.="<font color=\"red\">Your name may not contain inappropriate language.</font><br>";
- }
- $sql="select gebruikersnaam,email from ledengegevens where gebruikersnaam='$gebruikersnaam' or email='$email'";
- $res=mysql_query("$sql",$mysql_id);
- $fout=mysql_errno($mysql_id);
- if ($fout != 0)
- {
- $fout=mysql_error($mysql_id);
- echo '<font color="#FF2306">' . $fout . '</font>';
- mysql_close($mysql_id);
- echo '</body></html>';
- exit;
- }
- $aantal_lijnen=mysql_num_rows($res);
- $query2 = mysql_query("select gebruikersnaam, email from pendingmembers where gebruikersnaam='$gebruikersnaam' or email='$email'");
- $aantal_lijnen_2 = mysql_num_rows($query2);
- $taken_username = false;
- $taken_email = false;
- for($i = 0; $i < $aantal_lijnen + $aantal_lijnen_2; $i++)
- {
- if($i >= $aantal_lijnen)
- {
- $row = mysql_fetch_assoc($query2);
- }
- else
- {
- $row = mysql_fetch_assoc($res);
- }
- $uname = $row['gebruikersnaam'];
- $mail = $row['email'];
- if(strtolower($uname) == strtolower($gebruikersnaam))
- {
- $taken_username = true;
- }
- if(strtolower($mail) == strtolower($email))
- {
- $taken_email = true;
- }
- }
- mysql_close($mysql_id);
- if($taken_username)
- {
- $foutenmelding.= "The username $gebruikersnaam has already been registered!<br>";
- }
- if($taken_email)
- {
- $foutenmelding .= "That email is already taken by someone!<br>";
- }
- $mysql_id=mysql_connect("$dbhost","$dbuser","$dbpass");
- mysql_select_db($db);
- $sql=" select ip from ledengegevens where ip='$ip'";
- $res=mysql_query("$sql",$mysql_id);
- $aantal_lijntjes=mysql_num_rows($res);
- mysql_close($mysql_id);
- if($aantal_lijntjes==1)
- {
- //$foutenmelding.="There already is somebody registered via this IP adress!<br>";
- }
- if(empty($foutenmelding))
- {
- $mysql_id=mysql_connect("$dbhost","$dbuser","$dbpass");
- mysql_select_db($db);
- $origin = 'Home4DSi';
- $registration_key = generate_registration_key($email);
- $sql=" INSERT into pendingmembers (gebruikersnaam,wachtwoord,ip,email,online,account_origin,registration_key,allow_mailing,last_verification_mail_time) VALUES ('$gebruikersnaam','$wachtwoord','$ip','$email','".time()."','$origin','$registration_key','$allow_mailing','".time()."')";
- $res=mysql_query("$sql",$mysql_id);
- $fout=mysql_errno($mysql_id);
- if ($fout != 0)
- {
- $fout=mysql_error($mysql_id);
- echo '<font color="#FF2306">' . $fout . '</font>';
- mysql_close($mysql_id);
- echo '</body></html>';
- exit;
- }
- else
- {
- send_registration_mail($gebruikersnaam,$email,$registration_key);
- setrawcookie("gebruikersnaam", "$gebruikersnaam", time()+54000, "/");
- setrawcookie("wachtwoord", "$wachtwoord", time()+54000, "/");
- $succes="ja";
- mysql_close();
- /*$db = "thrdspla_questionbasher";
- mysql_connect("$dbhost","$dbuser","$dbpass") or die(mysql_error());
- mysql_select_db($db) or die(mysql_error());
- $qb_request = mysql_query("INSERT into Hosts (host,question_id,score,questions_had,game_status,time,answerer) VALUES ('$gebruikersnaam','0','0','0','game_start','0','')") or die(mysql_error());
- mysql_close();*/
- }
- }
- }
- include("header.php");
- if($succes=="ja")
- {
- echo "<div align=\"center\"><h3>Please verificate your email address, $gebruikersnaam!</h3><br>";
- echo "<h4>We are now going to send you a verification email. Please check your mail and click the link that is inside. If you can't find it, try checking your spam folder.</h4>\n";
- echo "<center><font size=3>Click <a href=\"../index.php\">here</a> to go back to the homepage.</font></center>\n";
- }
- if(empty($_POST['aanmelden']) or !empty($foutenmelding))
- {
- echo "<br>";
- echo "<center><h1>Register</h1></center>\n";
- echo "<br>";
- if(!empty($foutenmelding))
- {
- echo '<font color="#FF2306">'.$foutenmelding.'</font>';
- }
- ?>
- <style>
- input
- {
- font-size: 6pt;
- width: 80px;
- }
- </style>
- <form action="<?php echo $_SERVER['PHP_SELF'];?><?php if($_GET['ref'] == 'triniate'){ echo "?ref=triniate";}?>" method="post">
- <table border=1>
- <tr><td>Username:</td><td><input type="text" name="gebruikersnaam" maxlength="15"></td></tr>
- <tr><td>Password:</td><td><input type="password" name="wachtwoord" maxlength="20"></td></tr>
- <tr><td>Retype password:</td><td><input type="password" name="wachtwoordcontrole" maxlength="20"></td></tr>
- <tr><td>E-mail (You'll receive a verification email):</td><td><input type="text" name="email" maxlength=50></td></tr>
- <?php /*<tr><td>Allow Home4DSi to email you newsletters (<u>Not required</u>):</td><td><select name='allow_mailing'><option value='0'>No</option><option value='1'>Yes</option></select></td></tr>*/ ?>
- <tr><td colspan=2>Retype the image below:</td></tr>
- <tr><td><img src="captcha.php" />
- </td><td><input class="input" type="text" name="norobot" /></td></tr>
- <tr><td colspan=2><input type="submit" name="aanmelden" value="Register!"></td></tr>
- </table>
- </form>
- <?php
- }
- include('footer.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement