Advertisement
Guest User

Untitled

a guest
Aug 8th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.63 KB | None | 0 0
  1. <?php
  2. include("connector.php");
  3. include("functions.php");
  4. errorheader("Kristall-Panel RC2 - Installer");
  5. if(isset($_GET["act"]))
  6. {
  7. switch($_GET["act"])
  8. {
  9. case "config":
  10. echo("Welcome to the installation for Kristall-Panel RC2.<br /><br />First, we need to collect your MySQL database information, please enter it into the boxes provided below:<hr>
  11. <form action=\"installer.php?act=doconfig\" method=\"post\">
  12. MySQL Username:<br />
  13. <input type=\"text\" name=\"username\" size=\"28\"><br /><br />
  14. MySQL Database:<br />
  15. <input type=\"text\" name=\"database\" size=\"28\"><br /><br />
  16. MySQL Password:<br />
  17. <input type=\"text\" name=\"password\" size=\"28\"><br /><br />
  18. <input type=\"submit\" value=\"Click to Continue\">");
  19. break;
  20.  
  21. case "doconfig":
  22. echo("Now attempting connection to the server<hr>");
  23. @mysql_connect("localhost", $_POST["username"], $_POST["password"])
  24. or exit("Connection failed, please click back and try again.");
  25. echo("MySQL connection success!<hr>Attempting to connect to the database: {$_POST["database"]}<hr>");
  26. @mysql_select_db($_POST["database"])
  27. or exit("Connection failed, please click back and try again.");
  28. echo("MySQL Database selection success<hr>Attempting to write new configuration details to the configuration file<hr>");
  29. $file = "connector.php";
  30. $connection = @fopen($file, "w")
  31. or exit("Could not open file connector.php, or could not truncate the file to 0 length - Please chmod connector.php to 0666 (or 0777) then reload this page!");
  32. echo("Connector file opened and truncated successfully<hr>Now attempting to write new connection details<hr>");
  33. $configfile = "<?php
  34. \$hostname = (\"localhost\");
  35. \$database = (\"{$_POST["database"]}\");
  36. \$username = (\"{$_POST["username"]}\");
  37. \$password = (\"{$_POST["password"]}\");
  38. @mysql_connect(\$hostname, \$username, \$password)
  39. or exit(\"MySQL Connection Error\");
  40. @mysql_selectdb(\$database)
  41. or exit(\"MySQL Database Selection Error, please check your details!\");
  42. ?>";
  43. @fwrite($connection, $configfile)
  44. or exit("Could not write information to connector.php");
  45. echo("Wrote information successfully!<hr>Now closing file<hr>");
  46. @fclose($connection)
  47. or exit("Could not close connector.php");
  48. echo("Connector file closed successfully<hr>Click <a href=\"?act=details\">here</a> to continue");
  49.  
  50. break;
  51.  
  52. case "details":
  53. echo("Great, you've now made the connector file, it's time to get your configuration details. Please enter them into the boxes provided below!<hr>
  54. <form action=\"?act=doinstall\" method=\"post\">
  55. Your Super Administrator Username:<br />
  56. <input type=\"text\" name=\"username\" size=\"28\"><br /><br />
  57. Your Super Administrator Password:<br />
  58. <input type=\"text\" name=\"spassword\" size=\"28\"><br /><br />
  59. <input type=\"submit\" value=\"Submit details and finish installation\">");
  60. break;
  61.  
  62. case "doinstall":
  63. echo("Your super administrator details are:<br />
  64. <b>Username:</b> {$_POST["username"]}<br />
  65. <b>Password:</b> {$_POST["spassword"]}<hr>Now creating the MySQL Tables.");
  66. mysql_query("CREATE TABLE `radioinfo` (
  67. `ip` text NOT NULL,
  68. `port` text NOT NULL,
  69. `pass` text NOT NULL
  70. ) ENGINE=MyISAM ;");
  71. mysql_query("CREATE TABLE `requests` (
  72. `id` int(10) NOT NULL auto_increment,
  73. `sender` text NOT NULL,
  74. `dj` text NOT NULL,
  75. `type` text NOT NULL,
  76. `message` text NOT NULL,
  77. `date` text NOT NULL,
  78. `ip` text NOT NULL,
  79. `reported` varchar(1) NOT NULL default '0',
  80. PRIMARY KEY (`id`)
  81. ) ENGINE=MyISAM ;");
  82. mysql_query("CREATE TABLE `djsays` (
  83. `username` text NOT NULL,
  84. `shoutout` text NOT NULL
  85. ) ENGINE=MyISAM ;");
  86. mysql_query("CREATE TABLE `settings` (
  87. `sitename` text NOT NULL,
  88. `totalwarnings` text NOT NULL,
  89. `filter` text NOT NULL,
  90. `welcome` text NOT NULL,
  91. `bbcode` varchar(3) NOT NULL,
  92. `haslogged` text NOT NULL
  93. ) ENGINE=MyISAM ;");
  94. mysql_query("CREATE TABLE `shoutbox` (
  95. `id` int(10) NOT NULL auto_increment,
  96. `name` text NOT NULL,
  97. `message` text NOT NULL,
  98. `ip` varchar(15) NOT NULL,
  99. `date` text NOT NULL,
  100. PRIMARY KEY (`id`)
  101. ) ENGINE=MyISAM ;");
  102. mysql_query("CREATE TABLE `pm` (
  103. `id` int(10) NOT NULL auto_increment,
  104. `to` text NOT NULL,
  105. `from` text NOT NULL,
  106. `date` text NOT NULL,
  107. `subject` text NOT NULL,
  108. `message` text NOT NULL,
  109. `reported` varchar(1) NOT NULL default '0',
  110. `read` varchar(1) NOT NULL default '0',
  111. PRIMARY KEY (`id`)
  112. ) ENGINE=MyISAM ;");
  113. mysql_query("CREATE TABLE `timetable` (
  114. `day` text NOT NULL,
  115. `1` text NOT NULL,
  116. `2` text NOT NULL,
  117. `3` text NOT NULL,
  118. `4` text NOT NULL,
  119. `5` text NOT NULL,
  120. `6` text NOT NULL,
  121. `7` text NOT NULL,
  122. `8` text NOT NULL,
  123. `9` text NOT NULL,
  124. `10` text NOT NULL,
  125. `11` text NOT NULL,
  126. `12` text NOT NULL,
  127. `13` text NOT NULL,
  128. `14` text NOT NULL,
  129. `15` text NOT NULL,
  130. `16` text NOT NULL,
  131. `17` text NOT NULL,
  132. `18` text NOT NULL,
  133. `19` text NOT NULL,
  134. `20` text NOT NULL,
  135. `21` text NOT NULL,
  136. `22` text NOT NULL,
  137. `23` text NOT NULL,
  138. `24` text NOT NULL
  139. ) ENGINE=MyISAM;");
  140. mysql_query("
  141. CREATE TABLE `logs` (
  142. `id` int(10) NOT NULL auto_increment,
  143. `name` text NOT NULL,
  144. `date` text NOT NULL,
  145. `ip` text NOT NULL,
  146. `success` text NOT NULL,
  147. PRIMARY KEY (`id`)
  148. ) ENGINE=MyISAM;");
  149. mysql_query("CREATE TABLE `users` (
  150. `id` int(10) NOT NULL auto_increment,
  151. `username` text NOT NULL,
  152. `password` text NOT NULL,
  153. `level` varchar(19) NOT NULL,
  154. `skype` text NOT NULL,
  155. `msn` text NOT NULL,
  156. `warning` varchar(1) NOT NULL default '0',
  157. `ban` varchar(3) NOT NULL default 'No',
  158. `pin` int(4) NOT NULL,
  159. PRIMARY KEY (`id`)
  160. ) ENGINE=MyISAM ;");
  161. echo("MySQL Tables Created Successfully!<hr>Now moving onto inserting data into tables.");
  162. $username = clean($_POST["username"], "nofilter");
  163. $username = strtolower($username);
  164. $username = ucfirst($username);
  165. $password = clean($_POST["spassword"], "nofilter");
  166. $password = encrypt($password);
  167. mysql_query("INSERT INTO `djsays` VALUES ('Admin', 'Welcome to Kristall-Panel RC2!');");
  168. mysql_query("INSERT INTO `radioinfo` VALUES ('127.0.0.1', '8000', 'Default');");
  169. mysql_query("INSERT INTO `settings` VALUES ('Kristall-Panel RC2', '3', 'fuck;shit;wank;cunt;bitch;piss;meatspin;gnaa;lemonparty;nigger;nigga;asshole;dick;faggot;twat', 'Welcome to the default installation of Kristall-Panel, feel free to navigate into the Administration section then click System Settings<br />\r\n<br />\r\n<b>Kristall-Panel RC2 - www.kristall-services.com</b><br />\r\n<br />\r\nFeel free to get in touch with me on msn:<br />\r\n<b>dan@kristall-services.com</b><br />\r\n<br />\r\nOther methods of contact:<br />\r\n<br />\r\n<b>Voj</b> - Habbo Hotel UK<br />\r\n<b>Lolcopters</b> - HabboxForum.com<br />\r\n-----------<br />\r\n<br />\r\n<br />\r\nAlso, if you''d be so kind, please leave the powered by kristall-panel on the login page, gets me a small amount of advertisement, you don''t pay anything so it only seems fair :)', 'Yes', 'notlogged');");
  170. mysql_query("INSERT INTO `shoutbox` VALUES (2, '<span style=\"color: #941515\"><strong>Admin</strong></span>', 'Welcome to Kristall-Panel RC2!', '127.0.0.1', '1175747012');");
  171. mysql_query("INSERT INTO `timetable` VALUES ('Monday', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');");
  172. mysql_query("INSERT INTO `timetable` VALUES ('Tuesday', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');");
  173. mysql_query("INSERT INTO `timetable` VALUES ('Wednesday', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');");
  174. mysql_query("INSERT INTO `timetable` VALUES ('Thursday', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');");
  175. mysql_query("INSERT INTO `timetable` VALUES ('Friday', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');");
  176. mysql_query("INSERT INTO `timetable` VALUES ('Saturday', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');");
  177. mysql_query("INSERT INTO `timetable` VALUES ('Sunday', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');");
  178. mysql_query("INSERT INTO `users` VALUES (1, '$username', '$password', 'Super Administrator', 'lolcopters', 'iH@e.spam', '0', 'No', '0');");
  179. echo("<hr>MySQL queries completed, the panel is installed!<hr>Now attempting to DELETE installer.php");
  180. @unlink("installer.php")
  181. or exit("Could not remove installer.php, please delete this file manually!");
  182. echo("<hr>File removed successfully!<hr>Your panel is now 100% installed, please click <a href=\"index.php\">here</a> to login!");
  183.  
  184.  
  185. break;
  186.  
  187. default:
  188. echo("Welcome!<br />Please click <a href=\"?act=config\">here</a> to continue!");
  189. break;
  190. }
  191. }
  192. elseif($username != "default" && !isset($_GET["act"]))
  193. {
  194. echo("Sorry, the installer has detected that this panel has already been installed (Config file is not default) and installation will not continue, now attempting to delete installer.php<hr>");
  195. @unlink("installer.php")
  196. or exit("Could not remove installer.php, please delete this file manually!");
  197. echo("File deleted.");
  198. }
  199. elseif($username != "default")
  200. {
  201. echo("Sorry, the installer has detected that this panel has already been installed (Config file is not default) and installation will not continue, now attempting to delete installer.php<hr>");
  202. @unlink("installer.php")
  203. or exit("Could not remove installer.php, please delete this file manually!");
  204. echo("File deleted.");
  205. }
  206. else
  207. {
  208. echo("Click <a href=\"?act\">here</s> to start the installation.");
  209. }
  210. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement