$page = "join"; require('conf/variables.php'); require('top.php'); include 'include/avatars.inc.php'; ?>
Join.
if ($_POST[submit]) {
$name = trim(strip_tags($_POST[name]));
$passworddb = trim(strip_tags($_POST[passworddb]));
$passworddb2 = trim(strip_tags($_POST[passworddb2]));
$msn = trim(strip_tags($_POST[msn]));
$icq = trim(strip_tags($_POST[icq]));
$aim = trim(strip_tags($_POST[aim]));
$mail = trim(strip_tags($_POST[mail]));
$WesVersion = $_POST[version];
$MsgMeToPlay = $_POST[msgme];
$length = strlen($name);
if ($_POST[MonM] != "") {$CanPlay = "$CanPlay $_POST[MonM]";}
if ($_POST[MonN] != "") {$CanPlay = "$CanPlay $_POST[MonN]";}
if ($_POST[MonA] != "") {$CanPlay = "$CanPlay $_POST[MonA]";}
if ($_POST[MonE] != "") {$CanPlay = "$CanPlay $_POST[MonE]";}
if ($_POST[MonNi] != "") {$CanPlay = "$CanPlay $_POST[MonNi]";}
if ($_POST[TueM] != "") {$CanPlay = "$CanPlay $_POST[TueM]";}
if ($_POST[TueN] != "") {$CanPlay = "$CanPlay $_POST[TueN]";}
if ($_POST[TueA] != "") {$CanPlay = "$CanPlay $_POST[TueA]";}
if ($_POST[TueE] != "") {$CanPlay = "$CanPlay $_POST[TueE]";}
if ($_POST[TueNi] != "") {$CanPlay = "$CanPlay $_POST[TueNi]";}
if ($_POST[WedM] != "") {$CanPlay = "$CanPlay $_POST[WedM]";}
if ($_POST[WedN] != "") {$CanPlay = "$CanPlay $_POST[WedN]";}
if ($_POST[WedA] != "") {$CanPlay = "$CanPlay $_POST[WedA]";}
if ($_POST[WedE] != "") {$CanPlay = "$CanPlay $_POST[WedE]";}
if ($_POST[WedNi] != "") {$CanPlay = "$CanPlay $_POST[WedNi]";}
if ($_POST[ThuM] != "") {$CanPlay = "$CanPlay $_POST[ThuM]";}
if ($_POST[ThuN] != "") {$CanPlay = "$CanPlay $_POST[ThuN]";}
if ($_POST[ThuA] != "") {$CanPlay = "$CanPlay $_POST[ThuA]";}
if ($_POST[ThuE] != "") {$CanPlay = "$CanPlay $_POST[ThuE]";}
if ($_POST[ThuNi] != "") {$CanPlay = "$CanPlay $_POST[ThuNi]";}
if ($_POST[FriM] != "") {$CanPlay = "$CanPlay $_POST[FriM]";}
if ($_POST[FriN] != "") {$CanPlay = "$CanPlay $_POST[FriN]";}
if ($_POST[FriA] != "") {$CanPlay = "$CanPlay $_POST[FriA]";}
if ($_POST[FriE] != "") {$CanPlay = "$CanPlay $_POST[FriE]";}
if ($_POST[FriNi] != "") {$CanPlay = "$CanPlay $_POST[FriNi]";}
if ($_POST[SatM] != "") {$CanPlay = "$CanPlay $_POST[SatM]";}
if ($_POST[SatN] != "") {$CanPlay = "$CanPlay $_POST[SatN]";}
if ($_POST[SatA] != "") {$CanPlay = "$CanPlay $_POST[SatA]";}
if ($_POST[SatE] != "") {$CanPlay = "$CanPlay $_POST[SatE]";}
if ($_POST[SatNi] != "") {$CanPlay = "$CanPlay $_POST[SatNi]";}
if ($_POST[SunM] != "") {$CanPlay = "$CanPlay $_POST[SunM]";}
if ($_POST[SunN] != "") {$CanPlay = "$CanPlay $_POST[SunN]";}
if ($_POST[SunA] != "") {$CanPlay = "$CanPlay $_POST[SunA]";}
if ($_POST[SunE] != "") {$CanPlay = "$CanPlay $_POST[SunE]";}
if ($_POST[SunNi] != "") {$CanPlay = "$CanPlay $_POST[SunNi]";}
if ($passworddb == "") {
echo "Please enter a password.";
}
else if ($passworddb != $passworddb2) { echo "Passwords don't match. Please retype the passwords..
"; }
else if ($mail == "") {
if (REG_MAILVERIFICATION == 1) { echo "Please enter a valid email. An activation link will be sent to it.
"; } else {
echo "Please enter a valid email. No spam will be sent.
";
}
}
else if ( $WesVersion == "") { echo "You must specify what version(s) of Wensoth you're using...
"; }
else if ($name == "") { echo "Please enter a nickname."; }
else if (($length > REG_MAX_NICKLENGTH) || ($length < REG_MIN_NICKLENGTH)) { echo "The name you entered is invalid. It must be ". REG_MIN_NICKLENGTH ." to ". REG_MAX_NICKLENGTH ." characters long.
Please go back to correct the error by selecting a different username."; }
else if (!preg_match("/^[a-zA-Z0-9\-\_]+$/i", $name)) { echo "You're only allowed to use standard aA-zZ 0-9 alfanumerical characters and the - and _ signs.
Please enter a valid Wesnoth multiplayer nickname."; }
// If we pass the errorchecking this happens:
else {
if (REG_MAILVERIFICATION == 1) {
// Random confirmation code
$confirm_code=md5(uniqid(rand()));
} else {
$confirm_code = "Ok";
// if we dont have mail confirmation enabled in the config we will "autoverify" the user by setting him to "Ok" in the Confirmation rown in the players table.
}
// Lets generate the encrypted pass... we do it by applying the salt and hashing it twice.
$emailthispass = $passworddb;
$passworddb = $salt.$passworddb;
$passworddb = md5($passworddb);
$passworddb = md5($passworddb);
$sql="SELECT * FROM $playerstable WHERE name = '$name'";
$result=mysql_query($sql,$db);
$samenick = mysql_num_rows($result);
// If we didnt find a user with the same nick the following happens:
if ($samenick < 1) {
if ($approve == 'yes') { $approved = 'no'; }
else { $approved = 'yes'; }
if (getenv("HTTP_X_FORWARDED_FOR")) { $ip = getenv("HTTP_X_FORWARD_FOR"); }
else { $ip = getenv("REMOTE_ADDR"); }
$sql = "INSERT INTO $playerstable (name, passworddb, mail, icq, aim, msn, country, approved, ip, avatar, HaveVersion, MsgMe, Confirmation, CanPlay) VALUES ('$name', '$passworddb', '$mail','$icq','$aim', '$msn', '$_POST[country]', '$approved', '$ip', '$_POST[avatar]', '$WesVersion', '$MsgMeToPlay', '$confirm_code', '$CanPlay')";
$result = mysql_query($sql);
if (REG_MAILVERIFICATION == 1) {
echo "An activation mail has been sent to your mail. To activate your account you must click the link that is within it.
If you have not recieved the mail within an hour please check your spam box or contact us.";
// if suceesfully inserted data into database, send confirmation link to email
if($result){
// ---------------- SEND MAIL FORM ----------------
// send e-mail to ...
$to = $mail;
// Your subject
$subject = "Ladder of Wesnoth activation link";
// Your message
$body="Welcome to the Ladder of Wesnoth. This is your activation mail. \r\n";
$body.="Click the link below to activate your account: \r\n";
$body.="http://ladder.subversiva.org/confirmation.php?passkey=$confirm_code \r\n";
$body.="If it doesnt work you can try to copy & pass it into your browser instead.\r\n";
$body.="\r\n";
$body.="Your username and password is: $name / $emailthispass\r\n";
$body.="Save the info! We can't give it to you if you lose it.\r\n";
$body.="\r\n";
$body.="\r\n";
$body.="As a new player you start with a rating of 1500. That is the average rating that a player who knows the game fairly will have. Players that are new to the game are expected to get a much lower rating after a couple of games, while veterans are expected to get a higher.\r\n";
$body.="\r\n";
$body.="Dont quit if you get low rating - it is fully normal and expected while you learn the game, and Wesnoth takes quite some time to master. The rating is, first and foremost, a personal measure to track your own skills for your own sake. Play to have fun and use the ladder as a tool for information. Use it to find players that have about the same skills as you, thats when the game is most fun to play.\r\n";
$body.="\r\n";
$body.="\r\n";
$body.="Please read the FAQ & Rules before you play a ladder game. Also, feel free to contact us if you need help or have suggestions.\r\n";
$body.="\r\n";
$body.="See you in Wesnoth...\n";
// send email
$sentmail = send_mail($to, $body, $subject, $laddermailsender, $titlebar);
}
// if not found
else { echo "Your mail wasn't found in our database."; }
// if your email succesfully sent
if($sentmail){}
else { echo "Failed to send activation link to your e-mail address. Contact admin if the problem remains tomorrow."; }
} else if ( REG_MAILVERIFICATION == 0) { echo "
"; }
} else { echo "The name you entered already exists. Please select another name."; }
}
}
else{
?>
Multiple accounts are forbidden. If you have problems with your account or registration please read the rules & faq. Contact us after that if you're problems remain. By registering you agree to all the ladder rules.