<?php

if($debugMode == 1) { error_reporting(1); }else{ error_reporting(0); }
session_start();

####################################
#   EvilCMS WAS CREATED BY X1M!    #
####################################
# I DONT DEMAND THAT YOU KEEP THE  #
# COPYRIGHT IN THE FOOTER, BUT I   #
# DO DEMAND THAT THIS NOTE IS KEPT #
# IN THE SOURCE CODE. YOU CAN EDIT #
# HOWEVER THE FUCK YOU WANT, JUST  #
# KEEP THIS NOTE. YOU MAY NOT RELE #
# ASE AS YOUR OWN, THIS IS STILL   #
# MADE BY ME.                -X1M! #
####################################

/* This is the FIRST FLATFILE CMS in the WORLD with a working register outside the client. */

if(!isLoggedIn()) {
switch($_GET['step']) {
default:
?>
First step of registration, create your character!<br />
<div id="flashcontent" align="center">
<script>
var swfobj = new SWFObject("HabboRegistration.swf", "habboreg", "406", "327", "7");
swfobj.addParam("base", "");
swfobj.addParam("bgcolor", "#000000");
swfobj.addParam("color", "#ffffff");
swfobj.addVariable("post_url", "redirect.php?");
swfobj.addVariable("__app_key", "a5q0jBzgmZN5ZC036s");
swfobj.addVariable("figuredata_url", "figure.xml");
swfobj.addVariable("localization_url", "words.xml");
swfobj.addVariable("post_figure", "figureData");
swfobj.addVariable("post_gender", "newGender2");
swfobj.addVariable("figure", "1350218022803432751929510");
swfobj.addVariable("gender", "m");
swfobj.write("flashcontent");
</script>
</div>
<?php
break;
case "1":
?>
You've made your character, now what? Filling out ye details!<br />
<b>REMEMBER! THIS IS A RETRO! DO NOT GIVE OUT PERSONAL INFORMATION OR PASSWORDS YOU USE ON OTHER PLACES.</b>
<form method="post" action="?page=Register&step=3">
<!-- Retreiving the character details for future use. -->
<input type="hidden" name="gender" value="<?php print $_GET['newGender2']; ?>">
<input type="hidden" name="figure" value="<?php print base64_decode($_GET['figureData']); ?>">
Username: <input type="text" value="..." name="username"><br />
<em>NO SPECIAL CHARACTERS ALLOWED, ONLY NUMBERS AND LETTERS.</em><br />
Password: <input type="text" value="..." name="password"><br />
<em>Password is not hidden, so make sure you don't do any typos!</em><br />
Email: <input type="text" value="..." name="email"><br />
<em>No, we won't spam you, just enter a random email, not like we need it anyway.</em><br />
Date of Birth: <?php makeCountDropdown(1, 30, "day"); ?>&nbsp;<?php makeCountDropdown(1, 12, "month"); ?>&nbsp;<?php makeCountDropdown(1950, 1998, "year"); ?><br />
<input type="submit" value="Register!">
</form>
<?php
break;
case "3":
if(isset($_POST['gender']) && isset($_POST['username']) && isset($_POST['password']) && isset($_POST['figure']) && isset($_POST['email']) && isset($_POST['day']) && isset($_POST['month']) && isset($_POST['year'])) {
// $_POST['username'] = eregi_replace('[a-z]', '', $_POST['username']);
if(file_exists("Server/database/habbos/".$_POST['username'])) {
echo "Username already in use. ".$_POST['username'];
}else{
mkdir("Server/database/habbos/".$_POST['username']);
mkdir("Server/database/habbos/".$_POST['username']."/directmail");
editFile("Server/database/habbos/".$_POST['username']."/directmail/count.txt", 0);
setUserValue($_POST['username'], "name", $_POST['username']);
setUserValue($_POST['username'], "app", $_POST['figure']);
setUserValue($_POST['username'], "sex", $_POST['gender']);
setUserValue($_POST['username'], "birth", $_POST['day'].".".$_POST['month'].".".$_POST['year']);
setUserValue($_POST['username'], "email", $_POST['email']);
setUserValue($_POST['username'], "pass", $_POST['password']);
setUserValue($_POST['username'], "bank", file_get_contents("Server/database/new_habbo/bank.txt"));
setUserValue($_POST['username'], "rank", file_get_contents("Server/database/new_habbo/rank.txt"));
setUserValue($_POST['username'], "badgeonoff", file_get_contents("Server/database/new_habbo/badgeonoff.txt"));
setUserValue($_POST['username'], "badges", file_get_contents("Server/database/new_habbo/badges.txt"));
setUserValue($_POST['username'], "consolemission", file_get_contents("Server/database/new_habbo/consolemission.txt"));
setUserValue($_POST['username'], "credits", file_get_contents("Server/database/new_habbo/credits.txt"));
setUserValue($_POST['username'], "curbadge", file_get_contents("Server/database/new_habbo/curbadge.txt"));
setUserValue($_POST['username'], "favourites", file_get_contents("Server/database/new_habbo/favourites.txt"));
setUserValue($_POST['username'], "figure", file_get_contents("Server/database/new_habbo/figure.txt"));
setUserValue($_POST['username'], "friendlist", file_get_contents("Server/database/new_habbo/friendlist.txt"));
setUserValue($_POST['username'], "hand", file_get_contents("Server/database/new_habbo/hand.txt"));
setUserValue($_POST['username'], "hcdays", file_get_contents("Server/database/new_habbo/hcdays.txt"));
setUserValue($_POST['username'], "inquiries", file_get_contents("Server/database/new_habbo/inquiries.txt"));
setUserValue($_POST['username'], "lastonline", file_get_contents("Server/database/new_habbo/lastonline.txt"));
setUserValue($_POST['username'], "mission", file_get_contents("Server/database/new_habbo/mission.txt"));
setUserValue($_POST['username'], "periods", file_get_contents("Server/database/new_habbo/periods.txt"));
setUserValue($_POST['username'], "poolfigure", file_get_contents("Server/database/new_habbo/poolfigure.txt"));
setUserValue($_POST['username'], "roomlist", file_get_contents("Server/database/new_habbo/roomlist.txt"));
setUserValue($_POST['username'], "rooms", file_get_contents("Server/database/new_habbo/rooms.txt"));
setUserValue($_POST['username'], "showexpire", file_get_contents("Server/database/new_habbo/showexpire.txt"));
setUserValue($_POST['username'], "tickets", file_get_contents("Server/database/new_habbo/tickets.txt"));
setUserValue($_POST['username'], "film", file_get_contents("Server/database/new_habbo/film.txt"));
setUserValue($_POST['username'], "mondayRefill", file_get_contents("Server/database/new_habbo/mondayRefill.txt"));
setUserValue($_POST['username'], "num", file_get_contents("Server/database/habbos/count.txt") + 1);
editFile("Server/database/habbos/count.txt", file_get_contents("Server/database/habbos/count.txt") + 1);
$_SESSION['user'] = $_POST['username'];
echo '<meta http-equiv="Refresh" content="0; url=Index.php?page=Welcome">';
}
}else{
echo "You have to fill in your details first!";
}
break;
}
}else{
?>
You are already registered.
<?php
}
?>