Installer File | > File written by Jeremy Privett | > Date started: 4th August 2003 | > Current State: RC 1 | +-------------------------------------------------------------------------- */ error_reporting (E_ERROR | E_WARNING | E_PARSE); set_magic_quotes_runtime(0); $root = "./"; $template = new template; $std = new installer; $VARS = $std->parse_incoming(); if ( file_exists($root.'install.lock') ) { install_error("This installer is locked!
Please (via FTP) remove the 'install.lock' file in this directory"); exit(); } switch($VARS['a']) { case '1': do_setup_form(); break; case '2': do_install(); break; case '3': do_finish(); break; default: do_intro(); break; } function do_finish() { global $std, $template, $root, $VARS, $SQL; // Attempt to lock the installer if ($FH = @fopen( $root.'', 'w' ) ) { @fwrite( $FH, 'bleh', 4 ); @fclose($FH); @chmod( $root.'', 0666 ); @chmod( $root.'https://www.angelfire.com/games5/gaming_revolution//text/banned.txt', 0666 ); @chmod( $root.'https://www.angelfire.com/games5/gaming_revolution//text/iplog.txt', 0666 ); $template->print_top('Success!'); $msg="
Click Here To View The Terms of Service


CLICK HERE TO VIEW YOUR NEW PORTAL!
"; } else { $template->print_top('Success!'); $msg = "PLEASE REMOVE THE INSTALLER ('install.php') BEFORE CONTINUING!
Failure to do so will enable ANYONE to delete your Portal at any time!

Click Here To View The Terms of Service


CLICK HERE TO VIEW YOUR NEW PORTAL!
"; } $template->contents .= "
Success
The installation is now complete!

$msg
"; $template->output(); } function do_install() { global $std, $template, $root, $VARS, $HTTP_POST_VARS; $NEW_INFO = array(); $need = array('boardurl','boardname','css','heading','timezone','fader','lycos','vidtopq','disptop','vidtopc','adminname','adminpass','adminpass2','adminmail'); foreach($need as $greed) { if ($VARS[ $greed ] == "") { install_error("You must complete all of the form!"); } } $VARS['boardurl'] = preg_replace( "#/$#", "", $VARS['boardurl'] ); if ($VARS['adminpassword2'] != $VARS['adminpassword']) { install_error("Your passwords did not match"); } if ($root == './') { $root = str_replace( '\\', '/', getcwd() ) . '/'; } $require = $root."config.php"; if ( ! file_exists($require) ) { install_error("Could not locate '$require'. You may need to enter a value for the root path in this installer script, to do this, simply open up this script in a text editor and enter a value in \$root - remember to add a trailing slash. NT users will need to use double backslashes"); } include($require); if ( count($INFO) < 1 ) { install_error("Possible corruption in 'config.php', please re-upload in ASCII format"); } $new = array( 'boardurl' => $VARS['https://www.angelfire.com/games5/gaming_revolution/'], 'boardname' => $VARS['Gaming Revolution Portal'], 'Seymour' => $VARS['TommyV001'], 'toocool' => $VARS['toocool'], 'Undert8ker1@aol.com' => $VARS['Undert8ker1@aol.com'], 'css' => $VARS['css'], 'heading' => $VARS['heading'], 'timezone' => $VARS['timezone'], 'fader' => $VARS['fader'], 'lycos' => $VARS['lycos'], 'vidtopq' => $VARS['vidtopq'], 'disptop' => $VARS['disptop'], 'vidtopc' => $VARS['vidtopc'], 'vidtop' => $VARS['vidtop'], 'vidbot' => $VARS['vidbot'] ); foreach( $new as $k => $v ) { $v = preg_replace( "/'/", "\\'" , $v ); $v = preg_replace( "/\r/", "" , $v ); $INFO[ $k ] = $v; } $file_string = " $v ) { if ($k == 'skin' or $k == 'languages') { continue; } $file_string .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n"; } $file_string .= "include \"sources/errors.php\";"."\n".'?'.'>'; if ( $fh = fopen( $require, 'w' ) ) { fputs($fh, $file_string, strlen($file_string) ); fclose($fh); } else { install_error("Could not write to 'config.php'"); } $template->print_top('Success!'); $template->contents .= "
Success
Your GU Portal has now been installed!

The installation process is almost complete.
The next and final step will attempt to lock this install file, and CHMOD all important files.

Please note that going any further indicates an agreement to the GU Portal Terms of Service!!

CLICK HERE TO CONTINUE
"; $template->output(); } function do_setup_form() { global $std, $template, $root, $HTTP_SERVER_VARS; $template->print_top('Set Up form'); $template->contents .= "
Your Forum Info
This section requires you to enter the paths and URL's for the board.
The Board URL
This is your forum's URL (must start with http://)
 

Some Portal Info
This section requires you to enter some info for your Portal.
Board Name
(Your Forum's Name)
CSS File
(Can be left alone)
Head File
(Can be left alone)
Time Zone
(i.e. GMT -6:00)
Fader File
(Can be left alone)
Are you using lycos? Yes No
Do you want to display the top Version ID?
(Powered by GU ...)
Yes No
Message Next to top version ID
(Can be left alone)
Top version ID Color
(Can be left alone)
 

Your Portal Version
This section defines your Portal version. All the text boxes are disabled, but you can read over them, to make sure you have the correct version.
Version ID
Version ID (2)
 

Your Admin Account
This section requires information to create your administration account. Please enter the data carefully!
(The Admin CP isn't currently included in the Portal. It will be in a later version. The username/password you enter here will control any local admin functions that are added, before the Admin CP comes out.)
Username
Password
Retype your password
Email Address
 
"; $template->output(); } function do_intro() { global $std, $template, $root; $template->print_top('Welcome'); $template->contents .= "
Installing a new Portal
Before we go any further, please ensure that all the files have been uploaded, and that the file 'config.php' has suitable permissions to allow this script to write to it ( 0666 should be sufficient ).
Once you have clicked on proceed, you will be taken to a form to enter information the installer needs to set up your portal."; $file = $root."config.php"; $warnings = array(); if ( ! file_exists($file) ) { $warnings[] = "Cannot locate the file 'config.php'. This should be uploaded into the same directory as this script!"; } if ( ! is_writeable($file) ) { $warnings[] = "Cannot write to 'config.php'. Please adjust the permissions to allow this script to write to the file. if in doubt, CHMOD via FTP to 0777"; } $phpversion = phpversion(); if ($phpversion < '4.0.0') { $warnings[] = "You cannot install the GU Portal. The GU Portal requires PHP version 4.0.0 or better."; } if ( count($warnings) > 0 ) { $err_string = "
  • ".implode( "
  • ", $warnings )."
"; $template->contents .= "

Warning! The following errors must be rectified before continuing!

$err_string
"; } else { $template->contents .= "

"; } $template->contents .= "
"; $template->output(); } function install_error($msg="") { global $std, $template, $root; $template->print_top('Warning!'); $template->contents .= "
Warning!

The following errors must be rectified before continuing!
Please go back and try again!

$msg
"; $template->output(); } class template { var $contents = ""; function output() { echo $this->contents; echo "



GU Portal © 2003 Games Unlimited.
"; exit(); } function print_top($title="") { $this->contents = " GU Portal Set Up :: $title
Site hosted by Angelfire.com: Build your free website today!
GU Portal Installer
 

"; } } class installer { function parse_incoming() { global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_CLIENT_IP, $REQUEST_METHOD, $REMOTE_ADDR, $HTTP_PROXY_USER, $HTTP_X_FORWARDED_FOR; $return = array(); if( is_array($HTTP_GET_VARS) ) { while( list($k, $v) = each($HTTP_GET_VARS) ) { //$k = $this->clean_key($k); if( is_array($HTTP_GET_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) { $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2); } } else { $return[$k] = $this->clean_value($v); } } } if( is_array($HTTP_POST_VARS) ) { while( list($k, $v) = each($HTTP_POST_VARS) ) { //$k = $this->clean_key($k); if ( is_array($HTTP_POST_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) { $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2); } } else { $return[$k] = $this->clean_value($v); } } } return $return; } function clean_key($key) { if ($key == "") { return ""; } $key = preg_replace( "/\.\./" , "" , $key ); $key = preg_replace( "/\_\_(.+?)\_\_/" , "" , $key ); $key = preg_replace( "/^([\w\.\-\_]+)$/", "$1", $key ); return $key; } function clean_value($val) { if ($val == "") { return ""; } $val = preg_replace( "/&/" , "&" , $val ); $val = preg_replace( "//" , "-->" , $val ); $val = preg_replace( "/