Exemple #1
0
    //sApp()
    $this->yeager_version = $versionp;
    //$this->yeager_revision = YEAGER_REVISION;
    //$this->yeager_date = YEAGER_DATE;
    $databaseInfo = sConfig()->getVars('CONFIG/DB');
    $databaseHost = $databaseInfo[0]['host'];
    $databaseHost = explode(':', $databaseHost);
    if (count($databaseHost) > 1) {
        $databasePort = $databaseHost[1];
        $databaseHost = $databaseHost[0];
    } else {
        $databasePort = '3306';
        $databaseHost = $databaseHost[0];
    }
    $_SESSION['APPINFO'] = array('VERSION' => $this->yeager_version, 'REVISION' => $this->yeager_revision, 'DATABASE_SERVER' => $databaseHost, 'DATABASE_PORT' => $databasePort, 'DATABASE_USER' => $databaseInfo[0]['user'], 'DATABASE_PASSWORD' => $databaseInfo[0]['password'], 'DATABASE_NAME' => $databaseInfo[0]['db'], 'PATH_BASE' => dirname($_SERVER['SCRIPT_FILENAME']) . '/');
    $updateMgr = new Updater();
    $updates = $updateMgr->getUpdates();
    $currVersion = $updateMgr->current_version_string;
    $currRevision = $this->yeager_revision;
    //$currDate = explode('-', substr(YEAGER_DATE, 6, 11));
    //$currDate = gmmktime(0, 0, 0, $currDate[1], $currDate[2], $currDate[0]);
    $currDate = '';
}
$winID = $this->request->parameters['win_no'];
$smarty->assign("adminAllowed", $adminAllowed);
$smarty->assign("win_no", $winID);
$smarty->assign("updates", $updates);
$smarty->assign("current_version", $currVersion);
$smarty->assign("current_revision", $currRevision);
$smarty->assign("current_date", $currDate);
$smarty->display('file:' . $this->page_template);
Exemple #2
0
<?php

$jsQueue = new JSQueue(NULL);
switch ($action) {
    case 'checkUpdates':
        $winID = $this->params['winID'];
        $updateMgr = new Updater();
        $currentUpdates = $updateMgr->getUpdates();
        if (count($currentUpdates)) {
            $newVersionNo = $currentUpdates[0]['VERSION'];
            $newVersionDate = date($itext['DATE_FORMAT'], $currentUpdates[0]['DATE']);
            $newVersionText = $itext['TXT_NEW_UPDATE_AVAILABLE'];
            $koala->queueScript('Koala.yg_updaterNewVersion(\'' . $winID . '\', \'' . $newVersionNo . '\', \'' . $newVersionDate . '\', \'' . $newVersionText . '\');');
        }
        break;
    case 'updateInstalled':
        $updatePath = $this->approot . sConfig()->getVar('CONFIG/DIRECTORIES/UPDATES');
        $revision = $this->params['revision'];
        $matchingUpdates = glob($updatePath . 'yeager_*_r' . $revision . '.php');
        if (count($matchingUpdates) > 0) {
            foreach ($matchingUpdates as $matchingUpdate) {
                @unlink($matchingUpdate);
            }
        }
        break;
    case 'installUpdate':
        $installRevision = $this->params['installRevision'];
        $sigStart = "-----BEGIN YEAGER SIGNATURE-----\n";
        $sigEnd = "-----END YEAGER SIGNATURE-----";
        // Download, verify and trigger update installation
        $updatesDirectory = $this->approot . sConfig()->getVar('CONFIG/DIRECTORIES/UPDATES');