Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // #########################################################
- // # Clan Infinity Redux V1.0 #
- // #########################################################
- // # #
- // # This script is copywrited by Reflux Coding Inc. #
- // # any attempt to modify or use this code without proper #
- // # authorization will be considered an infringement of #
- // # our copywrite and legal action will be pursued to #
- // # the fullest extent possible. #
- // # #
- // # This script was created by: #
- // # #
- // # Reflux Coding & Josh Emilson A.K.A. Whitepyro #
- // # http://www.refluxcoding.com #
- // # #
- // # This and many other fine scripts are available at #
- // # the above website or by emailing the author at #
- // # webmaster@refluxcoding.com #
- // #########################################################
- error_reporting(E_ALL);
- $File_Path = dirname(__FILE__);
- if(stristr($_SERVER["SERVER_SOFTWARE"], 'WIN')) { $data = explode("\\",$File_Path); }
- else { $data = explode("/",$File_Path); }
- $count = count($data) - 2;
- $File_Path = "";
- for($I = 0; $I <= $count; $I++) {
- if(!stristr($_SERVER["SERVER_SOFTWARE"], 'WIN')) { $File_Path .= $data[$I] ."/"; }
- else { $File_Path .= $data[$I] ."/"; }
- } // End for($I = 0; $I <= $count; $I++)
- if(file_exists($File_Path."include/rclib.php")) { include($File_Path."include/rclib.php"); }
- elseif(!file_exists($File_Path."include/rclib.php")) { echo ("<div align=\"center\">".$File_Path."include/rclib.php is missing</div>"); }
- if(file_exists("$File_Path/MySqlDB.php")) {
- include("$File_Path/MySqlDB.php");
- GetAdvancedVariables();
- GetVariables();
- } // End if(file_exists("$File_Path/MySqlDB.php"))
- if(isset($_REQUEST['goto'])) { $Goto = $_REQUEST['goto']; }
- elseif(!isset($_REQUEST['goto'])) { $Goto = ""; }
- $Goto = htmlspecialchars("$Goto", ENT_QUOTES);
- $Goto = strtolower($Goto);
- if($Goto == "" && !file_exists($File_Path."/MySqlDB.php")) { SetupVariables(); }
- elseif($Goto == "finish setup" && !file_exists("$File_Path/MySqlDB.php")) { CNSI(); }
- elseif($Goto == "finish confirmed setup" && !file_exists("$File_Path/MySqlDB.php")) { TestMySql(); }
- elseif(($Goto == "finish setup")||($Goto == "finish confirmed setup") && file_exists("$File_Path/MySqlDB.php")) { Logon(); }
- elseif($Goto == "" && file_exists("$File_Path/MySqlDB.php")) { Logon(); }
- else { Illegal(); }
- function SetupVariables() {
- global $Message,$Goto,$File_Path,$Questions;
- Heads();
- $OPT_FPQ = array();
- $structure = $_SERVER["PHP_SELF"];
- $structure = str_replace("/admin/admin.php","", "$structure");
- if(isset($_REQUEST['VAR_SITENAME'])) { $VAR_SITENAME = $_REQUEST['VAR_SITENAME']; }
- elseif(!isset($_REQUEST['VAR_SITENAME'])) { $VAR_SITENAME = ""; }
- if(isset($_REQUEST['VAR_SU'])) { $VAR_SU = $_REQUEST['VAR_SU']; }
- elseif(!isset($_REQUEST['VAR_SU'])) { $VAR_SU = "http://".$_SERVER["HTTP_HOST"]; }
- if(isset($_REQUEST['VAR_SUI'])) { $VAR_SUI = $_REQUEST['VAR_SUI']; }
- elseif(!isset($_REQUEST['VAR_SUI'])) { $VAR_SUI = "$VAR_SU$structure/images"; }
- if(isset($_REQUEST['VAR_AE'])) { $VAR_AE = $_REQUEST['VAR_AE']; }
- elseif(!isset($_REQUEST['VAR_AE'])) { $VAR_AE = ""; }
- if(!isset($_REQUEST['VAR_MYSQLHOST'])) { $VAR_MYSQLHOST = ""; }
- elseif(isset($_REQUEST['VAR_MYSQLHOST'])) { $VAR_MYSQLHOST = $_REQUEST['VAR_MYSQLHOST']; }
- if(!isset($_REQUEST['VAR_MYSQLUSER'])) { $VAR_MYSQLUSER = ""; }
- elseif(isset($_REQUEST['VAR_MYSQLUSER'])) { $VAR_MYSQLUSER = $_REQUEST['VAR_MYSQLUSER']; }
- if(!isset($_REQUEST['VAR_MYSQLPASS'])) { $VAR_MYSQLPASS = ""; }
- elseif(isset($_REQUEST['VAR_MYSQLPASS'])) { $VAR_MYSQLPASS = $_REQUEST['VAR_MYSQLPASS']; }
- if(!isset($_REQUEST['VAR_MYSQLDB'])) { $VAR_MYSQLDB = ""; }
- elseif(isset($_REQUEST['VAR_MYSQLDB'])) { $VAR_MYSQLDB = $_REQUEST['VAR_MYSQLDB']; }
- if(!isset($_REQUEST['VAR_LOGIN'])) { $VAR_LOGIN = ""; }
- elseif(isset($_REQUEST['VAR_LOGIN'])) { $VAR_LOGIN = $_REQUEST['VAR_LOGIN']; }
- if(!isset($_REQUEST['VAR_FPA'])) { $VAR_FPA = ""; }
- elseif(isset($_REQUEST['VAR_FPA'])) { $VAR_FPA = $_REQUEST['VAR_FPA']; }
- if(!isset($_REQUEST['OPT_FPQ'])) { $OPT_FPQ = ""; }
- elseif(isset($_REQUEST['OPT_FPQ'])) { $OPT_FPQ = $_REQUEST['OPT_FPQ']; }
- if(!isset($_REQUEST['VAR_NAME'])) { $VAR_NAME = ""; }
- elseif(isset($_REQUEST['VAR_NAME'])) { $VAR_NAME = $_REQUEST['VAR_NAME']; }
- if(!isset($_REQUEST['VAR_LOGIN'])) { $VAR_LOGIN = ""; }
- elseif(isset($_REQUEST['VAR_LOGIN'])) { $VAR_LOGIN = $_REQUEST['VAR_LOGIN']; }
- $OPT_FPQA = "";
- GetQuestions();
- foreach($Questions as $key => $val) {
- if($OPT_FPQ == $val) { $OPT_FPQA .= GetOption("$val","$val","1","0"); }
- elseif($OPT_FPQ != $val) { $OPT_FPQA .= GetOption("$val","$val","0","0"); }
- } // End foreach($Choice as $key => $val)
- $tpl = new FetchTemplate();
- $tpl->set('SELF', $_SERVER['PHP_SELF']);
- $tpl->set('REQMETH', "post");
- $tpl->set('VAR_SITENAME', "$VAR_SITENAME");
- $tpl->set('VAR_SU', "$VAR_SU");
- $tpl->set('VAR_SUI', "$VAR_SUI");
- $tpl->set('VAR_AE', "$VAR_AE");
- $tpl->set('VAR_MYSQLHOST', "$VAR_MYSQLHOST");
- $tpl->set('VAR_MYSQLUSER', "$VAR_MYSQLUSER");
- $tpl->set('VAR_MYSQLPASS', "$VAR_MYSQLPASS");
- $tpl->set('VAR_MYSQLDB', "$VAR_MYSQLDB");
- $tpl->set('VAR_NAME', "$VAR_NAME");
- $tpl->set('VAR_LOGIN', "$VAR_LOGIN");
- $tpl->set('OPT_FPQ', "$OPT_FPQA");
- $tpl->set('VAR_FPA', "$VAR_FPA");
- echo $tpl->fetch($File_Path."templates/admin/common/_template_common_setupform.thtml");
- $tpl = new FetchTemplate();
- $tpl->set('CODE', "");
- $tpl->set('HIDDENINPUT', "");
- $tpl->set('SUBMIT', "Finish Setup");
- echo $tpl->fetch($File_Path."templates/admin/common/_template_common_submit.thtml");
- Foot();
- exit;
- } // End function SetupVariables()
- function CNSI() {
- global $Message,$Questions,$Goto;
- $ErrorCheck = 0;
- $_SITENAME = $_REQUEST['VAR_SITENAME'];
- $_SITENAME = htmlspecialchars("$_SITENAME", ENT_QUOTES);
- $_SITEURL = $_REQUEST['VAR_SU'];
- $_SITEURL = htmlspecialchars("$_SITEURL", ENT_QUOTES);
- $_SITEIMG = $_REQUEST['VAR_SUI'];
- $_SITEIMG = htmlspecialchars("$_SITEIMG", ENT_QUOTES);
- $_EMAIL = $_REQUEST['VAR_AE'];
- $_EMAIL = htmlspecialchars("$_EMAIL", ENT_QUOTES);
- $_MYSQLHOST = $_REQUEST['VAR_MYSQLHOST'];
- $_MYSQLHOST = htmlspecialchars("$_MYSQLHOST", ENT_QUOTES);
- $_MYSQLUSER = $_REQUEST['VAR_MYSQLUSER'];
- $_MYSQLUSER = htmlspecialchars("$_MYSQLUSER", ENT_QUOTES);
- $_MYSQLPASSWORD = $_REQUEST['VAR_MYSQLPASS'];
- $_MYSQLPASSWORD = htmlspecialchars("$_MYSQLPASSWORD", ENT_QUOTES);
- $_MYSQLDB = $_REQUEST['VAR_MYSQLDB'];
- $_MYSQLDB = htmlspecialchars("$_MYSQLDB", ENT_QUOTES);
- $_NAME = $_REQUEST['VAR_NAME'];
- $_NAME = htmlspecialchars("$_NAME", ENT_QUOTES);
- $_LOGIN = $_REQUEST['VAR_LOGIN'];
- $_LOGIN = htmlspecialchars("$_LOGIN", ENT_QUOTES);
- $_PASSWORD = $_REQUEST['VAR_PASSWORD'];
- $_PASSWORD = htmlspecialchars("$_PASSWORD", ENT_QUOTES);
- if($Goto == "finish setup") {
- $_PASSWORD2 = $_REQUEST['VAR_PASSWORD2'];
- $_PASSWORD2 = htmlspecialchars("$_PASSWORD2", ENT_QUOTES);
- } // End if($Goto == "finish setup")
- $_FORGOTPASSQ = $_REQUEST['OPT_FPQ'];
- $_FORGOTPASSQ = htmlspecialchars("$_FORGOTPASSQ", ENT_QUOTES);
- $_FORGOTPASSA = $_REQUEST['VAR_FPA'];
- $_FORGOTPASSA = htmlspecialchars("$_FORGOTPASSA", ENT_QUOTES);
- $_OPTFPQ = 0;
- GetQuestions();
- foreach($Questions as $key => $val) {
- if($_FORGOTPASSQ == $val) { $_OPTFPQ = 1; }
- } // End foreach($Choice as $key => $val)
- $Error = new Errors();
- if($_SITENAME == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Site Name","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- 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; }
- elseif(($_SITEURL == "")||($_SITEURL == "http://")) { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Site URL","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- 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; }
- elseif(($_SITEIMG == "")||($_SITEIMG == "http://")) { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Images Folder URL","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- 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; }
- elseif($_EMAIL == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","E-mail Address","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- 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; }
- elseif($_MYSQLHOST == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","MySQL Host","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- 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; }
- elseif($_MYSQLUSER == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","MySQL Username","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif(!preg_match('/^([[:alpha:][:digit:]\.])*$/ix', $_MYSQLUSER)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","MySQL Username","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif(!preg_match('/^([[:alpha:][:digit:]\.]){0,25}$/ix', $_MYSQLUSER)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","MySQL Username","8")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif($_MYSQLPASSWORD == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","MySQL Password","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif(!preg_match('/^([[:alpha:][:digit:]\.])*$/ix', $_MYSQLPASSWORD)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","MySQL Password","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif(!preg_match('/^([[:alpha:][:digit:]\.]){0,30}$/ix', $_MYSQLPASSWORD)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","MySQL Password","8")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif($_MYSQLDB == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","MySQL Database","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif(!preg_match('/^([(\w).])*$/ix', $_MYSQLDB)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","MySQL Database","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif($_NAME == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Full Name","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- 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; }
- elseif($_LOGIN == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Admin Login","7")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif(!preg_match('/^([[:alpha:][:digit:]\.])*$/ix', $_LOGIN)) { $Message = $Error->ReportMsg("1",$Error->ReportError("4","","","Admin Login","5")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif(!preg_match('/^([[:alpha:][:digit:]\.]){0,25}$/ix', $_LOGIN)) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","Admin Login","8")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif($_PASSWORD == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Admin Password","7")); SetupVariables("$Message"); $ErrorCheck = 1; }
- if($Goto == "finish setup") {
- if($_PASSWORD2 == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Verify Admin Password","7")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif($_PASSWORD != $_PASSWORD2) { $Message = $Error->ReportMsg("1",$Error->ReportError("5","Your Passwords ","","DO NOT MATCH","7")); SetupVariables("$Message"); $ErrorCheck = 1; }
- } // End if($Goto == "finish setup")
- if($_FORGOTPASSQ == "[Select a Question]") { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","Password Security Question","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif($_OPTFPQ == 0) { $Message = $Error->ReportMsg("1",$Error->ReportError("2","","","Password Security Question","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- elseif($_FORGOTPASSA == "") { $Message = $Error->ReportMsg("1",$Error->ReportError("3","","","Password Security Answer","2")); SetupVariables("$Message"); $ErrorCheck = 1; }
- if($ErrorCheck == 0) {
- if($Goto == "finish setup") { ConfirmSetupInfo(); }
- } // End if($ErrorCheck == 0)
- } // End function CNSI()
- function ConfirmSetupInfo() {
- global $File_Path;
- $_Password = strtolower($_REQUEST['VAR_PASSWORD']);
- $_EPassword = md5($_Password);
- $_Answer = strtolower($_REQUEST['VAR_FPA']);
- $_EAnswer = md5($_Answer);
- $GetHidden = "";
- $GetHidden .= GetHidden("VAR_SITENAME",$_REQUEST['VAR_SITENAME']);
- $GetHidden .= GetHidden("VAR_SU",$_REQUEST['VAR_SU']);
- $GetHidden .= GetHidden("VAR_SUI",$_REQUEST['VAR_SUI']);
- $GetHidden .= GetHidden("VAR_AE",$_REQUEST['VAR_AE']);
- $GetHidden .= GetHidden("VAR_MYSQLHOST",$_REQUEST['VAR_MYSQLHOST']);
- $GetHidden .= GetHidden("VAR_MYSQLUSER",$_REQUEST['VAR_MYSQLUSER']);
- $GetHidden .= GetHidden("VAR_MYSQLPASS",$_REQUEST['VAR_MYSQLPASS']);
- $GetHidden .= GetHidden("VAR_MYSQLDB",$_REQUEST['VAR_MYSQLDB']);
- $GetHidden .= GetHidden("VAR_NAME",$_REQUEST['VAR_NAME']);
- $GetHidden .= GetHidden("VAR_LOGIN",$_REQUEST['VAR_LOGIN']);
- $GetHidden .= GetHidden("VAR_PASSWORD",$_EPassword);
- $GetHidden .= GetHidden("OPT_FPQ",$_REQUEST['OPT_FPQ']);
- $GetHidden .= GetHidden("VAR_FPA",$_EAnswer);
- $color1 = "TableBG";
- $color2 = "TableBG2";
- Heads();
- $tpl = new FetchTemplate();
- $tpl->set('SELF', $_SERVER['PHP_SELF']);
- $tpl->set('REQMETH', "post");
- $tpl->set('NAME', "Setup");
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_head.thtml");
- for($OPTS_CONF = 0; $OPTS_CONF <= 14; $OPTS_CONF++) {
- $row_color = ($OPTS_CONF % 2) ? $color1 : $color2;
- if($OPTS_CONF == 0) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Site Name");
- $tpl->set('SELECTION', $_REQUEST['VAR_SITENAME']);
- echo $tpl->fetch($File_Path."/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 1) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Site URL");
- $tpl->set('SELECTION', $_REQUEST['VAR_SU']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 2) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Images Folder URL");
- $tpl->set('SELECTION', $_REQUEST['VAR_SUI']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 3) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Admin E-mail");
- $tpl->set('SELECTION', $_REQUEST['VAR_AE']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 4) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('TITLENAME', "MySQL Information");
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_title.thtml");
- }
- elseif($OPTS_CONF == 5) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "MySQL Host");
- $tpl->set('SELECTION', $_REQUEST['VAR_MYSQLHOST']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 6) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "MySQL Username");
- $tpl->set('SELECTION', $_REQUEST['VAR_MYSQLUSER']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 7) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "MySQL Password");
- $tpl->set('SELECTION', "Not shown");
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 8) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "MySQL Database");
- $tpl->set('SELECTION', $_REQUEST['VAR_MYSQLDB']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 9) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('TITLENAME', "Your Administration Login & Password");
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_title.thtml");
- }
- elseif($OPTS_CONF == 10) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Admin Name");
- $tpl->set('SELECTION', $_REQUEST['VAR_NAME']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 11) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Admin Login");
- $tpl->set('SELECTION', $_REQUEST['VAR_LOGIN']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 12) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Admin Password");
- $tpl->set('SELECTION', "Not Shown");
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 13) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Forgot Password Questions");
- $tpl->set('SELECTION', $_REQUEST['OPT_FPQ']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- elseif($OPTS_CONF == 14) {
- $tpl->set('TABLEBG', "$row_color");
- $tpl->set('OPTNAME', "Forgot Password Answer");
- $tpl->set('SELECTION', $_REQUEST['VAR_FPA']);
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_list.thtml");
- }
- } // End for($OPTS_CONF = 0; $OPTS_CONF <= 14; $OPTS_CONF++)
- $tpl->set('CODE', "$GetHidden");
- $tpl->set('SUBMIT', "Finish Confirmed Setup");
- echo $tpl->fetch("$File_Path/templates/admin/common/confirm/_template_common_confirm_end.thtml");
- Foot();
- exit;
- } // End function ConfirmSetupInfo()
- function TestMySql() {
- global $File_Path,$Message;
- CNSI();
- $qu = 0;
- $MYSQL_HOST = $_REQUEST['VAR_MYSQLHOST'];
- $MYSQL_USER = $_REQUEST['VAR_MYSQLUSER'];
- $MYSQL_PASS = $_REQUEST['VAR_MYSQLPASS'];
- $MYSQL_DB = $_REQUEST['VAR_MYSQLDB'];
- $Connect = @mysql_connect("$MYSQL_HOST", "$MYSQL_USER", "$MYSQL_PASS");
- if((!$Connect) || (!@mysql_select_db($MYSQL_DB, $Connect))) {
- Heads();
- $qu = 1;
- echo ReportMsg("1",ReportError("1","","1","$MYSQL_DB","1"));
- foot();
- exit;
- } // End if((!$Connect) || (!@mysql_select_db($MYSQL_DB, $Connect)))
- elseif(($Connect) && (@mysql_select_db($MYSQL_DB, $Connect))) {
- @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"));
- @mysql_query("DROP TABLE IF EXISTS TEST") || ReportMsg("1",ReportError("1","","4","the $MYSQL_DB","1"));
- @mysql_close($Connect);
- $MYSQL_INFO = "<?php\n\n";
- $MYSQL_INFO .= "// Please Do Not Edit Below This Line\n\n";
- $MYSQL_INFO .= "global \$MYSQL_HOST, \$MYSQL_USER, \$MYSQL_PASS, \$MYSQL_DB;\n\n";
- $MYSQL_INFO .= "\$MYSQL_HOST = \"$MYSQL_HOST\";\n";
- $MYSQL_INFO .= "\$MYSQL_USER = \"$MYSQL_USER\";\n";
- $MYSQL_INFO .= "\$MYSQL_PASS = \"$MYSQL_PASS\";\n";
- $MYSQL_INFO .= "\$MYSQL_DB = \"$MYSQL_DB\";\n\n";
- $MYSQL_INFO .= "?>";
- wrifl("$File_Path","/MySqlDBtemp.php","$MYSQL_INFO");
- WriteSetupVars();
- rename("$File_Path/MySqlDBtemp.php","$File_Path/MySqlDB.php");
- $Message = ReportMsg("2","Script Sucessfully Installed. You may now login to setup everything else.");
- Logon($Message);
- } // End elseif(($Connect) && (@mysql_select_db($MYSQL_DB, $Connect)))
- } // End function TestMySql()
- function WriteSetupVars() {
- global $File_Path;
- if(file_exists("$File_Path/MySqlDBtemp.php")) { include("$File_Path/MySqlDBtemp.php"); }
- elseif(!file_exists("$File_Path/MySqlDBtemp.php")) { Heads(); echo ReportMsg("1","0","$File_Path/MySqlDBtemp.php is missing. Please reinstall."); Foot(); }
- $VAR_SITENAME = $_REQUEST['VAR_SITENAME'];
- $VAR_SU = $_REQUEST['VAR_SU'];
- $VAR_SUI = $_REQUEST['VAR_SUI'];
- $VAR_AE = $_REQUEST['VAR_AE'];
- $VAR_NAME = $_REQUEST['VAR_NAME'];
- $VAR_LOGIN = $_REQUEST['VAR_LOGIN'];
- $_EPassword = $_REQUEST['VAR_PASSWORD'];
- $OPT_FPQ = $_REQUEST['OPT_FPQ'];
- $_EAnswer = $_REQUEST['VAR_FPA'];
- $Joined = date('Ymd');
- Open_Mysql();
- CreateNewTables();
- 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.");
- 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");
- Close_Mysql();
- } // End function WriteSetupVars()
- function Logon() {
- global $Message,$File_Path,$CONFIG,$IsLoggedin,$var_sitename;
- if(file_exists("$File_Path/MySqlDB.php")) {
- FindSession();
- if($IsLoggedin == 1) { Main(); } // End if($IsLoggedin == 1)
- elseif($IsLoggedin == 0) {
- Heads();
- $tpl = new FetchTemplate();
- $tpl->set('SELF', $_SERVER['PHP_SELF']);
- $tpl->set('REQMETH', "post");
- $tpl->set('SITENAME', $var_sitename);
- $tpl->set('VER', $CONFIG["VER"]);
- echo $tpl->fetch("$File_Path/templates/admin/common/_template_common_login.thtml");
- $tpl = new FetchTemplate();
- $tpl->set('CODE', "");
- $tpl->set('HIDDENINPUT', "");
- $tpl->set('SUBMIT', "Login");
- echo $tpl->fetch($File_Path."templates/admin/common/_template_common_submit.thtml");
- Foot();
- exit;
- } // End if($IsLoggedin == 0)
- } // End if(file_exists("$File_Path/MySqlDB.php"))
- elseif(!file_exists("$File_Path/MySqlDB.php")) { SetupVariables(); }
- } // End function Logon()
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement