Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../var/softacul.../sugar
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;
[56] Fix | Delete
[57] Fix | Delete
$query = "SELECT user_name FROM users WHERE `title` = 'Administrator';";
[58] Fix | Delete
$result = sdb_query($query, $__settings['softdbhost'], $__settings['softdbuser'], $__settings['softdbpass'], $__settings['softdb']);
[59] Fix | Delete
$username = $result[0]['user_name'];
[60] Fix | Delete
[61] Fix | Delete
if(empty($username)){
[62] Fix | Delete
$error[] = "Could not get the admin username.";
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
// this zip can be only used for upgrade from 6.5.0 to 6.5.17
[66] Fix | Delete
// please do not forget to change zip filename
[67] Fix | Delete
scopy($software['path'].'/SugarCE-Upgrade-6.5.x-to-6.5.17.zip', $__settings['softpath'].'/upload/SugarCE-Upgrade-6.5.x-to-6.5.17.zip');
[68] Fix | Delete
swrite($__settings['softpath'].'/soft.log', '', 1);
[69] Fix | Delete
[70] Fix | Delete
// please do not forget to change zip filename
[71] Fix | Delete
sshell_exec('"'.phpbin().'" -f '.$__settings['softpath'].'/modules/UpgradeWizard/silentUpgrade.php '.$__settings['softpath'].'/upload/SugarCE-Upgrade-6.5.x-to-6.5.17.zip '.$__settings['softpath'].'/soft.log '.$__settings['softpath'].' '.$username);
[72] Fix | Delete
[73] Fix | Delete
$query = "SELECT value FROM config WHERE `name` = 'sugar_version';";
[74] Fix | Delete
$result = sdb_query($query, $__settings['softdbhost'], $__settings['softdbuser'], $__settings['softdbpass'], $__settings['softdb']);
[75] Fix | Delete
$newversion = $result[0]['value'];
[76] Fix | Delete
[77] Fix | Delete
if($newversion != $software['ver']){
[78] Fix | Delete
$error[] = "Could not upgrade the database";
[79] Fix | Delete
}
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
//Check whether the Minimum Software configuration matches
[83] Fix | Delete
function __requirements(){
[84] Fix | Delete
[85] Fix | Delete
global $__settings, $error, $software, $globals;
[86] Fix | Delete
//If there are some shorfalls then pass it to $error and return false
[87] Fix | Delete
[88] Fix | Delete
if($globals['softpanel'] == 'ampps'){
[89] Fix | Delete
$error[] = "Upgrade is not possible through AMPPS";
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
if(!function_exists('shell_exec')){
[93] Fix | Delete
$error[] = "Upgrade requires shell_exec to be enabled on your server";
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
if(sversion_compare($__settings['ver'], '6.5.0', '<')){
[97] Fix | Delete
$error[] = "Upgrade is possible from version 6.5.0";
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
return true;
[101] Fix | Delete
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
[105] Fix | Delete
?>
[106] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function