Example #1
0
    rebuildSprites(true);
}
require_once 'modules/Administration/upgrade_custom_relationships.php';
upgrade_custom_relationships();
require_once 'modules/UpgradeWizard/uw_utils.php';
/*
if($_SESSION['current_db_version'] < '620')
{
	upgradeDateTimeFields($path);
	upgradeDocumentTypeFields($path);
}
*/
//Update the license
logThis('Start Updating the license ', $path);
ob_start();
check_now(get_sugarbeat());
ob_end_clean();
logThis('End Updating the license ', $path);
set_upgrade_progress('end', 'done');
logThis('Cleaning up the session.  Goodbye.');
unlinkUWTempFiles();
logThis('Cleaning up the session.  Goodbye.');
resetUwSession();
// flag to say upgrade has completed
$_SESSION['upgrade_complete'] = true;
//Clear any third party caches
sugar_cache_reset_full();
//add the clean vardefs here
if (!class_exists('VardefManager')) {
}
VardefManager::clearVardef();
Example #2
0
function loginLicense()
{
    global $current_user, $license, $authLevel;
    loadLicense(true);
    $authLevel = 0;
    if (shouldCheckSugar()) {
        $last_check_date = get_last_check_date_config_setting();
        $current_date_time = time();
        $time_period = 3 * 23 * 3600;
        if ($current_date_time - $last_check_date > $time_period) {
            $version = check_now(get_sugarbeat());
            unset($_SESSION['license_seats_needed']);
            loadLicense();
            set_last_check_date_config_setting("{$current_date_time}");
            include 'sugar_version.php';
            if (!empty($version) && count($version) == 1 && $version[0]['version'] > $sugar_version && is_admin($current_user)) {
                //set session variables.
                $_SESSION['available_version'] = $version[0]['version'];
                $_SESSION['available_version_description'] = $version[0]['description'];
                set_last_check_version_config_setting($version[0]['version']);
            }
        }
    }
}
Example #3
0
if (isset($GLOBALS['sugar_config']['hide_admin_licensing']) && $GLOBALS['sugar_config']['hide_admin_licensing']) {
    sugar_die(translate('LBL_LICENSE_UNAUTHORIZED_ACCESS', 'Administration'));
}
if (isset($_REQUEST['validate'])) {
    checkDownloadKey();
}
$focus = Administration::getSettings();
if (!empty($_FILES['VKFile'])) {
    $response_data = array();
    $response_data['key'] = $focus->settings['license_key'];
    $response_data['data'] = file_get_contents($_FILES['VKFile']['tmp_name']);
    check_now(false, true, $response_data);
    $focus->retrieveSettings(false, true);
}
if (!empty($_REQUEST['exportKey'])) {
    $content = check_now(get_sugarbeat(), true);
    header("Content-Disposition: attachment; filename=sugarkey.lic");
    header("Content-Type: text/plain; charset={$app_strings['LBL_CHARSET']}");
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . TimeDate::httpTime());
    header("Cache-Control: max-age=0");
    header("Pragma: public");
    header("Content-Length: " . strlen($content));
    echo $content;
    die;
}
echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", $mod_strings['LBL_MANAGE_LICENSE_TITLE']), false);
global $currentModule;
$GLOBALS['log']->info("Administration LicenseSettings view");
$xtpl = new XTemplate('modules/Administration/LicenseSettings.html');
$xtpl->assign("MOD", $mod_strings);
Example #4
0
function loginLicense()
{
    global $current_user, $license;
    loadLicense(true);
    if (isset($_SESSION['EXCEEDS_MAX_USERS']) && $_SESSION['EXCEEDS_MAX_USERS'] == 1 || empty($license->settings['license_key']) || !empty($license->settings['license_last_validation']) && $license->settings['license_last_validation'] == 'failed' && !empty($license->settings['license_last_validation_fail']) && (empty($license->settings['license_last_validation_success']) || $license->settings['license_last_validation_fail'] > $license->settings['license_last_validation_success'])) {
        if (!is_admin($current_user)) {
            $GLOBALS['login_error'] = $GLOBALS['app_strings']['ERROR_LICENSE_VALIDATION'];
            $_SESSION['login_error'] = $GLOBALS['login_error'];
        } else {
            if (empty($license->settings['license_key'])) {
                $_SESSION['VALIDATION_EXPIRES_IN'] = 'REQUIRED';
            } else {
                $_SESSION['COULD_NOT_CONNECT'] = $license->settings['license_last_validation_fail'];
            }
        }
    }
    if (shouldCheckSugar()) {
        $last_check_date = get_last_check_date_config_setting();
        $current_date_time = time();
        $time_period = 3 * 23 * 3600;
        if ($current_date_time - $last_check_date > $time_period || empty($license->settings['license_last_validation_success'])) {
            $version = check_now(get_sugarbeat());
            unset($_SESSION['license_seats_needed']);
            unset($_SESSION['LICENSE_EXPIRES_IN']);
            unset($_SESSION['VALIDATION_EXPIRES_IN']);
            unset($_SESSION['HomeOnly']);
            loadLicense();
            set_last_check_date_config_setting("{$current_date_time}");
            include 'sugar_version.php';
            $newVersion = '';
            if (!empty($version) && count($version) == 1) {
                $newVersion = $version[0]['version'];
            }
            if (version_compare($newVersion, $sugar_version, '>') && is_admin($current_user)) {
                //set session variables.
                $_SESSION['available_version'] = $version[0]['version'];
                $_SESSION['available_version_description'] = $version[0]['description'];
                set_last_check_version_config_setting($version[0]['version']);
            }
        }
    }
    // This section of code is a portion of the code referred
    // to as Critical Control Software under the End User
    // License Agreement.  Neither the Company nor the Users
    // may modify any portion of the Critical Control Software.
    if (!authenticateDownloadKey() && !ocLicense()) {
        if (is_admin($current_user)) {
            $_SESSION['HomeOnly'] = true;
        } else {
            $_SESSION['login_error'] = $GLOBALS['app_strings']['ERROR_LICENSE_VALIDATION'];
            $GLOBALS['login_error'] = $GLOBALS['app_strings']['ERROR_LICENSE_VALIDATION'];
        }
    }
    //END REQUIRED CODE DO NOT MODIFY
}
Example #5
0
if (isset($_REQUEST['useraction']) && ($_REQUEST['useraction'] == 'Save' || $_REQUEST['useraction'] == 'CheckNow')) {
    if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'automatic') {
        set_CheckUpdates_config_setting('automatic');
    } else {
        set_CheckUpdates_config_setting('manual');
    }
    $beat = false;
    if (!empty($_REQUEST['beat'])) {
        $beat = true;
    }
    if ($beat != get_sugarbeat()) {
        set_sugarbeat($beat);
    }
}
echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", $mod_strings['LBL_SUGAR_UPDATE_TITLE']), false);
if (get_sugarbeat()) {
    $xtpl->assign("SEND_STAT_CHECKED", "checked");
}
if (get_CheckUpdates_config_setting() == 'automatic') {
    $xtpl->assign("AUTOMATIC_CHECKED", "checked");
}
/*if (isset($_REQUEST['useraction']) && $_REQUEST['useraction']=='CheckNow') {
	check_now(get_sugarbeat());
	loadLicense();

}*/
$xtpl->parse('main.stats');
$has_updates = false;
if (!empty($license->settings['license_latest_versions'])) {
    $encodedVersions = $license->settings['license_latest_versions'];
    $versions = unserialize(base64_decode($encodedVersions));