public function check() { require_once libfile('function/admincp'); require_once libfile('function/plugin'); require_once libfile('function/cloudaddons'); $pluginarray = C::t('common_plugin')->fetch_all_data(); $addonids = array(); foreach ($pluginarray as $row) { if (ispluginkey($row['identifier'])) { $addonids[] = $row['identifier'] . '.plugin'; } } $checkresult = dunserialize(cloudaddons_upgradecheck($addonids)); savecache('addoncheck_plugin', $checkresult); $newversion = 0; foreach ($checkresult as $value) { list(, $newver) = explode(':', $value); if ($newver) { $newversion++; } } if ($newversion) { $return = array('status' => 1, 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_plugin_new_plugin', array('newversion' => $newversion))); } else { $return = array('status' => 0, 'type' => 'none', 'lang' => lang('optimizer', 'optimizer_plugin_no_upgrade')); } return $return; }
$sortid = C::t('forum_threadtype')->insert($data, 1); } $i = 1; if (empty($value['identifier'])) { cpmsg('threadtype_import_succeed', 'action=threadtypes', 'succeed'); } } $typeoption = array('classid' => $value['classid'], 'expiration' => $value['tpexpiration'], 'protect' => $value['protect'], 'title' => $value['title'], 'description' => $value['tpdescription'], 'type' => $value['type'], 'unit' => $value['unit'], 'rules' => $value['rules'], 'permprompt' => $value['permprompt']); if (strlen($value['identifier']) > 34) { cpmsg('threadtype_infotypes_optionvariable_invalid', 'action=threadtypes', 'error'); } $findidentifier = 0; $tmpidentifier = $value['identifier']; $decline = '_'; while (!$findidentifier) { if (C::t('forum_typeoption')->fetch_all_by_identifier($tmpidentifier, 0, 1) || !ispluginkey($tmpidentifier) || in_array(strtoupper($tmpidentifier), $mysql_keywords)) { $tmpidentifier = $value['identifier'] . $decline . $sortid; $decline .= '_'; } else { $findidentifier = 1; } } $typeoption['identifier'] = $tmpidentifier; $idcmp[$value['identifier']] = $tmpidentifier; $newoptionid = C::t('forum_typeoption')->insert($typeoption, true); $typevar = array('sortid' => $sortid, 'optionid' => $newoptionid, 'available' => $value['available'], 'required' => $value['required'], 'unchangeable' => $value['unchangeable'], 'search' => $value['search'], 'displayorder' => $value['displayorder'], 'subjectshow' => $value['subjectshow']); C::t('forum_typevar')->insert($typevar); if ($tmpidentifier) { if (in_array($value['type'], array('radio'))) { $create_tableoption_sql .= "{$separator}{$tmpidentifier} smallint(6) UNSIGNED NOT NULL DEFAULT '0'"; } elseif (in_array($value['type'], array('number', 'range'))) {
\t\t}); \t\tprettyPrint(); \t}); </script> EOF; } else { $membername = dhtmlspecialchars(trim($_GET['membername'])); $membertitle = strip_tags(trim($_GET['membertitle'])); $status = intval($_GET['status']); $createtime = strtotime($_GET['createtime']); $description = dhtmlspecialchars(trim($_GET['description'])); $membersort = trim($_GET['membersort']); if (!$membername) { cpmsg(lang('plugin/yiqixueba', 'membername_invalid'), '', 'error'); } if (!ispluginkey($membername)) { cpmsg(lang('plugin/yiqixueba', 'membername_invalid'), '', 'error'); } $ico = addslashes($_GET['memberimages']); if ($_FILES['memberimages']) { $upload = new discuz_upload(); if ($upload->init($_FILES['memberimages'], 'common') && $upload->save()) { $ico = $upload->attach['attachment']; } } if ($_POST['delete'] && addslashes($_POST['memberimages'])) { $valueparse = parse_url(addslashes($_POST['memberimages'])); if (!isset($valueparse['host']) && !strexists(addslashes($_POST['memberimages']), '{STATICURL}')) { @unlink($_G['setting']['attachurl'] . 'common/' . addslashes($_POST['memberimages'])); } $ico = '';
showtagheader('tbody', 'extra', $pluginvar['type'] == 'select' || $pluginvar['type'] == 'selects'); showsetting('plugins_edit_vars_extra', 'extranew', $pluginvar['extra'], 'textarea'); showtagfooter('tbody'); showsubmit('varsubmit'); showtablefooter(); showformfooter(); } else { $titlenew = cutstr(dhtmlspecialchars(trim($_G['gp_titlenew'])), 25); $descriptionnew = cutstr(dhtmlspecialchars(trim($_G['gp_descriptionnew'])), 255); $variablenew = trim($_G['gp_variablenew']); $extranew = dhtmlspecialchars(trim($_G['gp_extranew'])); if (!$titlenew) { cpmsg('plugins_edit_var_title_invalid', '', 'error'); } elseif ($variablenew != $pluginvar['variable']) { $query = DB::query("SELECT pluginvarid FROM " . DB::table('common_pluginvar') . " WHERE variable='{$variablenew}'"); if (DB::num_rows($query) || !$variablenew || strlen($variablenew) > 40 || !ispluginkey($variablenew)) { cpmsg('plugins_edit_vars_invalid', '', 'error'); } } DB::query("UPDATE " . DB::table('common_pluginvar') . " SET title='{$titlenew}', description='{$descriptionnew}', type='{$_G['gp_typenew']}', variable='{$variablenew}', extra='{$extranew}' WHERE pluginid='{$pluginid}' AND pluginvarid='{$pluginvarid}'"); updatecache(array('plugin', 'setting', 'styles')); cpmsg('plugins_edit_vars_succeed', "action=plugins&operation=edit&pluginid={$pluginid}&anchor=vars", 'succeed'); } } function modulecmp($a, $b) { return $a['displayorder'] > $b['displayorder'] ? 1 : -1; } function updatemenu() { $pluginmenus = array(array('addons', 'addons'), array('plugins_menu', 'plugins'));
EOF; } else { $goodsname = dhtmlspecialchars(trim($_GET['goodsname'])); $goodstitle = strip_tags(trim($_GET['goodstitle'])); $status = intval($_GET['status']); $newprice = intval($_GET['newprice']); $shopid = intval($_GET['shopid']); $price = intval($_GET['price']); $youxiaotime = strtotime($_GET['youxiaotime']); $description = dhtmlspecialchars(trim($_GET['goodsdescription'])); $goodssort = trim($_GET['goodssort']); if (!$goodsname) { dump('no'); cpmsg(lang('plugin/yiqixueba', 'goodsname_invalid'), '', 'error'); } if (ispluginkey($goodsname)) { dump('sql'); cpmsg(lang('plugin/yiqixueba', 'goodsname_invalid'), '', 'error'); } $ico = addslashes($_GET['goodsimages']); if ($_FILES['goodsimages']) { $upload = new discuz_upload(); if ($upload->init($_FILES['goodsimages'], 'common') && $upload->save()) { $ico = $upload->attach['attachment']; } } if ($_POST['delete'] && addslashes($_POST['goodsimages'])) { $valueparse = parse_url(addslashes($_POST['goodsimages'])); if (!isset($valueparse['host']) && !strexists(addslashes($_POST['goodsimages']), '{STATICURL}')) { @unlink($_G['setting']['attachurl'] . 'common/' . addslashes($_POST['goodsimages'])); }
function cron_delete($pluginid) { if (!ispluginkey($pluginid)) { return false; } $dir = DISCUZ_ROOT . './source/plugin/' . $pluginid . '/cron'; if (!file_exists($dir)) { return false; } $crondir = dir($dir); $count = 0; while ($filename = $crondir->read()) { if (!in_array($filename, array('.', '..')) && preg_match("/^cron\\_[\\w\\.]+\$/", $filename)) { $filename = $pluginid . ':' . $filename; $cronid = C::t('common_cron')->get_cronid_by_filename($filename); C::t('common_cron')->delete($cronid); $count++; } } return $count; }
function pluginupgradecheck($checkdata) { $result = array(); if (!$checkdata) { return $result; } $data = dfsockopen('http://addons.discuz.com/register.php', 0, http_build_query($checkdata), '', false, '', 5); $data = explode("\n", $data); foreach ($data as $row) { if (!$row) { continue; } list($id, $value) = explode("\t", $row); if (!ispluginkey($id)) { continue; } $valuee = explode(':', $value); $result[$id]['result'] = $valuee[0]; $result[$id]['newver'] = $valuee[1]; } return $result; }
$patchlist .= '</table><p class="cl"><a href="admin.php?action=patch" class="y pn"><strong>' . ($patchnotice['fixed'] ? $lang['patch_view_fix_detail'] : $lang['patch_fix_right_now']) . '</strong></a></p>'; $patchlist .= '</div></div>'; } } include template('common/header_ajax'); echo $patchlist; include template('common/footer_ajax'); exit; } elseif ($_GET['action'] == 'pluginnotice') { require_once libfile('function/admincp'); require_once libfile('function/plugin'); require_once libfile('function/cloudaddons'); $pluginarray = C::t('common_plugin')->fetch_all_data(); $addonids = array(); foreach ($pluginarray as $row) { if (ispluginkey($row['identifier'])) { $addonids[] = $row['identifier'] . '.plugin'; } } $checkresult = dunserialize(cloudaddons_upgradecheck($addonids)); savecache('addoncheck_plugin', $checkresult); $newversion = 0; foreach ($checkresult as $value) { list(, $newver) = explode(':', $value); if ($newver) { $newversion++; } } include template('common/header_ajax'); if ($newversion) { $lang = lang('forum/misc');
\t\t}); \t\tprettyPrint(); \t}); </script> EOF; } else { $chezhengname = dhtmlspecialchars(trim($_GET['chezhengname'])); $chezhengtitle = strip_tags(trim($_GET['chezhengtitle'])); $status = intval($_GET['status']); $createtime = strtotime($_GET['createtime']); $description = dhtmlspecialchars(trim($_GET['description'])); $chezhengsort = trim($_GET['chezhengsort']); if (!$chezhengname) { cpmsg(lang('plugin/yiqixueba', 'chezhengname_invalid'), '', 'error'); } if (!ispluginkey($chezhengname)) { cpmsg(lang('plugin/yiqixueba', 'chezhengname_invalid'), '', 'error'); } $ico = addslashes($_GET['chezhengimages']); if ($_FILES['chezhengimages']) { $upload = new discuz_upload(); if ($upload->init($_FILES['chezhengimages'], 'common') && $upload->save()) { $ico = $upload->attach['attachment']; } } if ($_POST['delete'] && addslashes($_POST['chezhengimages'])) { $valueparse = parse_url(addslashes($_POST['chezhengimages'])); if (!isset($valueparse['host']) && !strexists(addslashes($_POST['chezhengimages']), '{STATICURL}')) { @unlink($_G['setting']['attachurl'] . 'common/' . addslashes($_POST['chezhengimages'])); } $ico = '';
$mokuai_price = trim($_GET['price']); $mokuai_template = intval($_GET['template']); $mokuai_mobile = intval($_GET['mobile']); $mokuai_description = dhtmlspecialchars(trim($_GET['description'])); $mokuai_information = trim($_GET['mokuaiinformation']); $mokuai_newtag = trim($_GET['newtag']); if (!$biaoshi) { cpmsg(lang('plugin/yiqixueba', 'mokuai_biaoshi_invalid'), '', 'error'); } if (!$version) { cpmsg(lang('plugin/yiqixueba', 'mokuai_version_invalid'), '', 'error'); } if (!$mokuai_name) { cpmsg(lang('plugin/yiqixueba', 'mokuai_name_invalid'), '', 'error'); } if (!ispluginkey($biaoshi)) { cpmsg(lang('plugin/yiqixueba', 'mokuai_biaoshi_invalid'), '', 'error'); } $ico = addslashes($_GET['ico']); if ($_FILES['ico']) { $upload = new discuz_upload(); if ($upload->init($_FILES['ico'], 'common') && $upload->save()) { $ico = $upload->attach['attachment']; } } if ($_POST['delete'] && addslashes($_POST['ico'])) { $valueparse = parse_url(addslashes($_POST['ico'])); if (!isset($valueparse['host']) && !strexists(addslashes($_POST['ico']), '{STATICURL}')) { @unlink($_G['setting']['attachurl'] . 'common/' . addslashes($_POST['ico'])); } $ico = '';
function splugin_updatecache($identifier) { global $_G, $installlang; if (ispluginkey($identifier)) { splugin_loadcache($identifier); $splugin = DB::fetch_first("SELECT * FROM " . DB::table('common_plugin') . " WHERE identifier='{$identifier}'"); $directory = substr($splugin['directory'], 0, -1); $smodules = unserialize($splugin['modules']); if ($splugin) { $file = DISCUZ_ROOT . './source/plugin/' . $directory . '/discuz_plugin_' . $directory . ($smodules['extra']['installtype'] ? '_' . $smodules['extra']['installtype'] : '') . '.xml'; if (file_exists($file)) { updatecache(array('plugin')); $importtxt = @implode('', file($file)); $pluginarray = splugin_getimportdata($importtxt, 'Discuz! Plugin'); unset($pluginarray['Data']['var']); if ($fp = @fopen($file, 'w')) { fwrite($fp, splugin_exportdata($pluginarray)); fclose($fp); } } $update_item = array('1314' => '1', 'SC_GBK' => '1', 'SC_UTF8' => '1', 'TC_BIG5' => '1', 'TC_UTF8' => '1', 'install' => '2', 'upgrade' => '2'); $file = DISCUZ_ROOT . './source/plugin/' . $directory . '/demo.php'; if (!file_exists($file)) { cpmsg('plugin_file_error', '', 'error'); } if ($fp = @fopen($file, 'r')) { $demo_contents = fread($fp, filesize($file)); fclose($fp); } foreach ($update_item as $key => $value) { if ($value == '1') { if (empty($smodules['extra']['installtype']) && $key == '1314') { continue; } if ($smodules['extra']['installtype'] != $key) { $file = DISCUZ_ROOT . './source/plugin/' . $directory . '/discuz_plugin_' . $directory . ($key != '1314' ? '_' . $key : '') . '.xml'; clearstatcache(); if (file_exists($file)) { @unlink($file); } } } else { $file = DISCUZ_ROOT . './source/plugin/' . $directory . '/' . $key . '.php'; if ($fp = @fopen($file, 'w')) { fwrite($fp, $demo_contents); fclose($fp); } } } } $addonid = $identifier . '.plugin'; $array = cloudaddons_getmd5($addonid); if (s_cloudaddon_open('&mod=app&ac=validator&addonid=' . $addonid . ($array !== false ? '&rid=' . $array['RevisionID'] . '&sn=' . $array['SN'] . '&rd=' . $array['RevisionDateline'] : '')) === '0') { $query = DB::query("SELECT * FROM " . DB::table('common_plugin') . " WHERE identifier like 'study_%'"); while ($plugin = DB::fetch($query)) { $identifier = $plugin['identifier']; if (ispluginkey($identifier)) { s_cloudaddons_thank($identifier); } } } } }
//radio showsetting(lang('plugin/yiqixueba', 'groupname'), 'groupname', $group_info['groupname'], 'text', '', 0, lang('plugin/yiqixueba', 'groupname_comment'), '', '', true); foreach ($infotypes as $k => $v) { if ($v['status']) { showsetting($v['infotypetitle'], array('quanxian', array(array($v['infotypename'] . '_add', lang('plugin/yiqixueba', 'add')), array($v['infotypename'] . '_del', lang('plugin/yiqixueba', 'del')), array($v['infotypename'] . '_edit', lang('plugin/yiqixueba', 'edit')), array($v['infotypename'] . '_cha', lang('plugin/yiqixueba', 'cha')))), dunserialize($group_info['quanxian']), 'mcheckbox', '', 0, '', '', '', true); } } showsubmit('submit'); showtablefooter(); showformfooter(); } else { $groupname = dhtmlspecialchars(trim($_GET['groupname'])); $status = intval($_GET['status']); if (!$groupname) { //cpmsg(lang('plugin/yiqixueba','groupname_invalid'), '', 'error'); } if (!ispluginkey($groupname)) { //cpmsg(lang('plugin/yiqixueba','groupname_invalid'), '', 'error'); } $data = array('groupname' => $groupname, 'status' => $status, 'quanxian' => serialize($_GET['quanxian'])); if ($groupid) { $data['updatetime'] = time(); C::t(GM('cheyouhui_group'))->update($groupid, $data); } else { $data['updatetime'] = time(); C::t(GM('cheyouhui_group'))->insert($data); } echo '<style>.floattopempty { height: 30px !important; height: auto; } </style>'; cpmsg(lang('plugin/yiqixueba', 'edit_group_succeed'), 'action=' . $this_page . '&subop=grouplist', 'succeed'); } }
\t\t}); \t\tprettyPrint(); \t}); </script> EOF; } else { $goodscaijiname = dhtmlspecialchars(trim($_GET['goodscaijiname'])); $goodscaijititle = strip_tags(trim($_GET['goodscaijititle'])); $status = intval($_GET['status']); $createtime = strtotime($_GET['createtime']); $description = dhtmlspecialchars(trim($_GET['description'])); $goodscaijisort = trim($_GET['goodscaijisort']); if (!$goodscaijiname) { cpmsg(lang('plugin/yiqixueba', 'goodscaijiname_invalid'), '', 'error'); } if (!ispluginkey($goodscaijiname)) { cpmsg(lang('plugin/yiqixueba', 'goodscaijiname_invalid'), '', 'error'); } $ico = addslashes($_GET['goodscaijiimages']); if ($_FILES['goodscaijiimages']) { $upload = new discuz_upload(); if ($upload->init($_FILES['goodscaijiimages'], 'common') && $upload->save()) { $ico = $upload->attach['attachment']; } } if ($_POST['delete'] && addslashes($_POST['goodscaijiimages'])) { $valueparse = parse_url(addslashes($_POST['goodscaijiimages'])); if (!isset($valueparse['host']) && !strexists(addslashes($_POST['goodscaijiimages']), '{STATICURL}')) { @unlink($_G['setting']['attachurl'] . 'common/' . addslashes($_POST['goodscaijiimages'])); } $ico = '';
\t\t}); \t\tprettyPrint(); \t}); </script> EOF; } else { $settingname = dhtmlspecialchars(trim($_GET['settingname'])); $settingtitle = strip_tags(trim($_GET['settingtitle'])); $status = intval($_GET['status']); $createtime = strtotime($_GET['createtime']); $description = dhtmlspecialchars(trim($_GET['description'])); $settingsort = trim($_GET['settingsort']); if (!$settingname) { cpmsg(lang('plugin/yiqixueba', 'settingname_invalid'), '', 'error'); } if (!ispluginkey($settingname)) { cpmsg(lang('plugin/yiqixueba', 'settingname_invalid'), '', 'error'); } $ico = addslashes($_GET['settingimages']); if ($_FILES['settingimages']) { $upload = new discuz_upload(); if ($upload->init($_FILES['settingimages'], 'common') && $upload->save()) { $ico = $upload->attach['attachment']; } } if ($_POST['delete'] && addslashes($_POST['settingimages'])) { $valueparse = parse_url(addslashes($_POST['settingimages'])); if (!isset($valueparse['host']) && !strexists(addslashes($_POST['settingimages']), '{STATICURL}')) { @unlink($_G['setting']['attachurl'] . 'common/' . addslashes($_POST['settingimages'])); } $ico = '';
$endtime = $_GET['endtime']; $orderby = $_GET['orderby']; $advnum = C::t('common_advertisement')->count_search($title, $starttime, $endtime, $type, $target); if (!$type) { $customadv = array(); foreach (C::t('common_advertisement_custom')->fetch_all_data() as $custom) { $customadv[$custom['id']] = $custom['name']; } } $typenames = array(); foreach (C::t('common_advertisement')->fetch_all_search($title, $starttime, $endtime, $type, $target, $orderby, $start_limit, $advppp) as $adv) { if (!$type) { $advfile = ''; $etype = explode(':', $adv['type']); if (count($etype) > 1) { if (ispluginkey($etype[0]) && preg_match('/^\\w$/', $etype[1])) { $advfile = DISCUZ_ROOT . './source/plugin/' . $etype[0] . '/adv/adv_' . $etype[1] . '.php'; $advclass = 'adv_' . $etype[1]; } } else { $advfile = libfile('adv/' . $adv['type'], 'class'); $advclass = 'adv_' . $adv['type']; } if (!$advfile || !file_exists($advfile)) { continue; } if (!isset($typenames[$adv['type']])) { require_once $advfile; if (class_exists($advclass)) { $advclassv = new $advclass(); $typenames[$adv['type']] = lang('adv/' . $adv['type'], $advclassv->name);
showsetting('threadtype_edit_searchtxt', 'rules[range][searchtxt]', $option['rules']['searchtxt'], 'text'); showtagfooter('tbody'); showsubmit('editsubmit'); showtablefooter(); showformfooter(); } else { $titlenew = trim($_G['gp_titlenew']); $_G['gp_identifiernew'] = trim($_G['gp_identifiernew']); if (!$titlenew || !$_G['gp_identifiernew']) { cpmsg('threadtype_infotypes_option_invalid', '', 'error'); } if (in_array(strtoupper($_G['gp_identifiernew']), $mysql_keywords)) { cpmsg('threadtype_infotypes_optionvariable_iskeyword', '', 'error'); } $query = DB::query("SELECT optionid FROM " . DB::table('forum_typeoption') . " WHERE identifier='{$_G['gp_identifiernew']}' AND optionid<>'{$_G['gp_optionid']}' LIMIT 1"); if (DB::num_rows($query) || strlen($_G['gp_identifiernew']) > 40 || !ispluginkey($_G['gp_identifiernew'])) { cpmsg('threadtype_infotypes_optionvariable_invalid', '', 'error'); } $_G['gp_protectnew']['usergroup'] = $_G['gp_protectnew']['usergroup'] ? implode("\t", $_G['gp_protectnew']['usergroup']) : ''; DB::update('forum_typeoption', array('title' => $titlenew, 'description' => $_G['gp_descriptionnew'], 'identifier' => $_G['gp_identifiernew'], 'type' => $_G['gp_typenew'], 'unit' => $_G['gp_unitnew'], 'expiration' => $_G['gp_expirationnew'], 'protect' => addslashes(serialize($_G['gp_protectnew'])), 'rules' => addslashes(serialize($_G['gp_rules'][$_G['gp_typenew']]))), "optionid='{$_G['gp_optionid']}'"); updatecache('threadsorts'); cpmsg('threadtype_infotypes_option_succeed', 'action=threadtypes&operation=typeoption&classid=' . $option['classid'], 'succeed'); } } elseif ($operation == 'sortdetail') { if (!submitcheck('sortdetailsubmit') && !submitcheck('sortpreviewsubmit')) { $threadtype = DB::fetch_first("SELECT name, template, stemplate, ptemplate, btemplate, modelid, expiration FROM " . DB::table('forum_threadtype') . " WHERE typeid='{$_G['gp_sortid']}'"); $threadtype['modelid'] = isset($_G['gp_modelid']) ? intval($_G['gp_modelid']) : $threadtype['modelid']; $sortoptions = $jsoptionids = ''; $showoption = array(); $query = DB::query("SELECT t.optionid, t.displayorder, t.available, t.required, t.unchangeable, t.search, t.subjectshow, tt.title, tt.type, tt.identifier\n\t\t\tFROM " . DB::table('forum_typevar') . " t, " . DB::table('forum_typeoption') . " tt\n\t\t\tWHERE t.sortid='{$_G['gp_sortid']}' AND t.optionid=tt.optionid ORDER BY t.displayorder"); while ($option = DB::fetch($query)) {
showsetting('fields_edit_images_weight', 'rules[image][maxwidth]', $option['rules']['maxwidth'], 'text'); showsetting('fields_edit_images_height', 'rules[image][maxheight]', $option['rules']['maxheight'], 'text'); showtype('', 'bottom'); echo "</div><center><input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\"></center></form>"; } else { $titlenew = trim($titlenew); if(!$titlenew || !$identifiernew) { cpmsg('threadtype_infotypes_option_invalid'); } $query = $db->query("SELECT optionid FROM {$tablepre}typeoptions WHERE identifier='$identifiernew' AND optionid!='$optionid' LIMIT 1"); if($db->num_rows($query) || strlen($identifiernew) > 40 || !ispluginkey($identifiernew)) { cpmsg('threadtype_infotypes_optionvariable_invalid'); } $db->query("UPDATE {$tablepre}typeoptions SET title='$titlenew', description='$descriptionnew', identifier='$identifiernew', type='$typenew', rules='".addslashes(serialize($rules[$typenew]))."' WHERE optionid='$optionid'"); updatecache('threadtypes'); cpmsg('threadtype_infotypes_option_succeed', 'admincp.php?action=optiondetail&optionid='.$optionid); } } elseif($action == 'typedetail') { if($operation == 'classlist') { $classoptions = ''; $classidarray = array(); !$classid && $classid = 0;
if (preg_match("/[\\\\\\/\\:\\*\\?\"\\<\\>\\|]+/", $_GET['filenamenew'])) { cpmsg('crons_filename_illegal', '', 'error'); } elseif (!is_readable(DISCUZ_ROOT . ($cronfile = "./source/plugin/{$pluginid}/cron/{$_GET['filenamenew']}"))) { cpmsg('crons_filename_invalid', '', 'error', array('cronfile' => $cronfile)); } elseif ($_GET['weekdaynew'] == -1 && $daynew == -1 && $_GET['hournew'] == -1 && $minutenew === '') { cpmsg('crons_time_invalid', '', 'error'); } $_GET['filenamenew'] = $pluginid . ':' . $_GET['filenamenew']; } DB::update('common_cron', array('weekday' => $_GET['weekdaynew'], 'day' => $daynew, 'hour' => $_GET['hournew'], 'minute' => $minutenew, 'filename' => trim($_GET['filenamenew'])), "cronid='{$cronid}'"); discuz_cron::run($cronid); cpmsg('crons_succeed', 'action=misc&operation=cron', 'succeed'); } } else { $efile = explode(':', $cron['filename']); if (count($efile) > 1 && ispluginkey($efile[0])) { $cronfile = DISCUZ_ROOT . './source/plugin/' . $efile[0] . '/cron/' . $efile[1]; } else { $cronfile = DISCUZ_ROOT . "./source/include/cron/{$cron['filename']}"; } if (substr($cronfile, -4) !== '.php' || !file_exists($cronfile)) { cpmsg('crons_run_invalid', '', 'error', array('cronfile' => $cronfile)); } else { discuz_cron::run($cron['cronid']); cpmsg('crons_run_succeed', 'action=misc&operation=cron', 'succeed'); } } } } elseif ($operation == 'focus') { require_once libfile('function/post'); $focus = C::t('common_setting')->fetch('focus', true);
cpmsg('plugins_edit_vars_invalid', '', 'error'); } } DB::query("UPDATE " . DB::table('common_pluginvar') . " SET title='{$titlenew}', description='{$descriptionnew}', type='{$_G['gp_typenew']}', variable='{$variablenew}', extra='{$extranew}' WHERE pluginid='{$pluginid}' AND pluginvarid='{$pluginvarid}'"); updatecache(array('plugin', 'setting', 'styles')); cpmsg('plugins_edit_vars_succeed', "action=plugins&operation=edit&pluginid={$pluginid}&anchor=vars", 'succeed'); } } elseif ($operation == 'validator') { $where = !empty($_G['gp_identifier']) ? "identifier='{$_G['gp_identifier']}'" : "1"; $query = DB::query("SELECT pluginid, identifier, name, version, directory, modules FROM " . DB::table('common_plugin') . " WHERE {$where}"); $plugins = $errarray = $newarray = $nowarray = array(); if (!DB::num_rows($query)) { cpmsg('plugin_not_found', '', 'error'); } else { while ($row = DB::fetch($query)) { if (ispluginkey($row['identifier']) && ($key = pluginvalidator($row['identifier']))) { $checkdata['key'][$row['identifier']] = $key; } $plugins[$row['identifier']] = $row['name'] . ' ' . $row['version']; $modules = unserialize($row['modules']); $file = DISCUZ_ROOT . './source/plugin/' . $row['identifier'] . '/discuz_plugin_' . $row['identifier'] . ($modules['extra']['installtype'] ? '_' . $modules['extra']['installtype'] : '') . '.xml'; $upgrade = false; if (file_exists($file)) { $importtxt = @implode('', file($file)); $pluginarray = getimportdata('Discuz! Plugin'); $newver = !empty($pluginarray['plugin']['version']) ? $pluginarray['plugin']['version'] : 0; if ($newver > $row['version']) { $upgrade = true; $nowarray[] = '<a href="' . ADMINSCRIPT . '?action=plugins&operation=upgrade&pluginid=' . $row['pluginid'] . '">' . $plugins[$row['identifier']] . ' -> ' . $newver . '</a>'; } }