コード例 #1
0
ファイル: updater.php プロジェクト: mtechnik/pantherforum
 public function __construct($db, $panther_config, $lang_common)
 {
     $this->db = $db;
     $this->panther_config = $panther_config;
     $this->lang = $lang_common;
     if (file_exists(FORUM_CACHE_DIR . 'cache_updates.php')) {
         require FORUM_CACHE_DIR . 'cache_updates.php';
     } else {
         if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
             require PANTHER_ROOT . 'include/cache.php';
         }
         generate_update_cache();
         require FORUM_CACHE_DIR . 'cache_updates.php';
     }
 }
コード例 #2
0
 public function __construct($db, $panther_config, $updater)
 {
     if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
         require PANTHER_ROOT . 'include/cache.php';
     }
     $panther_updates = generate_update_cache();
     if ($panther_config['o_update_type'] == '0') {
         return;
     }
     if (version_compare($panther_config['o_cur_version'], $updater->panther_updates['version'], '<')) {
         if ($panther_config['o_update_type'] == '2' || $panther_config['o_update_type'] == '3') {
             $updater->download();
         }
         $file_name = 'panther-update-patch-' . $updater->version_friendly($updater->panther_updates['version']) . '.zip';
         if (file_exists(PANTHER_ROOT . 'include/updates/' . $file_name) && ($panther_config['o_update_type'] == '1' || $panther_config['o_update_type'] == '3')) {
             $updater->install();
         }
     }
 }
コード例 #3
0
ファイル: update.php プロジェクト: BlitzFirePlayz/Luna
if ($action == 'check_update') {
    if (!defined('LUNA_CACHE_FUNCTIONS_LOADED')) {
        require LUNA_ROOT . 'include/cache.php';
    }
    // Regenerate the update cache
    generate_update_cache();
    header("Location: update.php");
}
if (file_exists(LUNA_CACHE_DIR . 'cache_update.php')) {
    include LUNA_CACHE_DIR . 'cache_update.php';
}
if (!defined('LUNA_UPDATE_LOADED') || $last_check_time > time() + 60 * 60 * 24) {
    if (!defined('LUNA_CACHE_FUNCTIONS_LOADED')) {
        require LUNA_ROOT . 'include/cache.php';
    }
    generate_update_cache();
    require LUNA_CACHE_DIR . 'cache_update.php';
}
$page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Admin', 'luna'), __('Update', 'luna'));
define('LUNA_ACTIVE_PAGE', 'admin');
require 'header.php';
load_admin_nav('backstage', 'update');
if (isset($_GET['saved'])) {
    echo '<div class="alert alert-success">' . __('Your settings have been saved.', 'luna') . '</div>';
}
?>
<div class="row">
	<div class="col-sm-4 col-md-3">
		<form method="post" action="update.php">
			<input type="hidden" name="form_sent" value="1" />
			<fieldset>
コード例 #4
0
ファイル: index.php プロジェクト: mtechnik/pantherforum
    require PANTHER_ROOT . 'include/common.php';
}
require PANTHER_ROOT . 'include/common_admin.php';
if ($panther_user['is_admmod'] && $panther_user['g_mod_cp'] == '0' && !$panther_user['is_admin'] || !$panther_user['is_admmod']) {
    message($lang_common['No permission'], false, '403 Forbidden');
}
check_authentication();
// Load the admin_index.php language file
require PANTHER_ROOT . 'lang/' . $admin_language . '/admin_index.php';
$action = isset($_GET['action']) ? $_GET['action'] : null;
// Check for upgrade
if ($action == 'check_upgrade') {
    if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
        require PANTHER_ROOT . 'include/cache.php';
    }
    $output = generate_update_cache();
    if (version_compare($panther_config['o_cur_version'], $output['version'], '>=')) {
        message($lang_admin_index['Running latest version message']);
    } else {
        message(sprintf($lang_admin_index['New version available message'], '<a href="https://www.pantherforum.org/">Panther</a>'));
    }
} else {
    if ($action == 'remove_install_file') {
        if (!$panther_user['is_admin']) {
            message($lang_common['No permission']);
        }
        if (@unlink(PANTHER_ROOT . 'install.php')) {
            redirect(panther_link($panther_url['admin_index']), $lang_admin_index['Deleted install.php redirect']);
        } else {
            message($lang_admin_index['Delete install.php failed']);
        }