1. <!DOCTYPE html>
  2. <html>
  3. <?php
  4. /**
  5. * Made by: MoltenX!!!
  6. * Please do not re-release without giving credits. If you do it I will be really really .... really...... really................................... sad! :(!
  7. */
  8. class reg
  9. {
  10. function __construct()
  11. {
  12. error_reporting(0);
  13. $this->config->db->host = "localhost"; //DB Host
  14. $this->config->db->user = "root"; //DB Username
  15. $this->config->db->pass = "ascent"; //DB Password
  16. $this->config->db->logon = "logon"; //Accounts DB Name
  17. $this->config->server->name = "Example Server"; //Server's Name
  18. $this->config->server->realmlist = "logon.example.com"; //Realmlist
  19. $this->config->emulator->type = "ArcEmu"; // Server's emulator
  20. /*
  21. List of emulators:
  22. -> ArcEmu !! Each version support it!
  23. -> TrinityCore !! Only Version 1.3+ support it!
  24. -> SkyFire [SOON]
  25. -> MaNGoS [SOON]
  26. -> ArkCore [SOON]
  27. */
  28. /* DON'T TOUCH ! */
  29. $this->loadHeader($this->config->server);
  30. $this->visitor->ip = $_SERVER['REMOTE_ADDR'];
  31. if ($this->checkIP($this->visitor->ip, $this->config->db, $this->config->emulator)) {
  32. $this->loadBody(false, false, true, false);
  33. } elseif (isset($_POST['login']) && isset($_POST['password']) && isset($_POST['email']) && isset($_POST['password2'])) {
  34. $this->loadBody(false, $_POST, false, $this->config);
  35. } else {
  36. $this->loadBody(true, false, false, $this->config->server);
  37. }
  38. }
  39. public function loadHeader($conf)
  40. {
  41. ?>
  42. <head>
  43. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  44. <title><?php echo $conf->name; ?></title>
  45. <style type="text/css">
  46. body {
  47. color: #fff;
  48. font-family: verdana;
  49. font-size: 15px;
  50. }
  51. #box {
  52. margin-top: 140px;
  53. width: 600px;
  54. height: 240px;
  55. border-radius: 17px;
  56. border: solid 1px #fff;
  57. background: #333333;
  58. background: -moz-linear-gradient(-45deg, #333333 0%, #1f1f1f 100%);
  59. background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#333333), color-stop(100%,#1f1f1f));
  60. background: -webkit-linear-gradient(-45deg, #333333 0%,#1f1f1f 100%);
  61. background: -o-linear-gradient(-45deg, #333333 0%,#1f1f1f 100%);
  62. background: -ms-linear-gradient(-45deg, #333333 0%,#1f1f1f 100%);
  63. background: linear-gradient(135deg, #333333 0%,#1f1f1f 100%);
  64. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#333333', endColorstr='#1f1f1f',GradientType=1 );
  65. padding-top: 30px;
  66. }
  67. #fbottom {
  68. margin-top: 40px;
  69. width: 600px;
  70. position: fixed;
  71. font-size: 17px;
  72. height: 30px;
  73. border-top: solid 1px #fff;
  74. }
  75. #button {
  76. transition: all 800ms;
  77. background: #939393;
  78. background: -moz-linear-gradient(left, #939393 0%, #727272 100%);
  79. background: -webkit-gradient(linear, left top, right top, color-stop(0%,#939393), color-stop(100%,#727272));
  80. background: -webkit-linear-gradient(left, #939393 0%,#727272 100%);
  81. background: -o-linear-gradient(left, #939393 0%,#727272 100%);
  82. background: -ms-linear-gradient(left, #939393 0%,#727272 100%);
  83. background: linear-gradient(to right, #939393 0%,#727272 100%);
  84. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#939393', endColorstr='#727272',GradientType=1 );
  85. border-radius: 7px;
  86. border: 1.5px solid #939393;
  87. }
  88. #button:hover {
  89. transition: all 800ms;
  90. border: 1.5px solid #3472C9;
  91. }
  92. #button:active {
  93. transition: all 800ms;
  94. background: #7f7f7f;
  95. background: -moz-linear-gradient(left, #7f7f7f 0%, #515151 100%);
  96. background: -webkit-gradient(linear, left top, right top, color-stop(0%,#7f7f7f), color-stop(100%,#515151));
  97. background: -webkit-linear-gradient(left, #7f7f7f 0%,#515151 100%);
  98. background: -o-linear-gradient(left, #7f7f7f 0%,#515151 100%);
  99. background: -ms-linear-gradient(left, #7f7f7f 0%,#515151 100%);
  100. background: linear-gradient(to right, #7f7f7f 0%,#515151 100%);
  101. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7f7f7f', endColorstr='#515151',GradientType=1 );
  102. }
  103. input {
  104. border-radius: 7px;
  105. width: 180px;
  106. padding: 5px;
  107. }
  108. input:focus {
  109. background: #7f7f7f;
  110. background: -moz-linear-gradient(left, #7f7f7f 0%, #515151 100%);
  111. background: -webkit-gradient(linear, left top, right top, color-stop(0%,#7f7f7f), color-stop(100%,#515151));
  112. background: -webkit-linear-gradient(left, #7f7f7f 0%,#515151 100%);
  113. background: -o-linear-gradient(left, #7f7f7f 0%,#515151 100%);
  114. background: -ms-linear-gradient(left, #7f7f7f 0%,#515151 100%);
  115. background: linear-gradient(to right, #7f7f7f 0%,#515151 100%);
  116. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7f7f7f', endColorstr='#515151',GradientType=1 );
  117. color: #fff;
  118. }
  119. #theme {
  120. bottom: 0;
  121. right: 0;
  122. position: fixed;
  123. height: 130px;
  124. width: 130px;
  125. background: -moz-linear-gradient(-45deg, rgba(0,0,0,0) 0%, rgba(158,158,158,0) 62%, rgba(255,255,255,0.65) 100%);
  126. background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(62%,rgba(158,158,158,0)), color-stop(100%,rgba(255,255,255,0.65)));
  127. background: -webkit-linear-gradient(-45deg, rgba(0,0,0,0) 0%,rgba(158,158,158,0) 62%,rgba(255,255,255,0.65) 100%);
  128. background: -o-linear-gradient(-45deg, rgba(0,0,0,0) 0%,rgba(158,158,158,0) 62%,rgba(255,255,255,0.65) 100%);
  129. background: -ms-linear-gradient(-45deg, rgba(0,0,0,0) 0%,rgba(158,158,158,0) 62%,rgba(255,255,255,0.65) 100%);
  130. background: linear-gradient(135deg, rgba(0,0,0,0) 0%,rgba(158,158,158,0) 62%,rgba(255,255,255,0.65) 100%);
  131. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#a6ffffff',GradientType=1 );
  132. }
  133. #theme1 {
  134. display: none;
  135. bottom: 0;
  136. left: 0;
  137. right: left;
  138. position: fixed;
  139. height: 130px;
  140. width: 130px;
  141. background: -moz-linear-gradient(45deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 44%, rgba(0,0,0,0) 100%);
  142. background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,rgba(0,0,0,0.65)), color-stop(44%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0)));
  143. background: -webkit-linear-gradient(45deg, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 44%,rgba(0,0,0,0) 100%);
  144. background: -o-linear-gradient(45deg, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 44%,rgba(0,0,0,0) 100%);
  145. background: -ms-linear-gradient(45deg, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 44%,rgba(0,0,0,0) 100%);
  146. background: linear-gradient(45deg, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 44%,rgba(0,0,0,0) 100%);
  147. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000',GradientType=1 );
  148. }
  149. </style>
  150. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
  151. </script>
  152. <script>
  153. $(document).ready(function(){
  154. $("#theme").click(function(){
  155. $("body").css({"background-color":"#CCCCCC", "transition":"all 800ms", "color":"#333333"});
  156. $("#theme").css({"display":"none", "transition":"all 800ms"});
  157. $("#theme1").css({"display":"block", "transition":"all 800ms"});
  158. $("#box").css({"background":"rgb(216,216,216)", "background":"-moz-linear-gradient(-45deg, rgb(216,216,216) 0%, rgba(255,255,255,1) 100%)", "border":"solid 1px #000", "background":"-webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(216,216,216,1)), color-stop(100%,rgba(255,255,255,1)))", "background":"-webkit-linear-gradient(-45deg, rgba(216,216,216,1) 0%,rgba(255,255,255,1) 100%)", "background":"-o-linear-gradient(-45deg, rgba(216,216,216,1) 0%,rgba(255,255,255,1) 100%)", "background":"-ms-linear-gradient(-45deg, rgba(216,216,216,1) 0%,rgba(255,255,255,1) 100%)", "background":"linear-gradient(135deg, rgba(216,216,216,1) 0%,rgba(255,255,255,1) 100%)", "filter":"progid:DXImageTransform.Microsoft.gradient( startColorstr='#d8d8d8', endColorstr='#ffffff',GradientType=1 )"});
  159. $("#fbottom").css("border-top","solid 1px #000");
  160. });
  161. $("#theme1").click(function(){
  162. $("body").css({"background-color":"#333333", "transition":"all 800ms", "color":"#CCCCCC"});
  163. $("#theme").css({"display":"block", "transition":"all 800ms"});
  164. $("#theme1").css({"display":"none", "transition":"all 800ms"});
  165. $("#fbottom").css("border-top","solid 1px #fff");
  166. $("#box").css({"background":"#333333", "background":"-moz-linear-gradient(-45deg, #333333 0%, #1f1f1f 100%)", "border":"solid 1px #000", "border":"solid 1px #fff", "background":"-webkit-gradient(linear, left top, right bottom, color-stop(0%,#333333), color-stop(100%,#1f1f1f))", "background":"-webkit-linear-gradient(-45deg, #333333 0%,#1f1f1f 100%)", "background":"-o-linear-gradient(-45deg, #333333 0%,#1f1f1f 100%)", "background":"-ms-linear-gradient(-45deg, #333333 0%,#1f1f1f 100%)", "background":"linear-gradient(135deg, #333333 0%,#1f1f1f 100%)", "filter":"progid:DXImageTransform.Microsoft.gradient( startColorstr='#333333', endColorstr='#1f1f1f',GradientType=1 )"});
  167. });
  168. });
  169. </script>
  170. </head>
  171. <body style="background-color:#333333; color:#CCCCCC;">
  172. <?php
  173. }
  174. public function loadBody($form, $reg, $ipcheck, $conf)
  175. {
  176. if ($ipcheck) {
  177. print("<center><h3 id='box'>You are already registered! Don't try to re-register!</h3></center><div id='theme'></div>
  178. <div id='theme1'></div>");
  179. $this->loadFooter();
  180. return false;
  181. }
  182. elseif ($form)
  183. {
  184. $this->form($conf);
  185. $this->loadFooter();
  186. return false;
  187. }
  188. elseif ($reg)
  189. {
  190. $this->username = $this->clean($reg['login']);
  191. $this->password = $this->clean($reg['password']);
  192. $this->password2 = $this->clean($reg['password2']);
  193. $this->email = $this->clean($reg['email']);
  194. if ($this->password !== $this->password2) {
  195. echo "<center><h3 id='box'>The passwords doesn't match!<br /><a href='./'>Try again &rarr;</a></h3></center><div id='theme'></div>
  196. <div id='theme1'></div>";
  197. return false;
  198. }
  199. mysql_connect($conf->db->host, $conf->db->user, $conf->db->pass);
  200. mysql_select_db($conf->db->logon);
  201. $chck = mysql_query("SELECT * FROM accounts WHERE username = '{$this->username}' OR email = '{$this->email}'");
  202. if (mysql_num_rows($chck) >= 1) {
  203. print("<center><h3 id='box'>Ther is already a user with same username or same email!</h3></center><div id='theme'></div>
  204. <div id='theme1'></div>");
  205. $this->loadFooter();
  206. return false;
  207. }
  208. else
  209. {
  210. switch ($conf->emulator->type) {
  211. case 'ArcEmu':
  212. mysql_query("INSERT INTO accounts (login, password, email) VALUES ('{$this->username}', '{$this->password}', '{$this->email}');") or die("<center><h3 id='box'>There was an error : ".mysql_error()."</h3></center>");
  213. break;
  214. case 'TrinityCore':
  215. $this->new->password = sha1($this->username.':'.$this->password);
  216. mysql_query("INSERT INTO account (username, sha_pass_hash, email) VALUES ('{$this->username}', '{$this->new->password}', '{$this->email}'") or die("<center><h3 id='box'>There was an error : ".mysql_error()."</h3></center>");
  217. break;
  218. default:
  219. die("Wrong emultor specified!");
  220. break;
  221. }
  222. echo "<center><h3 id='box'>Congratulations! You can set your realmlist to:<br />set realmlist '{$conf->server->realmlist}'</h3></center>
  223. <div id='theme'></div>
  224. <div id='theme1'></div>";
  225. $this->loadFooter();
  226. }
  227. }
  228. }
  229. public function loadFooter()
  230. {
  231. ?>
  232. </body>
  233. </html>
  234. <?php
  235. }
  236. public function form($conf)
  237. {
  238. ?>
  239. <center>
  240. <form method="post" id='box'>
  241. <table>
  242. <tr><td><label for='login'>Username :</label></td><td><input name="login" type="text" style="border:none; background-color:#CCCCCC;" placeholder='Username' required/></td></tr><tr></tr><tr></tr>
  243. <tr><td><label for ='password'>Password :</label></td><td><input name="password" type="password" style="border:none;background-color:#CCCCCC;" placeholder='Password' required/></td></tr><tr></tr><tr></tr>
  244. <tr><td><label for ='password'>Password :</label></td><td><input name="password2" type="password" style="border:none;background-color:#CCCCCC;" placeholder='Repeat password' required/></td></tr><tr></tr><tr></tr>
  245. <tr><td><label for='email'>Email :</label></td><td><input name="email" type="email" style="border:none;background-color:#CCCCCC;" placeholder='[email protected]' required/></td></tr><tr></tr><tr></tr>
  246. <tr><td colspan="2" align="center"><input type="submit" id='button' value="Register &rarr;" /></td></tr>
  247. </table>
  248. <div id='fbottom'><center>set realmlist <?php echo $conf->realmlist; ?></center></div>
  249. </form>
  250. </center>
  251. <div id='theme'></div>
  252. <div id='theme1'></div>
  253. <?php
  254. }
  255. public function checkIP($ip, $conf, $emu)
  256. {
  257. mysql_connect($conf->host, $conf->user, $conf->pass);
  258. mysql_select_db($conf->logon);
  259. switch ($emu->type) {
  260. case 'ArcEmu':
  261. $get = mysql_query("SELECT * FROM accounts WHERE lastip = '{$ip}';");
  262. break;
  263. case 'TrinityCore':
  264. $get = mysql_query("SELECT * FROM account WHERE last_ip = '{$ip}';");
  265. break;
  266. default:
  267. die("Wrong emulator specified!");
  268. break;
  269. }
  270. if(mysql_num_rows($get) >= 1)
  271. {
  272. $this->return = true;
  273. return $this->return;
  274. }
  275. else
  276. {
  277. $this->return = false;
  278. return $this->return;
  279. }
  280. }
  281. public function clean($string)
  282. {
  283. $this->ret = mysql_real_escape_string(htmlspecialchars($string));
  284. return $tihs->ret;
  285. }
  286. }
  287. $reg = new reg;
  288. /*
  289. GOOD LUCK IN USING IT !!!
  290. */
  291. ?>

Version 1.3.2 << Some changes in the theme changer!