1 Star 0 Fork 10

zhangxingong/Discuz

forked from Rocky-ZHAO/Discuz 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
plugin.php 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
Rocky-ZHAO 提交于 2017-02-11 19:37 . Signed-off-by: zcy 361689540@qq.com
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: plugin.php 27335 2012-01-16 10:15:37Z monkey $
*/
define('APPTYPEID', 127);
define('CURSCRIPT', 'plugin');
require './source/class/class_core.php';
$discuz = C::app();
$cachelist = array('plugin', 'diytemplatename');
$discuz->cachelist = $cachelist;
$discuz->init();
if(!empty($_GET['id'])) {
list($identifier, $module) = explode(':', $_GET['id']);
$module = $module !== NULL ? $module : $identifier;
} else {
showmessage('plugin_nonexistence');
}
$mnid = 'plugin_'.$identifier.'_'.$module;
$pluginmodule = isset($_G['setting']['pluginlinks'][$identifier][$module]) ? $_G['setting']['pluginlinks'][$identifier][$module] : (isset($_G['setting']['plugins']['script'][$identifier][$module]) ? $_G['setting']['plugins']['script'][$identifier][$module] : array('adminid' => 0, 'directory' => preg_match("/^[a-z]+[a-z0-9_]*$/i", $identifier) ? $identifier.'/' : ''));
if(!preg_match('/^[\w\_]+$/', $identifier)) {
showmessage('plugin_nonexistence');
}
if(empty($identifier) || !preg_match("/^[a-z0-9_\-]+$/i", $module) || !in_array($identifier, $_G['setting']['plugins']['available'])) {
showmessage('plugin_nonexistence');
} elseif($pluginmodule['adminid'] && ($_G['adminid'] < 1 || ($_G['adminid'] > 0 && $pluginmodule['adminid'] < $_G['adminid']))) {
showmessage('plugin_nopermission');
} elseif(@!file_exists(DISCUZ_ROOT.($modfile = './source/plugin/'.$pluginmodule['directory'].$module.'.inc.php'))) {
showmessage('plugin_module_nonexistence', '', array('mod' => $modfile));
}
define('CURMODULE', $identifier);
runhooks();
include DISCUZ_ROOT.$modfile;
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/zhangxingong/Discuz.git
git@gitee.com:zhangxingong/Discuz.git
zhangxingong
Discuz
Discuz
master

搜索帮助