Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 */
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'];
            }
            $patchlist .= '</h2></div><div class="bm_c"><table width="100%" class="mbm"><tr><th>' . $lang['patch_name'] . '</th><th class="patchdate">' . $lang['patch_dateline'] . '</th><th class="patchstat">' . $lang['patch_status'] . '</th><tr>';
            foreach ($patchnotice['data'] as $notice) {
                $patchlist .= '<tr><td>' . $notice['serial'] . '</td><td>' . dgmdate($notice['dateline'], 'Y-m-d') . '</td><td>';
                if ($notice['status'] >= 1) {
                    $patchlist .= '<span class="fixed">' . $lang['patch_fixed_status'] . '<span>';
                } elseif ($notice['status'] < 0) {
                    $patchlist .= '<span class="unfixed">' . $lang['patch_fix_failed_status'] . '</span>';