Пример #1
0
 /**
  * Login to the depot
  * 
  * @return true if successful, false otherwise
  */
 function login($terms_checked = true)
 {
     if (empty($_SESSION['SugarDepotSessionID'])) {
         global $license;
         $GLOBALS['log']->debug("Begin SugarDepot Login");
         PackageManagerComm::initialize(false);
         require 'sugar_version.php';
         require 'config.php';
         $credentials = PackageManager::getCredentials();
         if (empty($license)) {
             loadLicense();
         }
         $info = sugarEncode('2813', serialize(getSystemInfo(true)));
         $pm = new PackageManager();
         $installed = $pm->buildInstalledReleases();
         $installed = base64_encode(serialize($installed));
         $params = array('installed_modules' => $installed, 'terms_checked' => $terms_checked, 'system_name' => $credentials['system_name']);
         $terms_version = !empty($_SESSION['SugarDepot_TermsVersion']) ? $_SESSION['SugarDepot_TermsVersion'] : '';
         if (!empty($terms_version)) {
             $params['terms_version'] = $terms_version;
         }
         $result = $GLOBALS['SugarDepot']->call('depotLogin', array(array('user_name' => $credentials['username'], 'password' => $credentials['password']), 'info' => $info, 'params' => $params));
         PackageManagerComm::errorCheck();
         if (!is_array($result)) {
             $_SESSION['SugarDepotSessionID'] = $result;
         }
         $GLOBALS['log']->debug("End SugarDepot Login");
         return $result;
     } else {
         return $_SESSION['SugarDepotSessionID'];
     }
 }
Пример #2
0
function check_now($send_usage_info = true, $get_request_data = false, $response_data = false, $from_install = false)
{
    global $sugar_config, $timedate;
    global $db, $license;
    $return_array = array();
    if (!$from_install && empty($license)) {
        loadLicense(true);
    }
    if (!$response_data) {
        if ($from_install) {
            $info = getBaseSystemInfo(false);
        } else {
            $info = getSystemInfo($send_usage_info);
        }
        require_once 'include/nusoap/nusoap.php';
        $GLOBALS['log']->debug('USING HTTPS TO CONNECT TO HEARTBEAT');
        $sclient = new nusoapclient('https://updates.sugarcrm.com/heartbeat/soap.php', false, false, false, false, false, 15, 15);
        $ping = $sclient->call('sugarPing', array());
        if (empty($ping) || $sclient->getError()) {
            $sclient = '';
        }
        if (empty($sclient)) {
            $GLOBALS['log']->debug('USING HTTP TO CONNECT TO HEARTBEAT');
            $sclient = new nusoapclient('http://updates.sugarcrm.com/heartbeat/soap.php', false, false, false, false, false, 15, 15);
        }
        $key = '4829482749329';
        $encoded = sugarEncode($key, serialize($info));
        if ($get_request_data) {
            $request_data = array('key' => $key, 'data' => $encoded);
            return serialize($request_data);
        }
        $encodedResult = $sclient->call('sugarHome', array('key' => $key, 'data' => $encoded));
    } else {
        $encodedResult = $response_data['data'];
        $key = $response_data['key'];
    }
    if ($response_data || !$sclient->getError()) {
        $serializedResultData = sugarDecode($key, $encodedResult);
        $resultData = unserialize($serializedResultData);
        if ($response_data && empty($resultData)) {
            $resultData = array();
            $resultData['validation'] = 'invalid validation key';
        }
    } else {
        $resultData = array();
        $resultData['versions'] = array();
    }
    if ($response_data || !$sclient->getError()) {
        if (!empty($resultData['msg'])) {
            if (!empty($resultData['msg']['admin'])) {
                $license->saveSetting('license', 'msg_admin', base64_encode($resultData['msg']['admin']));
            } else {
                $license->saveSetting('license', 'msg_admin', '');
            }
            if (!empty($resultData['msg']['all'])) {
                $license->saveSetting('license', 'msg_all', base64_encode($resultData['msg']['all']));
            } else {
                $license->saveSetting('license', 'msg_all', '');
            }
        } else {
            $license->saveSetting('license', 'msg_admin', '');
            $license->saveSetting('license', 'msg_all', '');
        }
        $license->saveSetting('license', 'last_validation', 'success');
        unset($_SESSION['COULD_NOT_CONNECT']);
    } else {
        $resultData = array();
        $resultData['versions'] = array();
        $license->saveSetting('license', 'last_connection_fail', TimeDate::getInstance()->nowDb());
        $license->saveSetting('license', 'last_validation', 'no_connection');
        if (empty($license->settings['license_last_validation_success']) && empty($license->settings['license_last_validation_fail']) && empty($license->settings['license_vk_end_date'])) {
            $license->saveSetting('license', 'vk_end_date', TimeDate::getInstance()->nowDb());
            $license->saveSetting('license', 'validation_key', base64_encode(serialize(array('verified' => false))));
        }
        $_SESSION['COULD_NOT_CONNECT'] = TimeDate::getInstance()->nowDb();
    }
    if (!empty($resultData['versions'])) {
        $license->saveSetting('license', 'latest_versions', base64_encode(serialize($resultData['versions'])));
    } else {
        $resultData['versions'] = array();
        $license->saveSetting('license', 'latest_versions', '');
    }
    include 'sugar_version.php';
    if (sizeof($resultData) == 1 && !empty($resultData['versions'][0]['version']) && $resultData['versions'][0]['version'] < $sugar_version) {
        $resultData['versions'][0]['version'] = $sugar_version;
        $resultData['versions'][0]['description'] = "You have the latest version.";
    }
    return $resultData['versions'];
}
Пример #3
0
<?php

include "functions.php";
include "display.php";
$lscan = getLScan($_GET['key']);
$lscaninfo = getLScanInfo($_GET['key']);
$assocs = json_encode($lscan['assocs']);
$system = getSystemInfo($lscaninfo['system']);
//Process system text
if ($system != null) {
    if ($system['security'] <= 0) {
        $secClass = "sec-0-0";
    } else {
        $sec = str_replace(".", "-", $system['security']);
        $secClass = "sec-" . $sec;
    }
    $systemtext = "<span class='" . $secClass . "' style='margin-right: 4px;'>" . $system['security'] . "</span> " . $system['solarSystemName'] . " <span class='system-details'>&lt; " . $system['constellationName'] . " &lt; " . $system['regionName'] . "</span><br />";
}
//saveHit();
?>
<head>
    <title>EVE Tools - Localscan - viewing local<?php 
if ($system != null) {
    echo " [" . $system['solarSystemName'] . "]";
}
?>
</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">