This blob has been accessed 345 times via Git panel.
- <?php
- if (file_exists("data/lite.txt")) {
- }
- if (!file_exists("data/reg.txt")) {
- }
- error_reporting(E_ERROR);
- if (get_magic_quotes_gpc()) {
- function stripslashes_array($data) {
- if (is_array($data)){
- foreach ($data as $key => $value){
- $data[$key] = stripslashes_array($value);
- }
- return $data;
- }
- else{
- return stripslashes($data);
- }
- }
- $_REQUEST = stripslashes_array($_REQUEST);
- }
- if (file_exists("data/offset.txt")) {
- $offset = file_get_contents("data/offset.txt");
- }
- else {
- $offset = 0;
- }
- if (file_exists("data/bb-min-age.txt")) {
- $minage = file_get_contents("data/bb-min-age.txt");
- }
- else {
- $minage = 5;
- }
- if (file_exists("data/bb-max-age.txt")) {
- $maxage = file_get_contents("data/bb-max-age.txt");
- }
- else {
- $maxage = 125;
- }
- ?>
- <style>
- body {
- color: #666666;
- margin: 10px;
- padding: 0px;
- text-align: left;
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $font_body = file_get_contents("data/fonts/body.txt");
- echo "{$font_body},";
- }
- ?> arial, helvetica, sans-serif;
- background-color: #FFFFFF;
- }
- p {
- font-size: 11px;
- }
- a {
- font-weight: bold;
- text-decoration: none;
- }
- a:link, a:visited {
- color: #666666;
- }
- a:hover {
- color: #336699;
- }
- a:active {
- color: #336699;
- }
- .input {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 300px;
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $font_input = file_get_contents("data/fonts/input.txt");
- echo "{$font_input},";
- }
- ?> arial, helvetica, sans-serif;
- font-size: 11px;
- font-weight: normal;
- }
- .bd {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 98px;
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $font_input = file_get_contents("data/fonts/input.txt");
- echo "{$font_input},";
- }
- ?> arial, helvetica, sans-serif;
- font-size: 11px;
- font-weight: normal;
- }
- </style>
- <?php
- // 20061014 - reg.php
- function str_rand($length = 8, $seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
- $str = '';
- list($usec, $sec) = explode(' ', microtime());
- $seed = (float) $sec + ((float) $usec * 100000);
- mt_srand($seed);
- for ($i = 0; $length > $i; $i++) {
- $str .= $seeds{mt_rand(0, $seeds_count - 1)};
- }
- return $str;
- }
- function rmdirr($recurse_dirname) {
- if (!file_exists($recurse_dirname)) {
- return false;
- }
- if (is_file($recurse_dirname)) {
- return unlink($recurse_dirname);
- }
- $recurse_dir = dir($recurse_dirname);
- while (false !== $recurse_entry = $recurse_dir->read()) {
- if ($recurse_entry == '.' || $recurse_entry == '..') {
- continue;
- }
- rmdirr("$recurse_dirname/$recurse_entry");
- }
- $recurse_dir->close();
- return rmdir($recurse_dirname);
- }
- if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_REQUEST['key']) and !empty($_REQUEST['key']) and isset($_REQUEST['action']) and !empty($_REQUEST['action'])) {
- $username = $_REQUEST['username'];
- if (file_exists("data/members/confirmed/$username") and ($_REQUEST['key'] == file_get_contents("data/members/confirmed/$username/key.txt"))) {
- if ($_REQUEST['action'] == "approve") {
- unlink("data/members/confirmed/$username/key.txt");
- if (!file_exists("data/members/active")) {
- mkdir("data/members/active");
- }
- $password = str_rand(16);
- /* Fun with crypt! */
- $passwd = sha1($password);
- $passwd = md5($passwd);
- $passwd = crypt($passwd, $passwd);
- $firstname = file_get_contents("data/members/active/$username/firstname.txt");
- $lastname = file_get_contents("data/members/active/$username/lastname.txt");
- $email = file_get_contents("data/members/active/$username/email.txt");
- $from_email = file_get_contents("data/email.txt");
- $mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $sig_author = file_get_contents("data/author.txt");
- $sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $sig_url = str_replace('//', '/', $sig_url);
- $sig_url = "http://" . $sig_url;
- $registered_notice = "$firstname $lastname ($email), AKA $username, has been successfully registered at {$sig_url}.";
- $registered_notice = wordwrap($registered_notice);
- $password_notice = "Hi $firstname,\n\nYour membership at $sig_url has been activated.\n\nThe initial password for \"$username\" is \"$password\" (case-sensitive). Please change this as soon as possible. For security reasons, your password on record is encrypted - you're the only one who knows what it is.\n\nIf you need further assistance, please send email to $from_email.\n\nThanks!\n\n--\n$sig_author\n$sig_url\n";
- $password_notice = wordwrap($password_notice);
- $email_from = '"' . $sig_author . '" <' . $from_email . '>';
- $email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
- mail($email_from, "registration notice ($email)", $registered_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
- "X-Mailer: $mailer");
- mail($email_to, "password notice ($username)", $password_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
- "X-Mailer: $mailer");
- echo "<p><font style=\"font-size: 12px;\"><b>Approved</b></font></p><p>The e-mail address ";
- readfile("data/members/active/$username/email.txt");
- echo " has been registered.<br>Click <a href=index.php>here</a> to go to the index page.</p>";
- }
- if ($_REQUEST['action'] == "deny") {
- rmdirr("data/members/confirmed/$username");
- echo "<p><font style=\"font-size: 12px;\"><b>Denied</b></font></p><p>The e-mail address ";
- readfile("data/members/active/$username/email.txt");
- echo " will not be registered.<br>Registration request deleted.<br>Click <a href=index.php>here</a> to go to the index page.</p>";
- }
- }
- }
- if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_REQUEST['key']) and !empty($_REQUEST['key'])) {
- $username = $_REQUEST['username'];
- if (file_exists("data/members/pending/$username") and ($_REQUEST['key'] == file_get_contents("data/members/pending/$username/key.txt"))) {
- $firstname = file_get_contents("data/members/pending/$username/firstname.txt");
- $lastname = file_get_contents("data/members/pending/$username/lastname.txt");
- $email = file_get_contents("data/members/pending/$username/email.txt");
- $from_email = file_get_contents("data/email.txt");
- $mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $sig_url = str_replace('//', '/', $sig_url);
- $sig_url = "http://" . $sig_url;
- $sig_author = file_get_contents("data/author.txt");
- unlink("data/members/pending/$username/key.txt");
- if (!file_exists("data/xapp.txt")) {
- if (!file_exists("data/members/confirmed")) {
- mkdir("data/members/confirmed");
- }
- $key = str_rand(40);
- $confirmation_notice = "$firstname $lastname, AKA $username, successfully confirmed the e-mail address $email for registration at {$sig_url}.\n\nVisit the link below to approve this registration:\n\n{$sig_url}reg.php?username=$username&key=$key&action=approve\n\nVisit the link below to deny this registration:\n\n{$sig_url}reg.php?username=$username&key=$key&action=deny\n\nYou can also approve or deny pending registration requests at a later time by logging on to your blog.";
- $confirmation_notice = wordwrap($confirmation_notice);
- $email_from = '"' . $sig_author . '" <' . $from_email . '>';
- mail($email_from, "confirmation notice ($email)", $confirmation_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
- "X-Mailer: $mailer");
- }
- else {
- if (!file_exists("data/members/active")) {
- mkdir("data/members/active");
- }
- $registered_notice = "$firstname $lastname ($email), AKA $username, has been successfully registered at {$sig_url}.";
- $registered_notice = wordwrap($registered_notice);
- $email_from = '"' . $sig_author . '" <' . $from_email . '>';
- mail($email_from, "registration notice ($email)", $registered_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
- "X-Mailer: $mailer");
- $password = str_rand(16);
- /* Fun with crypt! */
- $passwd = sha1($password);
- $passwd = md5($passwd);
- $passwd = crypt($passwd, $passwd);
- $firstname = file_get_contents("data/members/active/$username/firstname.txt");
- $lastname = file_get_contents("data/members/active/$username/lastname.txt");
- $email = file_get_contents("data/members/active/$username/email.txt");
- $from_email = file_get_contents("data/email.txt");
- $mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $sig_author = file_get_contents("data/author.txt");
- $sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $sig_url = str_replace('//', '/', $sig_url);
- $sig_url = "http://" . $sig_url;
- $password_notice = "Hi $firstname,\n\nYour membership at $sig_url has been activated.\n\nThe initial password for \"$username\" is \"$password\" (case-sensitive). Please change this as soon as possible. For security reasons, your password on record is encrypted - you're the only one who knows what it is.\n\nIf you need further assistance, please send email to $from_email.\n\nThanks!\n\n--\n$sig_author\n$sig_url\n";
- $password_notice = wordwrap($password_notice);
- $email_from = '"' . $sig_author . '" <' . $from_email . '>';
- $email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
- mail($email_to, "password notice ($username)", $password_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
- "X-Mailer: $mailer");
- }
- echo "<p><font style=\"font-size: 12px;\"><b>Thanks!</b></font></p><p>You have successfully verified your e-mail address.<br>";
- if (file_exists("data/xapp.txt")) {
- echo "You are now a registered member on this site.";
- }
- else {
- echo "Your membership will be activated as soon as your registration is approved.";
- }
- echo "<br>Click <a href=index.php>here</a> to go to the index page.</p>";
- }
- }
- if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and ($_REQUEST['username'] != "all") and isset($_POST['captcha_put']) and !empty($_POST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_POST['captcha_get'] == $_POST['captcha_put']) and (ereg("@", $_POST['email'])) and (ereg("\.", $_POST['email'])) and (strpos(file_get_contents("data/bb-reserved.txt"), $_REQUEST['username']) === false) and isset($_POST['bd_year']) and !empty($_POST['bd_year']) and isset($_POST['bd_month']) and !empty($_POST['bd_month']) and isset($_POST['bd_day']) and !empty($_POST['bd_day']) and (strlen($_POST['bd_year']) == "4") and (strlen($_POST['bd_month']) == "2") and (strlen($_POST['bd_day']) == "2") and is_numeric($_POST['bd_year']) and is_numeric($_POST['bd_month']) and is_numeric($_POST['bd_day']) and ((date("Y", time() + $offset) - $_POST['bd_year']) <= $maxage) and ((date("Y", time() + $offset) - $_POST['bd_year']) >= $minage) and ($_POST['bd_month'] >= 1) and ($_POST['bd_month'] <= 12) and ($_POST['bd_day'] >= 1) and ($_POST['bd_day'] <= 31)) {
- $username = strtolower($_REQUEST['username']);
- $username = str_replace(" ","_",$username);
- $username = trim($username);
- $username = htmlentities($username, ENT_NOQUOTES);
- $firstname = strtolower($_POST['firstname']);
- $firstname = ucwords($firstname);
- $firstname = trim($firstname);
- $firstname = htmlentities($firstname, ENT_NOQUOTES);
- $lastname = strtolower($_POST['lastname']);
- $lastname = ucwords($lastname);
- $lastname = trim($lastname);
- $lastname = htmlentities($lastname, ENT_NOQUOTES);
- $email = strtolower($_POST['email']);
- $email = trim($email);
- $email = htmlentities($email, ENT_NOQUOTES);
- if (!file_exists("data/members")) {
- mkdir("data/members");
- }
- if (!file_exists("data/members/pending")) {
- mkdir("data/members/pending");
- }
- if (!file_exists("data/members/pending/$username") and !file_exists("data/members/confirmed/$username") and !file_exists("data/members/active/$username") and ($username != file_get_contents("data/username.txt"))) {
- mkdir("data/members/pending/$username");
- $bday = $_POST['bd_year'] . $_POST['bd_month'] . $_POST['bd_day'];
- if (isset($_POST['url']) and !empty($_POST['url']) and (ereg("\.", $_POST['url']))) {
- $url = str_replace('http://', '', $_POST['url']);
- $url = strtolower($url);
- $url = trim($url);
- $url = 'http://' . $url;
- $url = htmlentities($url, ENT_NOQUOTES);
- }
- $key = str_rand(40);
- $mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $sig_url = str_replace('//', '/', $sig_url);
- $sig_url = "http://" . $sig_url;
- $sig_author = file_get_contents("data/author.txt");
- $from_email = file_get_contents("data/email.txt");
- $confirm_thanks = "Hi $firstname,\n\nWe have received a registration request for $email to $sig_url. To confirm this, simply visit this link:\n\n{$sig_url}reg.php?username=$username&key=$key\n\nIf you do not wish to be a member, please disregard this message. If you think you are being maliciously registered, or have any other questions, send them to $from_email.\n\nThanks!\n\n--\n$sig_author\n$sig_url\n";
- $confirm_thanks = wordwrap($confirm_thanks);
- $email_from = '"' . $sig_author . '" <' . $from_email . '>';
- $email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
- mail($email_to, "confirm $key", $confirm_thanks,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
- "X-Mailer: $mailer");
- echo "<p><font style=\"font-size: 12px;\"><b>Thanks!</b></font></p><p>Your registration request was successfully submitted. Check your $email inbox for details.<br>You can register another e-mail address below or click <a href=index.php>here</a> to go to the index page.</p>";
- }
- else {
- echo "<p><font style=\"font-size: 12px;\"><b>Oops!</b></font></p><p>Sorry, the username $username is already taken. Please try another one.</p>";
- }
- }
- ?>
- <p><b>Register</b></p>
- <p>Fill out the form below and enter <b><?php $captcha_rand = str_rand(7); echo $captcha_rand; ?></b> as your registration code.</p>
- <?php
- if (file_exists("data/bb-disclaimer.txt")) {
- echo "<table border=0 cellspacing=0 cellpadding=0 width=400><tr><td><p>";
- readfile("data/bb-disclaimer.txt");
- echo "</p></td></tr><tr><td><p> </p></td></tr></table>";
- }
- ?>
- <table border=0 cellspacing=2 cellpadding=0>
- <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- <input type=hidden name=captcha_get value="<?php echo $captcha_rand; ?>">
- <tr><td width=100><p>Username</p></td><td colspan=3><input class=input type=text autocomplete=off name=username maxlength=30></td></tr>
- <tr><td width=100><p>First Name</p></td><td width=300 colspan=3><input class=input type=text autocomplete=off name=firstname maxlength=30></td></tr>
- <tr><td width=100><p>Last Name</p></td><td colspan=3><input class=input type=text autocomplete=off name=lastname maxlength=30></td></tr>
- <tr><td width=100><p>E-mail Address</p></td><td colspan=3><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>
- <tr><td width=100><p>Birthdate</p></td><td><input class=bd type=text autocomplete=off name=bd_year maxlength=4 value=<?php echo date("Y", time() + $offset); ?>></td><td><input class=bd type=text autocomplete=off name=bd_month maxlength=2 value=<?php echo date("m", time() + $offset); ?>></td><td><input class=bd type=text autocomplete=off name=bd_day maxlength=2 value=<?php echo date("d", time() + $offset); ?>></td></tr>
- <tr><td width=100><p>Website</p></td><td colspan=3><input class=input type=text autocomplete=off name=url maxlength=300></td></tr>
- <tr><td width=100><p>Registration Code</p></td><td colspan=3><input class=input type=text autocomplete=off name=captcha_put maxlength=7></td></tr>
- <tr><td><p></p></td><td colspan=3><input class=input type=submit value="click here to submit your registration"></td></tr>
- </form>
- <form enctype="multipart/form-data" action="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); ?>" method="post">
- <tr><td><p></p></td><td colspan=3><input class=input type=submit value="click here to go to the index page"></td></tr>
- </for