Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.57 KB | None | 0 0
  1. <?php
  2.  
  3. // #########################################################
  4. // # Clan Infinity Redux V1.0 #
  5. // #########################################################
  6. // # #
  7. // # This script is copywrited by Reflux Coding Inc. #
  8. // # any attempt to modify or use this code without proper #
  9. // # authorization will be considered an infringement of #
  10. // # our copywrite and legal action will be pursued to #
  11. // # the fullest extent possible. #
  12. // # #
  13. // # This script was created by: #
  14. // # #
  15. // # Reflux Coding & Josh Emilson A.K.A. Whitepyro #
  16. // # http://www.refluxcoding.com #
  17. // # #
  18. // # This and many other fine scripts are available at #
  19. // # the above website or by emailing the author at #
  20. // # webmaster@refluxcoding.com #
  21. // #########################################################
  22.  
  23. error_reporting(E_ALL);
  24.  
  25. $File_Path = dirname(__FILE__);
  26. if(stristr($_SERVER["SERVER_SOFTWARE"], 'WIN')) { $data = explode("\\",$File_Path); }
  27. else { $data = explode("/",$File_Path); }
  28. $count = count($data) - 2;
  29. $File_Path = "";
  30. for($I = 0; $I <= $count; $I++) {
  31. if(!stristr($_SERVER["SERVER_SOFTWARE"], 'WIN')) { $File_Path .= $data[$I] ."/"; }
  32. else { $File_Path .= $data[$I] ."/"; }
  33. } // End for($I = 0; $I <= $count; $I++)
  34.  
  35. if(file_exists($File_Path."include/rclib.php")) { include($File_Path."include/rclib.php"); }
  36. elseif(!file_exists($File_Path."include/rclib.php")) { echo ("<div align=\"center\">".$File_Path."include/rclib.php is missing</div>"); }
  37.  
  38. if(file_exists("$File_Path/MySqlDB.php")) {
  39. include("$File_Path/MySqlDB.php");
  40. GetAdvancedVariables();
  41. GetVariables();
  42. } // End if(file_exists("$File_Path/MySqlDB.php"))
  43.  
  44.  
  45. if(isset($_REQUEST['goto'])) { $Goto = $_REQUEST['goto']; }
  46. elseif(!isset($_REQUEST['goto'])) { $Goto = ""; }
  47. $Goto = htmlspecialchars("$Goto", ENT_QUOTES);
  48. $Goto = strtolower($Goto);
  49.  
  50. if($Goto == "" && !file_exists($File_Path."/MySqlDB.php")) { SetupVariables(); }
  51. elseif($Goto == "finish setup" && !file_exists("$File_Path/MySqlDB.php")) { CNSI(); }
  52. elseif($Goto == "finish confirmed setup" && !file_exists("$File_Path/MySqlDB.php")) { TestMySql(); }
  53. elseif(($Goto == "finish setup")||($Goto == "finish confirmed setup") && file_exists("$File_Path/MySqlDB.php")) { Logon(); }
  54. elseif($Goto == "" && file_exists("$File_Path/MySqlDB.php")) { Logon(); }
  55. else { Illegal(); }
  56.  
  57. function SetupVariables() {
  58. global $Message,$Goto,$File_Path,$Questions;
  59. Heads();
  60. $OPT_FPQ = array();
  61. $structure = $_SERVER["PHP_SELF"];
  62. $structure = str_replace("/admin/admin.php","", "$structure");
  63. if(isset($_REQUEST['VAR_SITENAME'])) { $VAR_SITENAME = $_REQUEST['VAR_SITENAME']; }
  64. elseif(!isset($_REQUEST['VAR_SITENAME'])) { $VAR_SITENAME = ""; }
  65. if(isset($_REQUEST['VAR_SU'])) { $VAR_SU = $_REQUEST['VAR_SU']; }
  66. elseif(!isset($_REQUEST['VAR_SU'])) { $VAR_SU = "http://".$_SERVER["HTTP_HOST"]; }
  67. if(isset($_REQUEST['VAR_SUI'])) { $VAR_SUI = $_REQUEST['VAR_SUI']; }
  68. elseif(!isset($_REQUEST['VAR_SUI'])) { $VAR_SUI = "$VAR_SU$structure/images"; }
  69. if(isset($_REQUEST['VAR_AE'])) { $VAR_AE = $_REQUEST['VAR_AE']; }
  70. elseif(!isset($_REQUEST['VAR_AE'])) { $VAR_AE = ""; }
  71. if(!isset($_REQUEST['VAR_MYSQLHOST'])) { $VAR_MYSQLHOST = ""; }
  72. elseif(isset($_REQUEST['VAR_MYSQLHOST'])) { $VAR_MYSQLHOST = $_REQUEST['VAR_MYSQLHOST']; }
  73. if(!isset($_REQUEST['VAR_MYSQLUSER'])) { $VAR_MYSQLUSER = ""; }
  74. elseif(isset($_REQUEST['VAR_MYSQLUSER'])) { $VAR_MYSQLUSER = $_REQUEST['VAR_MYSQLUSER']; }
  75. if(!isset($_REQUEST['VAR_MYSQLPASS'])) { $VAR_MYSQLPASS = ""; }
  76. elseif(isset($_REQUEST['VAR_MYSQLPASS'])) { $VAR_MYSQLPASS = $_REQUEST['VAR_MYSQLPASS']; }
  77. if(!isset($_REQUEST['VAR_MYSQLDB'])) { $VAR_MYSQLDB = ""; }
  78. elseif(isset($_REQUEST['VAR_MYSQLDB'])) { $VAR_MYSQLDB = $_REQUEST['VAR_MYSQLDB']; }
  79. if(!isset($_REQUEST['VAR_LOGIN'])) { $VAR_LOGIN = ""; }
  80. elseif(isset($_REQUEST['VAR_LOGIN'])) { $VAR_LOGIN = $_REQUEST['VAR_LOGIN']; }
  81. if(!isset($_REQUEST['VAR_FPA'])) { $VAR_FPA = ""; }
  82. elseif(isset($_REQUEST['VAR_FPA'])) { $VAR_FPA = $_REQUEST['VAR_FPA']; }
  83. if(!isset($_REQUEST['OPT_FPQ'])) { $OPT_FPQ = ""; }
  84. elseif(isset($_REQUEST['OPT_FPQ'])) { $OPT_FPQ = $_REQUEST['OPT_FPQ']; }
  85. if(!isset($_REQUEST['VAR_NAME'])) { $VAR_NAME = ""; }
  86. elseif(isset($_REQUEST['VAR_NAME'])) { $VAR_NAME = $_REQUEST['VAR_NAME']; }
  87. if(!isset($_REQUEST['VAR_LOGIN'])) { $VAR_LOGIN = ""; }
  88. elseif(isset($_REQUEST['VAR_LOGIN'])) { $VAR_LOGIN = $_REQUEST['VAR_LOGIN']; }
  89. $OPT_FPQA = "";
  90. GetQuestions();
  91. foreach($Questions as $key => $val) {
  92. if($OPT_FPQ == $val) { $OPT_FPQA .= GetOption("$val","$val","1","0"); }
  93. elseif($OPT_FPQ != $val) { $OPT_FPQA .= GetOption("$val","$val","0","0"); }
  94. } // End foreach($Choice as $key => $val)
  95. $tpl = new FetchTemplate();
  96. $tpl->set('SELF', $_SERVER['PHP_SELF']);
  97. $tpl->set('REQMETH', "post");
  98. $tpl->set('VAR_SITENAME', "$VAR_SITENAME");
  99. $tpl->set('VAR_SU', "$VAR_SU");
  100. $tpl->set('VAR_SUI', "$VAR_SUI");
  101. $tpl->set('VAR_AE', "$VAR_AE");
  102. $tpl->set('VAR_MYSQLHOST', "$VAR_MYSQLHOST");
  103. $tpl->set('VAR_MYSQLUSER', "$VAR_MYSQLUSER");
  104. $tpl->set('VAR_MYSQLPASS', "$VAR_MYSQLPASS");
  105. $tpl->set('VAR_MYSQLDB', "$VAR_MYSQLDB");
  106. $tpl->set('VAR_NAME', "$VAR_NAME");
  107. $tpl->set('VAR_LOGIN', "$VAR_LOGIN");
  108. $tpl->set('OPT_FPQ', "$OPT_FPQA");
  109. $tpl->set('VAR_FPA', "$VAR_FPA");
  110. echo $tpl->fetch($File_Path."templates/admin/common/_template_common_setupform.thtml");
  111. $tpl = new FetchTemplate();
  112. $tpl->set('CODE', "");
  113. $tpl->set('HIDDENINPUT', "");
  114. $tpl->set('SUBMIT', "Finish Setup");
  115. echo $tpl->fetch($File_Path."templates/admin/common/_template_common_submit.thtml");
  116. Foot();
  117. exit;
  118. } // End function SetupVariables()
  119.  
  120. function CNSI() {
  121. global $Message,$Questions,$Goto;
  122. $ErrorCheck = 0;
  123. $_SITENAME = $_REQUEST['VAR_SITENAME'];
  124. $_SITENAME = htmlspecialchars("$_SITENAME", ENT_QUOTES);
  125. $_SITEURL = $_REQUEST['VAR_SU'];
  126. $_SITEURL = htmlspecialchars("$_SITEURL", ENT_QUOTES);
  127. $_SITEIMG = $_REQUEST['VAR_SUI'];
  128. $_SITEIMG = htmlspecialchars("$_SITEIMG", ENT_QUOTES);
  129. $_EMAIL = $_REQUEST['VAR_AE'];
  130. $_EMAIL = htmlspecialchars("$_EMAIL", ENT_QUOTES);
  131. $_MYSQLHOST = $_REQUEST['VAR_MYSQLHOST'];
  132. $_MYSQLHOST = htmlspecialchars("$_MYSQLHOST", ENT_QUOTES);
  133. $_MYSQLUSER = $_REQUEST['VAR_MYSQLUSER'];
  134. $_MYSQLUSER = htmlspecialchars("$_MYSQLUSER", ENT_QUOTES);
  135. $_MYSQLPASSWORD = $_REQUEST['VAR_MYSQLPASS'];
  136. $_MYSQLPASSWORD = htmlspecialchars("$_MYSQLPASSWORD", ENT_QUOTES);
  137. $_MYSQLDB = $_REQUEST['VAR_MYSQLDB'];
  138. $_MYSQLDB = htmlspecialchars("$_MYSQLDB", ENT_QUOTES);
  139. $_NAME = $_REQUEST['VAR_NAME'];
  140. $_NAME = htmlspecialchars("$_NAME", ENT_QUOTES);
  141. $_LOGIN = $_REQUEST['VAR_LOGIN'];
  142. $_LOGIN = htmlspecialchars("$_LOGIN", ENT_QUOTES);
  143. $_PASSWORD = $_REQUEST['VAR_PASSWORD'];
  144. $_PASSWORD = htmlspecialchars("$_PASSWORD", ENT_QUOTES);
  145. if($Goto == "finish setup") {
  146. $_PASSWORD2 = $_REQUEST['VAR_PASSWORD2'];
  147. $_PASSWORD2 = htmlspecialchars("$_PASSWORD2", ENT_QUOTES);
  148. } // End if($Goto == "finish setup")
  149. $_FORGOTPASSQ = $_REQUEST['OPT_FPQ'];
  150. $_FORGOTPASSQ = htmlspecialchars("$_FORGOTPASSQ", ENT_QUOTES);
  151. $_FORGOTPASSA = $_REQUEST['VAR_FPA'];
  152. $_FORGOTPASSA = htmlspecialchars("$_FORGOTPASSA", ENT_QUOTES);
  153. $_OPTFPQ = 0;
  154. GetQuestions();
  155. foreach($Questions as $key => $val) {
  156. if($_FORGOTPASSQ == $val) { $_OPTFPQ = 1; }
  157. } // End foreach($Choice as $key => $val)
  158. $Error = new Errors();
  159. if($_SITENAME == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Site Name","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  160. elseif(!preg_match('/^([[:alpha:][:digit:][:blank:]\x27[\x27\x2E])*$/ix', $_SITENAME)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","Site Name","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
  161. elseif(($_SITEURL == "")||($_SITEURL == "http://")) { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Site URL","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  162. elseif(!preg_match('%^((http:/\/{0,4})+[\x3A]{0,1}+[\x2F]{0,2})\blocalhost+?(([/])+([\w])*)*$%ix', $_SITEURL) && !preg_match('%^((http:/\/{0,4})+[\x3A]{0,1}+[\x2F]{0,2})((?=[\w\W-]{1,63}\.)(xn--)?[\w]+(-[\w]+)*\.)+([\w]{2,8})*+(([/])+([\w])*)*$%ix', $_SITEURL)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","Site URL","6")); SetupVariables("$Message"); $ErrorCheck = 1; }
  163. elseif(($_SITEIMG == "")||($_SITEIMG == "http://")) { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Images Folder URL","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  164. elseif(!preg_match('%^((http:/\/{0,4})+[\x3A]{0,1}+[\x2F]{0,2})\blocalhost+?(([/])+([\w])*)*$%ix', $_SITEIMG) && !preg_match('%^((http:/\/{0,4})+[\x3A]{0,1}+[\x2F]{0,2})((?=[\w\W-]{1,63}\.)(xn--)?[\w]+(-[\w]+)*\.)+([\w]{2,8})*+(([/])+([\w])*)*$%ix', $_SITEIMG)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","Images Folder URL","6")); SetupVariables("$Message"); $ErrorCheck = 1; }
  165. elseif($_EMAIL == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","E-mail Address","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  166. elseif(!preg_match('/^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i', $_EMAIL)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","E-mail Address","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  167. elseif($_MYSQLHOST == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","MySQL Host","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  168. elseif(!preg_match('/^localhost*+(([:])+([[:digit:]])*)*$/ix', $_MYSQLHOST) && !preg_match('/^((?=[\w\W-]{3,63}\.)(xn--)?[\w]+(-[\w]+)*\.)+([\w]{2,5})*+(([:])+([[:digit:]])*)*$/ix', $_MYSQLHOST)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","MySQL Host","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  169. elseif($_MYSQLUSER == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","MySQL Username","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  170. elseif(!preg_match('/^([[:alpha:][:digit:]\.])*$/ix', $_MYSQLUSER)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","MySQL Username","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
  171. elseif(!preg_match('/^([[:alpha:][:digit:]\.]){0,25}$/ix', $_MYSQLUSER)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","MySQL Username","8")); SetupVariables("$Message"); $ErrorCheck = 1; }
  172. elseif($_MYSQLPASSWORD == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","MySQL Password","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  173. elseif(!preg_match('/^([[:alpha:][:digit:]\.])*$/ix', $_MYSQLPASSWORD)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","MySQL Password","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
  174. elseif(!preg_match('/^([[:alpha:][:digit:]\.]){0,30}$/ix', $_MYSQLPASSWORD)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","MySQL Password","8")); SetupVariables("$Message"); $ErrorCheck = 1; }
  175. elseif($_MYSQLDB == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","MySQL Database","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  176. elseif(!preg_match('/^([(\w).])*$/ix', $_MYSQLDB)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","MySQL Database","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
  177. elseif($_NAME == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Full Name","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  178. elseif(!preg_match('/([[:alpha:][:digit:][:blank:]\x27[\x27\x2E])*$/ix', $_NAME)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","Full Name","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
  179. elseif($_LOGIN == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Admin Login","7")); SetupVariables("$Message"); $ErrorCheck = 1; }
  180. elseif(!preg_match('/^([[:alpha:][:digit:]\.])*$/ix', $_LOGIN)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","Admin Login","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
  181. elseif(!preg_match('/^([[:alpha:][:digit:]\.]){0,25}$/ix', $_LOGIN)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","Admin Login","8")); SetupVariables("$Message"); $ErrorCheck = 1; }
  182. elseif($_PASSWORD == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Admin Password","7")); SetupVariables("$Message"); $ErrorCheck = 1; }
  183. if($Goto == "finish setup") {
  184. if($_PASSWORD2 == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Verify Admin Password","7")); SetupVariables("$Message"); $ErrorCheck = 1; }
  185. elseif($_PASSWORD != $_PASSWORD2) { $Message = $Error->ReportMsg("1",$Error->ReportError("5","Your Passwords ","","DO NOT MATCH","7")); SetupVariables("$Message"); $ErrorCheck = 1; }
  186. } // End if($Goto == "finish setup")
  187. if($_FORGOTPASSQ == "[Select a Question]") { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","Password Security Question","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  188. elseif($_OPTFPQ == 0) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","Password Security Question","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  189. elseif($_FORGOTPASSA == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Password Security Answer","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
  190. if($ErrorCheck == 0) {
  191. if($Goto == "finish setup") { ConfirmSetupInfo(); }
  192. } // End if($ErrorCheck == 0)
  193. } // End function CNSI()
  194.  
  195. function ConfirmSetupInfo() {
  196. global $File_Path;
  197. $_Password = strtolower($_REQUEST['VAR_PASSWORD']);
  198. $_EPassword = md5($_Password);
  199. $_Answer = strtolower($_REQUEST['VAR_FPA']);
  200. $_EAnswer = md5($_Answer);
  201. $GetHidden = "";
  202. $GetHidden .= GetHidden("VAR_SITENAME",$_REQUEST['VAR_SITENAME']);
  203. $GetHidden .= GetHidden("VAR_SU",$_REQUEST['VAR_SU']);
  204. $GetHidden .= GetHidden("VAR_SUI",$_REQUEST['VAR_SUI']);
  205. $GetHidden .= GetHidden("VAR_AE",$_REQUEST['VAR_AE']);
  206. $GetHidden .= GetHidden("VAR_MYSQLHOST",$_REQUEST['VAR_MYSQLHOST']);
  207. $GetHidden .= GetHidden("VAR_MYSQLUSER",$_REQUEST['VAR_MYSQLUSER']);
  208. $GetHidden .= GetHidden("VAR_MYSQLPASS",$_REQUEST['VAR_MYSQLPASS']);
  209. $GetHidden .= GetHidden("VAR_MYSQLDB",$_REQUEST['VAR_MYSQLDB']);
  210. $GetHidden .= GetHidden("VAR_NAME",$_REQUEST['VAR_NAME']);
  211. $GetHidden .= GetHidden("VAR_LOGIN",$_REQUEST['VAR_LOGIN']);
  212. $GetHidden .= GetHidden("VAR_PASSWORD",$_EPassword);
  213. $GetHidden .= GetHidden("OPT_FPQ",$_REQUEST['OPT_FPQ']);
  214. $GetHidden .= GetHidden("VAR_FPA",$_EAnswer);
  215. $color1 = "TableBG";
  216. $color2 = "TableBG2";
  217. Heads();
  218. $tpl = new FetchTemplate();
  219. $tpl->set('SELF', $_SERVER['PHP_SELF']);
  220. $tpl->set('REQMETH', "post");
  221. $tpl->set('NAME', "Setup");
  222. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_head.thtml");
  223. for($OPTS_CONF = 0; $OPTS_CONF <= 14; $OPTS_CONF++) {
  224. $row_color = ($OPTS_CONF % 2) ? $color1 : $color2;
  225. if($OPTS_CONF == 0) {
  226. $tpl->set('TABLEBG', "$row_color");
  227. $tpl->set('OPTNAME', "Site Name");
  228. $tpl->set('SELECTION', $_REQUEST['VAR_SITENAME']);
  229. echo $tpl->fetch($File_Path."/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  230. }
  231. elseif($OPTS_CONF == 1) {
  232. $tpl->set('TABLEBG', "$row_color");
  233. $tpl->set('OPTNAME', "Site URL");
  234. $tpl->set('SELECTION', $_REQUEST['VAR_SU']);
  235. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  236. }
  237. elseif($OPTS_CONF == 2) {
  238. $tpl->set('TABLEBG', "$row_color");
  239. $tpl->set('OPTNAME', "Images Folder URL");
  240. $tpl->set('SELECTION', $_REQUEST['VAR_SUI']);
  241. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  242. }
  243. elseif($OPTS_CONF == 3) {
  244. $tpl->set('TABLEBG', "$row_color");
  245. $tpl->set('OPTNAME', "Admin E-mail");
  246. $tpl->set('SELECTION', $_REQUEST['VAR_AE']);
  247. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  248. }
  249. elseif($OPTS_CONF == 4) {
  250. $tpl->set('TABLEBG', "$row_color");
  251. $tpl->set('TITLENAME', "MySQL Information");
  252. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_title.thtml");
  253. }
  254. elseif($OPTS_CONF == 5) {
  255. $tpl->set('TABLEBG', "$row_color");
  256. $tpl->set('OPTNAME', "MySQL Host");
  257. $tpl->set('SELECTION', $_REQUEST['VAR_MYSQLHOST']);
  258. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  259. }
  260. elseif($OPTS_CONF == 6) {
  261. $tpl->set('TABLEBG', "$row_color");
  262. $tpl->set('OPTNAME', "MySQL Username");
  263. $tpl->set('SELECTION', $_REQUEST['VAR_MYSQLUSER']);
  264. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  265. }
  266. elseif($OPTS_CONF == 7) {
  267. $tpl->set('TABLEBG', "$row_color");
  268. $tpl->set('OPTNAME', "MySQL Password");
  269. $tpl->set('SELECTION', "Not shown");
  270. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  271. }
  272. elseif($OPTS_CONF == 8) {
  273. $tpl->set('TABLEBG', "$row_color");
  274. $tpl->set('OPTNAME', "MySQL Database");
  275. $tpl->set('SELECTION', $_REQUEST['VAR_MYSQLDB']);
  276. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  277. }
  278. elseif($OPTS_CONF == 9) {
  279. $tpl->set('TABLEBG', "$row_color");
  280. $tpl->set('TITLENAME', "Your Administration Login &amp; Password");
  281. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_title.thtml");
  282. }
  283. elseif($OPTS_CONF == 10) {
  284. $tpl->set('TABLEBG', "$row_color");
  285. $tpl->set('OPTNAME', "Admin Name");
  286. $tpl->set('SELECTION', $_REQUEST['VAR_NAME']);
  287. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  288. }
  289. elseif($OPTS_CONF == 11) {
  290. $tpl->set('TABLEBG', "$row_color");
  291. $tpl->set('OPTNAME', "Admin Login");
  292. $tpl->set('SELECTION', $_REQUEST['VAR_LOGIN']);
  293. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  294. }
  295. elseif($OPTS_CONF == 12) {
  296. $tpl->set('TABLEBG', "$row_color");
  297. $tpl->set('OPTNAME', "Admin Password");
  298. $tpl->set('SELECTION', "Not Shown");
  299. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  300. }
  301. elseif($OPTS_CONF == 13) {
  302. $tpl->set('TABLEBG', "$row_color");
  303. $tpl->set('OPTNAME', "Forgot Password Questions");
  304. $tpl->set('SELECTION', $_REQUEST['OPT_FPQ']);
  305. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  306. }
  307. elseif($OPTS_CONF == 14) {
  308. $tpl->set('TABLEBG', "$row_color");
  309. $tpl->set('OPTNAME', "Forgot Password Answer");
  310. $tpl->set('SELECTION', $_REQUEST['VAR_FPA']);
  311. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
  312. }
  313. } // End for($OPTS_CONF = 0; $OPTS_CONF <= 14; $OPTS_CONF++)
  314. $tpl->set('CODE', "$GetHidden");
  315. $tpl->set('SUBMIT', "Finish Confirmed Setup");
  316. echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_end.thtml");
  317. Foot();
  318. exit;
  319. } // End function ConfirmSetupInfo()
  320.  
  321. function TestMySql() {
  322. global $File_Path,$Message;
  323. CNSI();
  324. $qu = 0;
  325. $MYSQL_HOST = $_REQUEST['VAR_MYSQLHOST'];
  326. $MYSQL_USER = $_REQUEST['VAR_MYSQLUSER'];
  327. $MYSQL_PASS = $_REQUEST['VAR_MYSQLPASS'];
  328. $MYSQL_DB = $_REQUEST['VAR_MYSQLDB'];
  329. $Connect = @mysql_connect("$MYSQL_HOST", "$MYSQL_USER", "$MYSQL_PASS");
  330. if((!$Connect) || (!@mysql_select_db($MYSQL_DB, $Connect))) {
  331. Heads();
  332. $qu = 1;
  333. echo ReportMsg("1",ReportError("1","","1","$MYSQL_DB","1"));
  334. foot();
  335. exit;
  336. } // End if((!$Connect) || (!@mysql_select_db($MYSQL_DB, $Connect)))
  337. elseif(($Connect) && (@mysql_select_db($MYSQL_DB, $Connect))) {
  338. @mysql_query("CREATE TABLE TEST (id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id),TESTDB varchar(50) binary NOT NULL default '') TYPE=MyISAM") || ReportMsg("1",ReportError("1","","6","entry in the $MYSQL_DB","1"));
  339. @mysql_query("DROP TABLE IF EXISTS TEST") || ReportMsg("1",ReportError("1","","4","the $MYSQL_DB","1"));
  340. @mysql_close($Connect);
  341. $MYSQL_INFO = "<?php\n\n";
  342. $MYSQL_INFO .= "// Please Do Not Edit Below This Line\n\n";
  343. $MYSQL_INFO .= "global \$MYSQL_HOST, \$MYSQL_USER, \$MYSQL_PASS, \$MYSQL_DB;\n\n";
  344. $MYSQL_INFO .= "\$MYSQL_HOST = \"$MYSQL_HOST\";\n";
  345. $MYSQL_INFO .= "\$MYSQL_USER = \"$MYSQL_USER\";\n";
  346. $MYSQL_INFO .= "\$MYSQL_PASS = \"$MYSQL_PASS\";\n";
  347. $MYSQL_INFO .= "\$MYSQL_DB = \"$MYSQL_DB\";\n\n";
  348. $MYSQL_INFO .= "?>";
  349. wrifl("$File_Path","/MySqlDBtemp.php","$MYSQL_INFO");
  350. WriteSetupVars();
  351. rename("$File_Path/MySqlDBtemp.php","$File_Path/MySqlDB.php");
  352. $Message = ReportMsg("2","Script Sucessfully Installed. You may now login to setup everything else.");
  353. Logon($Message);
  354. } // End elseif(($Connect) && (@mysql_select_db($MYSQL_DB, $Connect)))
  355. } // End function TestMySql()
  356.  
  357. function WriteSetupVars() {
  358. global $File_Path;
  359. if(file_exists("$File_Path/MySqlDBtemp.php")) { include("$File_Path/MySqlDBtemp.php"); }
  360. elseif(!file_exists("$File_Path/MySqlDBtemp.php")) { Heads(); echo ReportMsg("1","0","$File_Path/MySqlDBtemp.php is missing. Please reinstall."); Foot(); }
  361. $VAR_SITENAME = $_REQUEST['VAR_SITENAME'];
  362. $VAR_SU = $_REQUEST['VAR_SU'];
  363. $VAR_SUI = $_REQUEST['VAR_SUI'];
  364. $VAR_AE = $_REQUEST['VAR_AE'];
  365. $VAR_NAME = $_REQUEST['VAR_NAME'];
  366. $VAR_LOGIN = $_REQUEST['VAR_LOGIN'];
  367. $_EPassword = $_REQUEST['VAR_PASSWORD'];
  368. $OPT_FPQ = $_REQUEST['OPT_FPQ'];
  369. $_EAnswer = $_REQUEST['VAR_FPA'];
  370. $Joined = date('Ymd');
  371. Open_Mysql();
  372. CreateNewTables();
  373. mysql_query("INSERT INTO rc_adminauth (name,username,password,permission,email,question,answer) VALUES ('$VAR_NAME','$VAR_LOGIN','$_EPassword','pa','$VAR_AE','$OPT_FPQ','$_EAnswer')") || ReportMsg("1","0","MySQL Error: Error writing to Admin database.");
  374. mysql_query("INSERT INTO rc_variables (sitename,url,imageurl,adminemail,templates) VALUES ('$VAR_SITENAME','$VAR_SU','$VAR_SUI','$VAR_AE','$File_Path')") || ReportMsg("1","0","MySQL Error: Error writing to Variables database");
  375. Close_Mysql();
  376. } // End function WriteSetupVars()
  377.  
  378. function Logon() {
  379. global $Message,$File_Path,$CONFIG,$IsLoggedin,$var_sitename;
  380. if(file_exists("$File_Path/MySqlDB.php")) {
  381. FindSession();
  382. if($IsLoggedin == 1) { Main(); } // End if($IsLoggedin == 1)
  383. elseif($IsLoggedin == 0) {
  384. Heads();
  385. $tpl = new FetchTemplate();
  386. $tpl->set('SELF', $_SERVER['PHP_SELF']);
  387. $tpl->set('REQMETH', "post");
  388. $tpl->set('SITENAME', $var_sitename);
  389. $tpl->set('VER', $CONFIG["VER"]);
  390. echo $tpl->fetch("$File_Path/templates/admin/common/_template_common_login.thtml");
  391. $tpl = new FetchTemplate();
  392. $tpl->set('CODE', "");
  393. $tpl->set('HIDDENINPUT', "");
  394. $tpl->set('SUBMIT', "Login");
  395. echo $tpl->fetch($File_Path."templates/admin/common/_template_common_submit.thtml");
  396. Foot();
  397. exit;
  398. } // End if($IsLoggedin == 0)
  399. } // End if(file_exists("$File_Path/MySqlDB.php"))
  400. elseif(!file_exists("$File_Path/MySqlDB.php")) { SetupVariables(); }
  401. } // End function Logon()
  402.  
  403.  
  404.  
  405. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement