Esempio n. 1
0
/**
 * cron_auto_check_version()
 * 
 * @return
 */
function cron_auto_check_version()
{
    global $nv_Request, $global_config;
    $admin_cookie = $nv_Request->get_bool('admin', 'session', false);
    if (!empty($admin_cookie) and $global_config['autocheckupdate']) {
        require NV_ROOTDIR . "/includes/core/admin_access.php";
        require NV_ROOTDIR . "/includes/core/is_admin.php";
        if (defined('NV_IS_GODADMIN')) {
            include_once NV_ROOTDIR . "/includes/core/admin_functions.php";
            nv_geVersion($global_config['autoupdatetime'] * 3600);
        }
    }
    return true;
}
Esempio n. 2
0
 */
if (!defined('NV_IS_FILE_WEBTOOLS')) {
    die('Stop!!!');
}
$page_title = $lang_module['checkupdate'];
$contents = '';
$xtpl = new XTemplate('checkupdate.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
$xtpl->assign('LANG', $lang_module);
if ($nv_Request->isset_request('i', 'get')) {
    $i = $nv_Request->get_string('i', 'get');
    if ($i == 'sysUpd' or $i == 'sysUpdRef') {
        $values = array();
        $values['userVersion'] = $global_config['version'];
        $new_version = $i == 'sysUpd' ? nv_geVersion(28800) : nv_geVersion(120);
        $error = '';
        if ($new_version === false) {
            $error = $lang_module['error_unknow'];
        } elseif (is_string($new_version)) {
            $error = $new_version;
        }
        if (!empty($error)) {
            $xtpl->assign('ERROR', $lang_module['checkSystem'] . ': ' . $error);
            $xtpl->parse('error');
            echo $xtpl->text('error');
        } else {
            $values['onlineVersion'] = sprintf($lang_module['newVersion_detail'], (string) $new_version->version, (string) $new_version->name, nv_date('d/m/Y H:i', strtotime((string) $new_version->date)));
            $xtpl->assign('VALUE', $values);
            if (nv_version_compare($global_config['version'], (string) $new_version->version) < 0) {
                $xtpl->assign('VERSION_INFO', (string) $new_version->message);
Esempio n. 3
0
         // Package ok
         $warning = 0;
         foreach ($ziplistContent as $zipContent) {
             if (!preg_match("/^install\\//is", $zipContent['filename'])) {
                 // Package invald
                 $warning = 1;
             }
         }
     }
     if ($warning == 1) {
         $xtpl->assign('MESSAGE', sprintf($lang_module['get_update_warning'], NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=webtools&amp;' . NV_OP_VARIABLE . '=' . $op . '&amp;version=' . $version . '&amp;package=' . $package . '&amp;checksess=' . md5('unzip' . $version . $package . NV_CHECK_SESSION)));
         $xtpl->parse('warning');
         echo $xtpl->text('warning');
     } elseif ($warning == 2) {
         $error = $lang_module['get_update_error_file_download'];
         $new_version = nv_geVersion(NV_CURRENTTIME);
         if ($new_version !== false and !is_string($new_version)) {
             $manual_link = (string) $new_version->link;
             if (!empty($manual_link)) {
                 $error .= ' ' . sprintf($lang_module['get_update_error_file_download1'], $manual_link);
             }
         }
         $xtpl->assign('ERROR', $error);
         $xtpl->parse('error');
         echo $xtpl->text('error');
     } else {
         $xtpl->assign('MESSAGE', sprintf($lang_module['get_update_ok'], NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=webtools&amp;' . NV_OP_VARIABLE . '=' . $op . '&amp;version=' . $version . '&amp;package=' . $package . '&amp;checksess=' . md5('unzip' . $version . $package . NV_CHECK_SESSION)));
         $xtpl->parse('ok');
         echo $xtpl->text('ok');
     }
 }
Esempio n. 4
0
            $array['BackStepUrl'] = NV_BASE_SITEURL . 'install/update.php?step=2&amp;substep=4';
        }
        if ($nv_update_config['updatelog']['step'] < 2) {
            $nv_update_config['updatelog']['step'] = 2;
            $NvUpdate->set_data_log($nv_update_config['updatelog']);
        }
    }
    $contents = $NvUpdate->step2($array, $nv_update_config['substep']);
} elseif ($nv_update_config['step'] == 3) {
    // Hoan tat nang cap
    $array = array();
    // Lay thong tin phien ban va module
    if ($nv_Request->isset_request('load', 'get')) {
        $type = $nv_Request->get_title('load', 'get', '');
        if ($type == 'ver') {
            $version = nv_geVersion(0);
            $array['current_version'] = $global_config['version'];
            $array['newVersion'] = (string) $version['version'] . ' - ' . (string) $version['name'];
            $array['checkversion'] = false;
            if (nv_version_compare($global_config['version'], $version['version']) < 0) {
                $array['checkversion'] = true;
            }
            $NvUpdate->version_info($array);
        } elseif ($type == 'mod') {
            $_modules = nv_getExtVersion(0);
            $_modules = nv_object2array($_modules);
            $_modules = $_modules['module'];
            $onlineModules = array();
            foreach ($_modules as $m) {
                $name = array_shift($m);
                $onlineModules[$name] = $m;