Esempio n. 1
0
        $sErrors[] = array("result" => "Automatic updates have been turned off.", "type" => "success");
    }
}
if ($sAction == force) {
    $sSSH = new Net_SSH2('127.0.0.1');
    $sKey = new Crypt_RSA();
    $sKey->loadKey(file_get_contents($cphp_config->settings->rootkey));
    if ($sSSH->login("root", $sKey)) {
        $sOldVersion = file_get_contents('/var/feathur/version.txt');
        $sSSH->exec("cd /var/feathur/; git reset --hard; git pull; cd /var/feathur/feathur/; php update.php; rm -rf update.php;");
        $sVersion = file_get_contents('/var/feathur/version.txt');
        $sLastUpdate = Core::UpdateSetting('last_update_check', time());
        $sCurrentVersion = file_get_contents('/var/feathur/version.txt');
        if ($sCurrentVersion != $sOldVersion) {
            $sErrors[] = array("result" => "Force update completed.", "type" => "success");
        } elseif ($sCurrentVersion->sValue == $sOldVersion->sValue) {
            $sErrors[] = array("result" => "Force update failed, no updates available.", "type" => "error");
        } else {
            $sErrors[] = array("result" => "Force update failed, unknown error.", "type" => "error");
        }
    }
    $sJson = 1;
}
$sAutomaticUpdates = Core::GetSetting('automatic_updates');
$sUpdates[] = check_updates();
$sContent .= Templater::AdvancedParse($sAdminTemplate->sValue . '/update', $locale->strings, array("AutomaticUpdates" => $sAutomaticUpdates->sValue, "Updates" => $sUpdates, "Outdated" => $sUpdates[0]["update"], "Errors" => $sErrors));
if ($sJson == 1) {
    echo json_encode(array("content" => $sContent));
    die;
}
unset($sErrors);
Esempio n. 2
0
    }
}
$parse = $lang;
if (file_exists($xgp_root . 'install/') && defined('IN_ADMIN')) {
    $Message .= "<font color=\"red\">" . $lang['ow_install_file_detected'] . "</font><br/><br/>";
    $error++;
}
if ($user['authlevel'] >= 3) {
    if (@fopen("./../config.php", "a")) {
        $Message .= "<font color=\"red\">" . $lang['ow_config_file_writable'] . "</font><br/><br/>";
        $error++;
    }
    $Errors = doquery("SELECT COUNT(*) AS `errors` FROM {{table}} WHERE 1;", 'errors', true);
    if ($Errors['errors'] != 0) {
        $Message .= "<font color=\"red\">" . $lang['ow_database_errors'] . "</font><br/><br/>";
        $error++;
    }
    $curr = check_updates();
    if ($curr !== false) {
        $Message .= "<span style='font-size:14px;color:lime;'>Hay una nueva version disponible (<b style='color:skyblue;'>" . $curr . "</b>) <br> Haz click <a href='http://www.ugamelaplay.net/xg/rp/last.zip' style='font-size:14px;'><b><u>aqui</u></b></a> para descargarla</span><br/><br/>";
        $error++;
    }
}
if ($error != 0) {
    $parse['error_message'] = $Message;
    $parse['color'] = "red";
} else {
    $parse['error_message'] = $lang['ow_none'];
    $parse['color'] = "lime";
}
display(parsetemplate(gettemplate('adm/OverviewBody'), $parse), false, '', true, false);
Esempio n. 3
0
            return '0';
            //no updates
        } elseif ($content_github['tag_name'] != $current_version && $content_github['target_commitish'] == '3.3.5') {
            return '1';
            //update
        } elseif ($content_github['tag_name'] != $current_version && $content_github['target_commitish'] != '3.3.5') {
            return 'e2';
            //can't find updates for this repo
        }
    }
}
//url to get the lastest version (still dont know how to separate the branches)
$url = 'https://api.github.com/repos/FlameNET/FlameCMS/releases/latest';
//call function get_content_from_github($url)
$content_github = get_content_from_github($url);
$updated = check_updates($content_github, '1.1');
if ($updated == '1') {
    $update_link = 'https://github.com/FlameNET/FlameCMS/archive/v' . $content_github['tag_name'] . '.zip';
} else {
    //not counting with errors (e1 && e2)
    //no updates
}
?>
			</div>
		</div>
    </div>
	<?php 
include MODULO . 'footer.php';
?>
	<!-- Cargado archivos javascript al final para que la pagina cargue mas rapido -->
	<?php 
Esempio n. 4
0
        if ($current > $game_config['VERSION']) {
            return true;
        } else {
            return false;
        }
    }
}
$parse = $lang;
if (file_exists($xgp_root . 'install/') && defined('IN_ADMIN')) {
    $Message .= "<font color=\"red\">" . $lang['ow_install_file_detected'] . "</font><br/><br/>";
    $error++;
}
if (@fopen("./../config.php", "a")) {
    $Message .= "<font color=\"red\">" . $lang['ow_config_file_writable'] . "</font><br/><br/>";
    $error++;
}
$Errors = doquery("SELECT COUNT(*) AS `errors` FROM {{table}} WHERE 1;", 'errors', true);
if ($Errors['errors'] != 0) {
    $Message .= "<font color=\"red\">" . $lang['ow_database_errors'] . "</font><br/><br/>";
    $error++;
}
if (check_updates()) {
    $Message .= "<font color=\"red\">" . $lang['ow_old_version'] . "</font><br/><br/>";
    $error++;
}
if ($error != 0) {
    $parse['error_message'] = $Message;
} else {
    $parse['error_message'] = $lang['ow_none'];
}
display(parsetemplate(gettemplate('adm/overview_body'), $parse), false, '', true, false);