important security checks and There is NO workaround. Please contact your host for more information."); } if(!function_exists("print_a")) { function print_a($var) { return '
'.htmlentities(print_r($var, true), null, "UTF-8").''; } } header("Content-type: text/html; charset=utf-8"); //obsolete $installer_folder_name = 'e107_install'; include_once("./{$HANDLERS_DIRECTORY}e107_class.php"); $e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'CACHE_DIRECTORY', 'DOWNLOADS_DIRECTORY', 'UPLOADS_DIRECTORY'); $e107 = e107::getInstance(); $e107->_init($e107_paths, realpath(dirname(__FILE__))); unset($e107_paths); //obsolete $e107->e107_dirs['INSTALLER'] = "{$installer_folder_name}/"; $e_install = new e_install(); $e_forms = new e_forms(); $e_install->template->SetTag("installer_css_http", $_SERVER['PHP_SELF']."?object=stylesheet"); //obsolete $e_install->template->SetTag("installer_folder_http", e_HTTP.$installer_folder_name."/"); $e_install->template->SetTag("files_dir_http", e_FILE_ABS); if(!isset($_POST['stage'])) { $_POST['stage'] = 1; } $_POST['stage'] = intval($_POST['stage']); switch ($_POST['stage']) { case 1: $e_install->stage_1(); break; case 2: $e_install->stage_2(); break; case 3: $e_install->stage_3(); break; case 4: $e_install->stage_4(); break; case 5: $e_install->stage_5(); break; case 6: $e_install->stage_6(); break; case 7: $e_install->stage_7(); break; default: $e_install->raise_error("Install stage information from client makes no sense to me."); } if($_SERVER['QUERY_STRING'] == "debug") { $e_install->template->SetTag("debug_info", print_a($e_install)); } else { $e_install->template->SetTag("debug_info", (count($e_install->debug_info) ? print_a($e_install->debug_info)."Backtrace:
| ".LANINS_030." | ||
| ".LANINS_031." | ||
| ".LANINS_032." | ||
|
|
".LANINS_033." | |
| ".LANINS_034." |
| ".LANINS_030." | ||
| ".LANINS_031." | ||
| ".LANINS_032." | ||
|
|
".LANINS_033." | |
| ".LANINS_034." | ||
| ".LANINS_105." | ||
| ".LANINS_014." | {$perms_errors} | {$perms_notes} |
| ".LANINS_015." | {$php_version} | {$php_help} |
| ".LANINS_016." | {$mysql_note} | {$mysql_help} |
| ".LANINS_050." | ".($xml_installed ? LANINS_051 : LANINS_052)." | ".($xml_installed ? LANINS_017 : LANINS_053."php.net".LANINS_054)." |
| previous_steps['admin']['user'] : "")."' maxlength='60' /> | ".LANINS_073." | |
| previous_steps['admin']['display'] : "")."' maxlength='60' /> | ".LANINS_075." | |
| ".LANINS_077." | ||
| ".LANINS_079." | ||
| previous_steps['admin']['email'] : LANINS_082)."' maxlength='100' /> | ".LANINS_081." |
[/center]')");
$this->dbqry("INSERT INTO {$this->previous_steps['mysql']['prefix']}page VALUES (1, '', '[img]{e_IMAGE}pcmag.png[/img] ', 0, 1145843485, 0, 0, '', '', '', 'PCMag')");
// Create the admin user
$ip = $_SERVER['REMOTE_ADDR'];
$userp = "1, '{$this->previous_steps['admin']['display']}', '{$this->previous_steps['admin']['user']}', '', '".md5($this->previous_steps['admin']['password'])."', '', '{$this->previous_steps['admin']['email']}', '', '', 0, ".time().", 0, 0, 0, 0, 0, '{$ip}', 0, '', 0, 1, '', '', '0', '', ".time().", ''";
$this->dbqry("INSERT INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})" );
mysql_close();
return false;
}
function write_config($data)
{
$fp = @fopen("e107_config.php", "w");
if (!@fwrite($fp, $data))
{
@fclose ($fp);
return nl2br(LANINS_070);
}
@fclose ($fp);
return false;
}
function dbqry($qry)
{
mysql_query($qry);
if(mysql_errno())
{
$this->debug_db_info['db_error_log'][] = 'Query Error [#'.mysql_errno().']: '.mysql_error()."\nQuery: {$qry}";
//$this->debug_db_info['db_log'][] = $qry;
return false;
}
//$this->debug_db_info['db_log'][] = $qry;
return true;
}
}
class e_forms {
var $form;
var $opened;
function start_form($id, $action, $method = "post" )
{
$this->form = "\n\n";
}
$this->opened = false;
return $this->form;
}
}
function create_tables_unattended()
{
//If username or password not specified, exit
if(!isset($_GET['username']) || !isset($_GET['password']))
{
return false;
}
@include('e107_config.php');
//If mysql info not set, config file is not created properly
if(!isset($mySQLuser) || !isset($mySQLpassword) || !isset($mySQLdefaultdb) || !isset($mySQLprefix))
{
return false;
}
// If specified username and password does not match the ones in config, exit
if($_GET['username'] !== $mySQLuser || $_GET['password'] !== $mySQLpassword)
{
return false;
}
$einstall = new e_install;
$einstall->previous_steps['mysql']['server'] = $mySQLserver;
$einstall->previous_steps['mysql']['user'] = $mySQLuser;
$einstall->previous_steps['mysql']['password'] = $mySQLpassword;
$einstall->previous_steps['mysql']['db'] = $mySQLdefaultdb;
$einstall->previous_steps['mysql']['prefix'] = $mySQLprefix;
$einstall->previous_steps['language'] = (isset($_GET['language']) ? $_GET['language'] : 'English');
$einstall->previous_steps['admin']['display'] = (isset($_GET['admin_display']) ? $_GET['admin_display'] : 'admin');
$einstall->previous_steps['admin']['user'] = (isset($_GET['admin_user']) ? $_GET['admin_user'] : 'admin');
$einstall->previous_steps['admin']['password'] = (isset($_GET['admin_password']) ? $_GET['admin_password'] : 'admin_password');
$einstall->previous_steps['admin']['email'] = (isset($_GET['admin_email']) ? $_GET['admin_email'] : 'admin_email@xxx.com');
@include_once("./{$HANDLERS_DIRECTORY}e107_class.php");
$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'CACHE_DIRECTORY', 'DOWNLOADS_DIRECTORY', 'UPLOADS_DIRECTORY');
$e107 = e107::getInstance();
$e107->_init($e107_paths, realpath(dirname(__FILE__)));
$einstall->e107 = &$e107;
$einstall->create_tables();
return true;
}
class SimpleTemplate
{
var $Tags = array();
var $open_tag = "{";
var $close_tag = "}";
function SimpleTemplate()
{
define("TEMPLATE_TYPE_FILE", 0);
define("TEMPLATE_TYPE_DATA", 1);
}
function SetTag($TagName, $Data)
{
$this->Tags[$TagName] = array( 'Tag' => $TagName,
'Data' => $Data
);
}
function RemoveTag($TagName)
{
unset($this->Tags[$TagName]);
}
function ClearTags()
{
$this->Tags = array();
}
function ParseTemplate($Template, $template_type = TEMPLATE_TYPE_FILE)
{
if($template_type == TEMPLATE_TYPE_DATA)
{
$TemplateData = $Template;
}
else
{
$TemplateData = file_get_contents($Template);
}
foreach ($this->Tags as $Tag)
{
$TemplateData = str_replace($this->open_tag.$Tag['Tag'].$this->close_tag, $Tag['Data'], $TemplateData);
}
return $TemplateData;
}
}
function template_data()
{
$data = "