This blob has been accessed 297 times via Git panel.
- <?php
- session_start();
- header("Cache-control: private");
- 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/lite.txt")) {
- }
- if (!file_exists("data/bb.txt")) {
- }
- ?>
- <style>
- body
- {
- color: #666666;
- margin: 10px;
- padding: 0px;
- text-align: left;
- font-family: verdana, 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: verdana,helvetica,sans-serif;
- font-size: 11px;
- font-weight: normal;
- }
- </style>
- <?php
- if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_REQUEST['key']) and !empty($_REQUEST['key'])) {
- $username = $_REQUEST['username'];
- if (file_exists("data/members/active/$username") and ($_REQUEST['key'] == file_get_contents("data/members/active/$username/key.txt"))) {
- unlink("data/members/active/$username/key.txt");
- unlink("data/members/active/$username/vacation.txt");
- unlink("data/members/active/$username/email.txt");
- echo "<p><font style=\"font-size: 12px;\"><b>Thanks!</b></font></p><p>You have successfully verified your new e-mail address.<br>Click <a href=index.php>here</a> to go to the index page.</p>";
- }
- }
- if (!isset($_SESSION['logged_in'])) {
- }
- if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
- }
- if (!file_exists("data/members/active/{$_SESSION['logged_in']}")) {
- }
- if (isset($_REQUEST['email']) and !empty($_REQUEST['email']) and (file_get_contents("data/members/active/{$_SESSION['logged_in']}/email.txt") != $_REQUEST['email']) and (ereg("@", $_REQUEST['email'])) and (ereg("\.", $_REQUEST['email']))) {
- $email_write_content = strtolower($_REQUEST['email']);
- $email_write_content = trim($email_write_content);
- $email_write_content = htmlentities($email_write_content, ENT_NOQUOTES);
- 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;
- }
- $key_email = str_rand(40);
- $firstname = file_get_contents("data/members/active/{$_SESSION['logged_in']}/firstname.txt");
- $old_email = file_get_contents("data/members/active/{$_SESSION['logged_in']}/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");
- $from_email = file_get_contents("data/email.txt");
- $confirm_change = "Hi $firstname,\n\nWe have received an e-mail address modification request ($old_email to $email_write_content) at $sig_url. To confirm this, simply visit this link:\n\n{$sig_url}options.php?username={$_SESSION['logged_in']}&key=$key_email\n\nIf you have any questions, send them to $from_email.\n\nThanks!\n\n--\n$sig_author\n$sig_url\n";
- $confirm_change = wordwrap($confirm_change);
- mail($email_write_content, "confirm $key_email", $confirm_change,
- "From: $from_email\r\n" .
- "Reply-To: $from_email\r\n" .
- "X-Mailer: $mailer");
- echo "<p>Confirmation request sent. Check your $email_write_content inbox for details.</p>";
- }
- if ((!isset($_REQUEST['url']) or empty($_REQUEST['url'])) and isset($_REQUEST['edit']) and ($_REQUEST['edit'] == "on")) {
- unlink("data/members/active/{$_SESSION['logged_in']}/url.txt");
- }
- if (isset($_REQUEST['url']) and !empty($_REQUEST['url']) and (ereg("\.", $_REQUEST['url']))) {
- $url = str_replace('http://', '', $_REQUEST['url']);
- $url = strtolower($url);
- $url = trim($url);
- $url = 'http://' . $url;
- $url = htmlentities($url, ENT_NOQUOTES);
- }
- if ((!isset($_REQUEST['sig']) or empty($_REQUEST['sig'])) and isset($_REQUEST['edit']) and ($_REQUEST['edit'] == "on")) {
- unlink("data/members/active/{$_SESSION['logged_in']}/sig.txt");
- }
- if (isset($_REQUEST['sig']) and !empty($_REQUEST['sig'])) {
- $sig = strip_tags($_REQUEST['sig']);
- $sig = str_replace("[b]","<b>",$sig);
- $sig = str_replace("[/b]","</b>",$sig);
- $sig = str_replace("[i]","<i>",$sig);
- $sig = str_replace("[/i]","</i>",$sig);
- $sig = str_replace("[u]","<u>",$sig);
- $sig = str_replace("[/u]","</u>",$sig);
- $sig = str_replace("[sup]","<sup>",$sig);
- $sig = str_replace("[/sup]","</sup>",$sig);
- $sig = str_replace("[sub]","<sub>",$sig);
- $sig = str_replace("[/sub]","</sub>",$sig);
- $sig = str_replace("[strike]","<strike>",$sig);
- $sig = str_replace("[/strike]","</strike>",$sig);
- $sig = str_replace("\n","<br>", $sig);
- $sig = ucfirst($sig);
- $sig = trim($sig);
- }
- if (isset($_REQUEST['del_avatar']) and !empty($_REQUEST['del_avatar']) and ($_REQUEST['del_avatar'] == "on")) {
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.gif")) {
- unlink("images/members/{$_SESSION['logged_in']}/avatar.gif");
- }
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.jpg")) {
- unlink("images/members/{$_SESSION['logged_in']}/avatar.jpg");
- }
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.png")) {
- unlink("images/members/{$_SESSION['logged_in']}/avatar.png");
- }
- }
- if (isset($_FILES['avatar']) and !empty($_FILES['avatar'])) {
- $max_image_size = 1000000;
- if (is_uploaded_file($_FILES['avatar']['tmp_name'])) {
- if ($_FILES['avatar']['size']<=$max_image_size) {
- if (($_FILES['avatar']['type']=="image/gif") || ($_FILES['avatar']['type']=="image/pjpeg") || ($_FILES['avatar']['type']=="image/jpeg") || ($_FILES['avatar']['type']=="image/png")) {
- if (!file_exists("images/members")) {
- mkdir("images/members");
- }
- if (!file_exists("images/members/{$_SESSION['logged_in']}")) {
- mkdir("images/members/{$_SESSION['logged_in']}");
- }
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.gif")) {
- unlink("images/members/{$_SESSION['logged_in']}/avatar.gif");
- }
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.jpg")) {
- unlink("images/members/{$_SESSION['logged_in']}/avatar.jpg");
- }
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.png")) {
- unlink("images/members/{$_SESSION['logged_in']}/avatar.png");
- }
- if ($_FILES['avatar']['type']=="image/gif") {
- $res = copy($_FILES['avatar']['tmp_name'], "images/members/{$_SESSION['logged_in']}/avatar.gif");
- unlink($_FILES['avatar']['tmp_name']);
- }
- if (($_FILES['avatar']['type']=="image/jpeg") or ($_FILES['avatar']['type']=="image/pjpeg")) {
- $res = copy($_FILES['avatar']['tmp_name'], "images/members/{$_SESSION['logged_in']}/avatar.jpg");
- unlink($_FILES['avatar']['tmp_name']);
- }
- if ($_FILES['avatar']['type']=="image/png") {
- $res = copy($_FILES['avatar']['tmp_name'], "images/members/{$_SESSION['logged_in']}/avatar.png");
- unlink($_FILES['avatar']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['avatar']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['avatar']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['avatar']['tmp_name']);
- }
- }
- if (isset($_REQUEST['vacation']) and !empty($_REQUEST['vacation']) and ($_REQUEST['vacation'] == "on") and !file_exists("data/members/active/{$_SESSION['logged_in']}/vacation.txt")) {
- touch("data/members/active/{$_SESSION['logged_in']}/vacation.txt");
- }
- if (!isset($_REQUEST['vacation']) or empty($_REQUEST['vacation'])) {
- if (isset($_REQUEST['edit']) and ($_REQUEST['edit'] == "on")) {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/vacation.txt")) {
- unlink("data/members/active/{$_SESSION['logged_in']}/vacation.txt");
- }
- }
- }
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/key.txt") and !file_exists("data/members/active/{$_SESSION['logged_in']}/vacation.txt")) {
- touch("data/members/active/{$_SESSION['logged_in']}/vacation.txt");
- }
- if (isset($_REQUEST['current_passwd']) and !empty($_REQUEST['current_passwd']) and isset($_REQUEST['new_passwd']) and !empty($_REQUEST['new_passwd']) and isset($_REQUEST['confirm_passwd']) and !empty($_REQUEST['confirm_passwd'])) {
- if (file_exists("data/bb-passlen.txt")) {
- $pass_len = file_get_contents("data/bb-passlen.txt");
- }
- else {
- $pass_len = 8;
- }
- $current_passwd = trim($_REQUEST['current_passwd']);
- $new_passwd = trim($_REQUEST['new_passwd']);
- $confirm_passwd = trim($_REQUEST['confirm_passwd']);
- echo "<p>Passwords must be composed of at least $pass_len characters.</p>";
- }
- else {
- /* Fun with crypt! */
- $current_passwd = sha1($current_passwd);
- $current_passwd = md5($current_passwd);
- $current_passwd = crypt($current_passwd, $current_passwd);
- $new_passwd = sha1($new_passwd);
- $new_passwd = md5($new_passwd);
- $new_passwd = crypt($new_passwd, $new_passwd);
- $confirm_passwd = sha1($confirm_passwd);
- $confirm_passwd = md5($confirm_passwd);
- $confirm_passwd = crypt($confirm_passwd, $confirm_passwd);
- if (($current_passwd != file_get_contents("data/members/active/{$_SESSION['logged_in']}/password.txt")) or ($new_passwd != $confirm_passwd)) {
- echo "<p>Passwords do not match.</p>";
- }
- else {
- $login_url = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/login.php";
- $login_url = str_replace("//login.php", "/login.php", $login_url);
- echo "<p>Password successfully changed and encrypted on record.</p>";
- }
- }
- }
- ?>
- <table border=0 cellspacing=1 cellpadding=2 bgcolor=#cccccc>
- <tr><td bgcolor=#ffffff colspan=2 align=right><p>you are logged in as <b><?php echo "<b>{$_SESSION['logged_in']}</b>"; ?> </b></p></td></tr>
- <tr><td bgcolor=#ffffff><?php
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.jpg") or file_exists("images/members/{$_SESSION['logged_in']}/avatar.gif") or file_exists("images/members/{$_SESSION['logged_in']}/avatar.png")) {
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.gif")) {
- $avatar_gif_image_size = getimagesize("images/members/{$_SESSION['logged_in']}/avatar.gif");
- $avatar_gif_image_width = $avatar_gif_image_size[0];
- $avatar_gif_image_height = $avatar_gif_image_size[1];
- $max_avatar_gif_image_width = 80;
- if ($avatar_gif_image_width > $max_avatar_gif_image_width) {
- $sizefactor = (double) ($max_avatar_gif_image_width / $avatar_gif_image_width) ;
- $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
- $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=images/members/{$_SESSION['logged_in']}/avatar.gif border=0 width=";
- echo $avatar_gif_image_width;
- echo " height=";
- echo $avatar_gif_image_height;
- }
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.jpg")) {
- $avatar_jpg_image_size = getimagesize("images/members/{$_SESSION['logged_in']}/avatar.jpg");
- $avatar_jpg_image_width = $avatar_jpg_image_size[0];
- $avatar_jpg_image_height = $avatar_jpg_image_size[1];
- $max_avatar_jpg_image_width = 80;
- if ($avatar_jpg_image_width > $max_avatar_jpg_image_width) {
- $sizefactor = (double) ($max_avatar_jpg_image_width / $avatar_jpg_image_width) ;
- $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
- $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=images/members/{$_SESSION['logged_in']}/avatar.jpg border=0 width=";
- echo $avatar_jpg_image_width;
- echo " height=";
- echo $avatar_jpg_image_height;
- }
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.png")) {
- $avatar_png_image_size = getimagesize("images/members/{$_SESSION['logged_in']}/avatar.png");
- $avatar_png_image_width = $avatar_png_image_size[0];
- $avatar_png_image_height = $avatar_png_image_size[1];
- $max_avatar_png_image_width = 80;
- if ($avatar_png_image_width > $max_avatar_png_image_width) {
- $sizefactor = (double) ($max_avatar_png_image_width / $avatar_png_image_width) ;
- $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
- $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- }
- echo "<img src=images/members/{$_SESSION['logged_in']}/avatar.png border=0 width=";
- echo $avatar_png_image_width;
- echo " height=";
- echo $avatar_png_image_height;
- }
- echo ">";
- }
- ?></p></td><td bgcolor=#ffffff><p>
- <?php
- echo "<b>";
- readfile("data/members/active/{$_SESSION['logged_in']}/firstname.txt");
- echo " ";
- readfile("data/members/active/{$_SESSION['logged_in']}/lastname.txt");
- echo "</b>";
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/rank.txt") and file_exists("data/rank.txt")) {
- $rank = file_get_contents("data/members/active/{$_SESSION['logged_in']}/rank.txt");
- echo "<br>$rank";
- }
- elseif (!file_exists("data/members/active/{$_SESSION['logged_in']}/rank.txt") and file_exists("data/rank.txt")) {
- echo "<br>member";
- }
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/timestamp.txt")) {
- $joined = file_get_contents("data/members/active/{$_SESSION['logged_in']}/timestamp.txt");
- $joined_year = substr($joined,0,4);
- $joined_month = substr($joined,4,2);
- $joined_day = substr($joined,6,2);
- $joined_hh = substr($joined,8,2);
- $joined_mm = substr($joined,10,2);
- $member_since = date("d M Y H:i", mktime($joined_hh, $joined_mm, 0, $joined_month, $joined_day, $joined_year));
- echo "<p align=right>member since<code> $member_since </code>";
- }
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/bb-last.txt")) {
- $lastlog = file_get_contents("data/members/active/{$_SESSION['logged_in']}/bb-last.txt");
- $lastlog_year = substr($lastlog,0,4);
- $lastlog_month = substr($lastlog,4,2);
- $lastlog_day = substr($lastlog,6,2);
- $lastlog_hh = substr($lastlog,8,2);
- $lastlog_mm = substr($lastlog,10,2);
- $last_login = date("d M Y H:i", mktime($lastlog_hh, $lastlog_mm, 0, $lastlog_month, $lastlog_day, $lastlog_year));
- echo "<br>last login<code> $last_login </code>";
- }
- ?>
- </p></td></tr>
- <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- <input type=hidden name=edit value=on>
- <?php if (!file_exists("data/members/active/{$_SESSION['logged_in']}/key.txt")) { ?>
- <tr><td bgcolor=#ffffff><p>e-mail address*</p></td><td bgcolor=#ffffff colspan=2><input class=input type=text autocomplete=off name=email maxlength=60 value=<?php readfile("data/members/active/{$_SESSION['logged_in']}/email.txt"); ?>></td></tr>
- <?php } ?>
- <tr><td bgcolor=#ffffff><p>website</p></td><td bgcolor=#ffffff colspan=2><input class=input type=text autocomplete=off name=url maxlength=300 <?php if (file_exists("data/members/active/{$_SESSION['logged_in']}/url.txt")) { echo "value=";readfile("data/members/active/{$_SESSION['logged_in']}/url.txt"); } ?>></td></tr>
- <?php if (file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) { ?>
- <tr><td bgcolor=#ffffff><p>signature</p></td><td bgcolor=#ffffff colspan=2><textarea class=input name=sig><?php if (file_exists("data/members/active/{$_SESSION['logged_in']}/sig.txt")) {
- $get_sig = file_get_contents("data/members/active/{$_SESSION['logged_in']}/sig.txt");
- $get_sig = str_replace("<b>","[b]",$get_sig);
- $get_sig = str_replace("</b>","[/b]",$get_sig);
- $get_sig = str_replace("<i>","[i]",$get_sig);
- $get_sig = str_replace("</i>","[/i]",$get_sig);
- $get_sig = str_replace("<u>","[u]",$get_sig);
- $get_sig = str_replace("</u>","[/u]",$get_sig);
- $get_sig = str_replace("<sup>","[sup]",$get_sig);
- $get_sig = str_replace("</sup>","[/sup]",$get_sig);
- $get_sig = str_replace("<sub>","[sub]",$get_sig);
- $get_sig = str_replace("</sub>","[/sub]",$get_sig);
- $get_sig = str_replace("<strike>","[strike]",$get_sig);
- $get_sig = str_replace("</strike>","[/strike]",$get_sig);
- $get_sig = str_replace("<br>","\n",$get_sig);
- echo $get_sig;
- } ?></textarea></td></tr>
- <?php } ?>
- <tr><td bgcolor=#ffffff><p>upload avatar</p></td><td bgcolor=#ffffff colspan=2><input type=file autocomplete=off name=avatar></td></tr>
- <?php
- if (file_exists("images/members/{$_SESSION['logged_in']}/avatar.gif") or file_exists("images/members/{$_SESSION['logged_in']}/avatar.jpg") or file_exists("images/members/{$_SESSION['logged_in']}/avatar.png")) { ?>
- <tr><td bgcolor=#ffffff><p></p></td><td bgcolor=#ffffff colspan=2><p><input type=checkbox name=del_avatar>delete existing avatar</p></td></tr>
- <?php } if (file_exists("data/ml.txt") and !file_exists("data/members/active/{$_SESSION['logged_in']}/key.txt")) { ?>
- <tr><td bgcolor=#ffffff><p></p></td><td bgcolor=#ffffff colspan=2><p><input type=checkbox name=vacation <?php if (file_exists("data/members/active/{$_SESSION['logged_in']}/vacation.txt")) { echo checked; } ?>>temporarily disable mailing list subscription</p></td></tr>
- <?php } ?>
- <tr><td bgcolor=#ffffff><p>current password</p></td><td bgcolor=#ffffff colspan=2><input class=input type=password autocomplete=off name=current_passwd maxlength=30></td></tr>
- <tr><td bgcolor=#ffffff><p>new password</p></td><td bgcolor=#ffffff width=300><input class=input type=password autocomplete=off name=new_passwd maxlength=30></td></tr>
- <tr><td bgcolor=#ffffff><p>confirm password</p></td><td bgcolor=#ffffff><input class=input type=password autocomplete=off name=confirm_passwd maxlength=30></td></tr>
- <tr><td bgcolor=#ffffff><p></p></td><td bgcolor=#ffffff><input class=input type=submit value="click here to activate new settings"></td></tr>
- </form>
- <form enctype="multipart/form-data" action="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); ?>" method="post">
- <tr><td bgcolor=#ffffff><p></p></td><td bgcolor=#ffffff><input class=input type=submit value="click here to go to the index page"></td></tr>
- </form>
- </table>