예제 #1
0
 public function check()
 {
     $discuz_patch = new discuz_patch();
     $discuz_patch->check_patch();
     $discuz_patch = new discuz_patch();
     $patchnum = 0;
     $patchnotice = $discuz_patch->fetch_patch_notice();
     if ($patchnotice['data']) {
         foreach ($patchnotice['data'] as $patch) {
             if ($patch['status'] <= 0) {
                 $patchnum++;
             }
         }
     }
     if ($patchnum) {
         $return = array('status' => 1, 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_patch_have', array('patchnum' => $patchnum)));
     } else {
         $return = array('status' => 0, 'type' => 'none', 'lang' => lang('optimizer', 'optimizer_patch_check_safe'));
     }
     return $return;
 }
예제 #2
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: misc_patch.php 30849 2012-06-26 02:21:32Z zhangguosheng $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if ($_GET['action'] == 'checkpatch') {
    header('Content-Type: text/javascript');
    if ($_G['uid'] && $_G['member']['allowadmincp'] == 1) {
        $discuz_patch = new discuz_patch();
        $discuz_patch->check_patch();
    }
    exit;
} elseif ($_GET['action'] == 'patchnotice') {
    $patchlist = '';
    if ($_G['member']['allowadmincp'] == 1) {
        $discuz_patch = new discuz_patch();
        $patchnotice = $discuz_patch->fetch_patch_notice();
        if (!empty($patchnotice['data'])) {
            $lang = lang('forum/misc');
            $patchlist .= '<div class="bm' . ($patchnotice['fixed'] ? ' allfixed' : '') . '"><div class="bm_h cl"><a href="javascript:;" onclick="$(\'patch_notice\').style.display=\'none\'" class="y" title="' . $lang['patch_close'] . '">' . $lang['patch_close'] . '</a><h2 class="i">';
            if ($patchnotice['fixed']) {
                $patchlist .= $lang['patch_site_have'] . ' ' . count($patchnotice['data']) . ' ' . $lang['patch_is_fixed'];
            } else {
                $patchlist .= $lang['patch_site_have'] . ' ' . count($patchnotice['data']) . ' ' . $lang['patch_need_fix'];
            }