$v){
if(preg_match('/\$config\[("|\')default_host("|\')\](\s*?)=(\s*?)("|\')(.*?)("|\');/is',$v)){
$file[$k] = '$config[\'imap_host\'] = \''.$imap_host.'\';';
}
if(preg_match('/\$config\[("|\')smtp_server("|\')\](\s*?)=(\s*?)("|\')(.*?)("|\');/is',$v)){
$file[$k] = '$config[\'smtp_host\'] = \''.$smtp_host.'\';';
}
}
swrite($__settings['softpath'].'/config/config.inc.php', implode("\n",$file), 1);
}
$notes = 'Complete the upgrade process by visiting upgrade URL and then please remove the following folder: '.$__settings['softpath'].'/installer
and set the value for $config[\'enable_installer\'] = false in '.$__settings['softpath'].'/config/config.inc.php';
$setupcontinue = 'installer';
}
}
//Check whether the Minimum Software configuration matches
function __requirements(){
global $__settings, $error, $software, $globals;
//If there are some shorfalls then pass it to $error and return false
if($globals['os'] == 'windows' && sversion_compare($__settings['ver'], '1.0.0', '<')){
$error[] = 'It is not possible to upgrade RoundCube on Windows.';
return false;
}
// We need the user to create backup
if(!sis_autoupgrading() && !checkbox('create_backup') && !checkbox('force_upgrade')){
$error[] = 'It seems you have not chosen to back up your installation. Please choose the Create Backup checkbox to create a backup before upgrading.
Continue anyway ?';
return false;
}
if(!function_exists('exec') && sversion_compare($__settings['ver'], '1.0.0', '<')){
$error[] = 'exec() function is required to Upgrade RoundCube';
}
return true;
}
//===========================
// Software Vendors Functions
//===========================
//Just Validate an email
function __email_address($email){
global $error;
if(!emailvalidation($email)){
$error[] = '{{err_wrongemail}}';
}
return $email;
}
?>