Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../var/softacul.../webid
File: _upgrade.php
<?php
[0] Fix | Delete
[1] Fix | Delete
//////////////////////////////////////////////////////////////
[2] Fix | Delete
//===========================================================
[3] Fix | Delete
// upgrade.php(For individual softwares)
[4] Fix | Delete
//===========================================================
[5] Fix | Delete
// SOFTACULOUS
[6] Fix | Delete
// Version : 1.0
[7] Fix | Delete
// Inspired by the DESIRE to be the BEST OF ALL
[8] Fix | Delete
// ----------------------------------------------------------
[9] Fix | Delete
// Started by: Alons
[10] Fix | Delete
// Date: 10th Jan 2009
[11] Fix | Delete
// Time: 21:00 hrs
[12] Fix | Delete
// Site: http://www.softaculous.com/ (SOFTACULOUS)
[13] Fix | Delete
// ----------------------------------------------------------
[14] Fix | Delete
// Please Read the Terms of use at http://www.softaculous.com
[15] Fix | Delete
// ----------------------------------------------------------
[16] Fix | Delete
//===========================================================
[17] Fix | Delete
// (c)Softaculous Inc.
[18] Fix | Delete
//===========================================================
[19] Fix | Delete
//////////////////////////////////////////////////////////////
[20] Fix | Delete
[21] Fix | Delete
if(!defined('SOFTACULOUS')){
[22] Fix | Delete
[23] Fix | Delete
die('Hacking Attempt');
[24] Fix | Delete
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
/////////////////////////////////////////
[28] Fix | Delete
// All functions in this PAGE must begin
[29] Fix | Delete
// with TWO UNDERSCORE '__' to avoid
[30] Fix | Delete
// clashes with SOFTACULOUS Functions
[31] Fix | Delete
// e.g. __funcname()
[32] Fix | Delete
/////////////////////////////////////////
[33] Fix | Delete
[34] Fix | Delete
//////////////////////////////////////////
[35] Fix | Delete
// Note : The path of the upgrade package
[36] Fix | Delete
// is $software['path'].'/' . So to
[37] Fix | Delete
// access other files use
[38] Fix | Delete
// $software['path'].'/other_file.ext'
[39] Fix | Delete
//////////////////////////////////////////
[40] Fix | Delete
[41] Fix | Delete
// NOTE: $__settings will contain the installation information like PATH, URL. They are :
[42] Fix | Delete
// $__settings['ver'] - The version of the current installation
[43] Fix | Delete
// $__settings['itime'] - When the software was installed
[44] Fix | Delete
// $__settings['softpath'] - The current PATH
[45] Fix | Delete
// $__settings['softurl'] - The URL of the software
[46] Fix | Delete
// IF database was made by Softaclous
[47] Fix | Delete
// $__settings['softdb'] - The Database name
[48] Fix | Delete
// $__settings['softdbuser'] - Database User
[49] Fix | Delete
// $__settings['softdbhost'] - Database Host
[50] Fix | Delete
// $__settings['softdbpass'] - Database Password
[51] Fix | Delete
[52] Fix | Delete
//The Upgrade process
[53] Fix | Delete
function __upgrade($version_from){
[54] Fix | Delete
[55] Fix | Delete
global $__settings, $error, $software, $globals, $setupcontinue;
[56] Fix | Delete
[57] Fix | Delete
// There upgrade utility doesn't work for version 1.1.1 to 1.1.2. So we have added this procedure by refring to their forum
[58] Fix | Delete
// http://www.webidsupport.com/forums/showthread.php?8357-Upgrade-from-1-1-1-to-1-1-2-stop-in-step-2&p=43363&viewfull=1#post43363
[59] Fix | Delete
// http://www.webidsupport.com/forums/showthread.php?8362-Version-change-not-showing&p=43394&viewfull=1#post43394
[60] Fix | Delete
if(sversion_compare($__settings['ver'], '1.1.1', '==') && $software['ver'] == '1.1.2'){
[61] Fix | Delete
// We need the Database Prefix to make upgrade query
[62] Fix | Delete
$file = sfile($__settings['softpath'].'/includes/config.inc.php');
[63] Fix | Delete
[64] Fix | Delete
if(empty($file)){
[65] Fix | Delete
$error[] = 'Could not read the config file to get the database prefix.';
[66] Fix | Delete
return false;
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
preg_replace('/'.preg_quote('$DbHost', '/').'(\s*?)=(\s*?)("|\')(.*?)("|\')(\s*?);/ies', '$r[\'softdbhost\'] = trim(\'$4\')', $file);
[70] Fix | Delete
[71] Fix | Delete
preg_replace('/'.preg_quote('$DbUser', '/').'(\s*?)=(\s*?)("|\')(.*?)("|\')(\s*?);/ies', '$r[\'softdbuser\'] = trim(\'$4\')', $file);
[72] Fix | Delete
[73] Fix | Delete
preg_replace('/'.preg_quote('$DbPassword', '/').'(\s*?)=(\s*?)("|\')(.*?)("|\')(\s*?);/ies', '$r[\'softdbpass\'] = trim(\'$4\')', $file);
[74] Fix | Delete
[75] Fix | Delete
preg_replace('/'.preg_quote('$DbDatabase', '/').'(\s*?)=(\s*?)("|\')(.*?)("|\')(\s*?);/ies', '$r[\'softdb\'] = trim(\'$4\')', $file);
[76] Fix | Delete
[77] Fix | Delete
preg_replace('/'.preg_quote('$DBPrefix', '/').'(\s*?)=(\s*?)("|\')(.*?)("|\')(\s*?);/ies', '$prefix = trim(\'$4\')', $file);
[78] Fix | Delete
[79] Fix | Delete
$result = sdb_query("UPDATE `".$prefix."settings` SET `version` = '1.1.2' WHERE `version` = '1.1.1';", $r['softdbhost'], $r['softdbuser'], $r['softdbpass'], $r['softdb']);
[80] Fix | Delete
[81] Fix | Delete
$setupcontinue = '';
[82] Fix | Delete
srm($__settings['softpath'].'/install/');
[83] Fix | Delete
[84] Fix | Delete
}else{
[85] Fix | Delete
[86] Fix | Delete
//CHMOD
[87] Fix | Delete
@schmod($__settings['softpath'].'/includes/membertypes.inc.php', $globals['ofc']);
[88] Fix | Delete
@schmod($__settings['softpath'].'/language/EN/categories.inc.php', $globals['ofc']);
[89] Fix | Delete
@schmod($__settings['softpath'].'/language/EN/categories_select_box.inc.php', $globals['ofc']);
[90] Fix | Delete
@schmod($__settings['softpath'].'/cache/', $globals['odc']);
[91] Fix | Delete
@schmod($__settings['softpath'].'/uploaded/', $globals['odc']);
[92] Fix | Delete
@schmod($__settings['softpath'].'/uploaded/banners/', $globals['odc']);
[93] Fix | Delete
@schmod($__settings['softpath'].'/uploaded/cache/', $globals['odc']);
[94] Fix | Delete
}
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
//Check whether the Minimum Software configuration matches
[98] Fix | Delete
function __requirements(){
[99] Fix | Delete
[100] Fix | Delete
global $__settings, $error, $software;
[101] Fix | Delete
[102] Fix | Delete
//If there are some shorfalls then pass it to $error and return false
[103] Fix | Delete
[104] Fix | Delete
return true;
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
//The Upgrade Files
[108] Fix | Delete
function __pre_unzip(){
[109] Fix | Delete
[110] Fix | Delete
global $__settings, $error, $software, $globals, $__delete_folders, $__delete_files;
[111] Fix | Delete
[112] Fix | Delete
__deleteUnexistingFiles();
[113] Fix | Delete
[114] Fix | Delete
foreach($__delete_folders as $dk => $dv){
[115] Fix | Delete
@srm($__settings['softpath'].$dv);
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
foreach($__delete_files as $fk => $fv){
[119] Fix | Delete
@srm($__settings['softpath'].$fv);
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
// To rebuild installation.php
[123] Fix | Delete
sfileindex($software['path'].'/fileindex.php');
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
// This is taken from install/scripts/1.2.1.php
[127] Fix | Delete
function __deleteUnexistingFiles(){
[128] Fix | Delete
[129] Fix | Delete
global $__delete_folders, $__delete_files;
[130] Fix | Delete
[131] Fix | Delete
$__delete_files = array(
[132] Fix | Delete
'/admin/bar.php',
[133] Fix | Delete
'/inc/calendar.css',
[134] Fix | Delete
'/inc/img/cal.gif',
[135] Fix | Delete
'/inc/img/next_mon.gif',
[136] Fix | Delete
'/inc/img/next_year.gif',
[137] Fix | Delete
'/inc/img/no_cal.gif',
[138] Fix | Delete
'/inc/img/pixel.gif',
[139] Fix | Delete
'/inc/img/prev_mon.gif',
[140] Fix | Delete
'/inc/img/prev_year.gif',
[141] Fix | Delete
'/inc/img/shade_bl.png',
[142] Fix | Delete
'/inc/img/shade_bm.png',
[143] Fix | Delete
'/inc/img/shade_br.png',
[144] Fix | Delete
'/inc/img/shade_mr.png',
[145] Fix | Delete
'/inc/img/shade_tr.png',
[146] Fix | Delete
'/includes/class_db_handle.php',
[147] Fix | Delete
'/includes/class_template_compile.php',
[148] Fix | Delete
'/includes/class_user.php',
[149] Fix | Delete
'/includes/converter.inc.php',
[150] Fix | Delete
'/includes/countries.inc.php',
[151] Fix | Delete
'/includes/currencies.php',
[152] Fix | Delete
'/includes/email_auction_confirmation.php',
[153] Fix | Delete
'/includes/email_endauction_cumulative.php',
[154] Fix | Delete
'/includes/email_endauction_nowinner.php',
[155] Fix | Delete
'/includes/email_endauction_winner.php',
[156] Fix | Delete
'/includes/email_endauction_youwin.php',
[157] Fix | Delete
'/includes/email_endauction_youwin_nodutch.php',
[158] Fix | Delete
'/includes/email_outbid.php',
[159] Fix | Delete
'/includes/email_user_approved.php',
[160] Fix | Delete
'/includes/email_user_confirmation.php',
[161] Fix | Delete
'/includes/email_user_needapproval.php',
[162] Fix | Delete
'/includes/htmLawed.php',
[163] Fix | Delete
'/includes/template.php',
[164] Fix | Delete
'/includes/useragent.inc.php',
[165] Fix | Delete
'/js/calendar.php',
[166] Fix | Delete
'/js/google_converter.js',
[167] Fix | Delete
'/js/jquery.dimensions.js',
[168] Fix | Delete
'/captcha.php',
[169] Fix | Delete
'/captcha_play.php',
[170] Fix | Delete
'/converter.php',
[171] Fix | Delete
'/loader.php',
[172] Fix | Delete
'/includes/functions_rebuild.php',
[173] Fix | Delete
'/includes/membertypes.inc.php',
[174] Fix | Delete
);
[175] Fix | Delete
[176] Fix | Delete
// Delete folders
[177] Fix | Delete
$__delete_folders = array(
[178] Fix | Delete
'/fck',
[179] Fix | Delete
'/ckeditor',
[180] Fix | Delete
'/inc/captcha',
[181] Fix | Delete
'/includes/captcha',
[182] Fix | Delete
'/inc/checks',
[183] Fix | Delete
'/inc/flags',
[184] Fix | Delete
'/includes/flags',
[185] Fix | Delete
'/inc/plupload',
[186] Fix | Delete
'/themes/admin',
[187] Fix | Delete
'/themes/default',
[188] Fix | Delete
);
[189] Fix | Delete
}
[190] Fix | Delete
[191] Fix | Delete
?>
[192] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function