break;
 case 'plugins':
     loadhead('插件管理');
     template('admin-plugins');
     break;
 case 'cron':
     loadhead('计划任务');
     template('admin-cron');
     break;
 case 'update':
     loadhead('检查更新');
     template('admin-update');
     break;
 case 'setplug':
     $plug = strip_tags($_GET['plug']);
     $pluginfo = getPluginInfo($plug);
     if (file_exists(SYSTEM_ROOT . '/plugins/' . $plug . '/' . $plug . '_setting.php') && in_array($_GET['plug'], $i['plugins']['actived'])) {
         loadhead($pluginfo['plugin']['name'] . ' - 插件管理');
         require_once SYSTEM_ROOT . '/plugins/' . $plug . '/' . $plug . '_setting.php';
         echo '<br/><br/><br/>';
         if (!empty($pluginfo['plugin']['url'])) {
             echo '<a href="' . $pluginfo['plugin']['url'] . '" target="_blank">';
         }
         echo $pluginfo['plugin']['name'];
         if (!empty($pluginfo['plugin']['url'])) {
             echo '</a>';
         }
         echo ' V' . $pluginfo['plugin']['version'] . ' // 插件作者:<a href="' . $pluginfo['author']['url'] . '" target="_blank">' . $pluginfo['author']['author'] . '</a><br/>' . SYSTEM_FN . ' V' . SYSTEM_VER . ' // 程序作者: <a href="http://zhizhe8.net" target="_blank">Kenvix</a> @ <a href="http://www.stus8.com" target="_blank">StusGame GROUP</a> &amp; <a href="http://www.longtings.com/" target="_blank">mokeyjay</a> &amp; <a href="http://fyy.l19l.com/" target="_blank">FYY</a>';
     } else {
         echo '<b>插件设置页面不存在</b>';
     }
Beispiel #2
0
 $phpIVersion = explode('.', $phpVersion);
 $phpIVersion = (intval($phpIVersion[0]) << 16) + (intval($phpIVersion[1]) << 8) + intval($phpIVersion[2]);
 $phpRequired = false;
 $userPermissions = array("__hash__" => "plugins.dat");
 $cache = new rCache();
 $cache->get($userPermissions);
 $cantBeShutdowned = 0x80;
 $canBeLaunched = 0x100;
 $disabledByUser = 0x8000;
 $loadedExtensions = array_map("strtolower", get_loaded_extensions());
 while (false !== ($file = readdir($handle))) {
     if ($file != "." && $file != ".." && is_dir('../plugins/' . $file)) {
         if (!array_key_exists($file, $userPermissions)) {
             $userPermissions[$file] = true;
         }
         $info = getPluginInfo($file, $permissions);
         if ($info) {
             if ($info["plugin.may_be_launched"] && getFlag($permissions, $file, "enabled") == "user-defined") {
                 $info["perms"] |= $canBeLaunched;
                 if (!$userPermissions[$file]) {
                     $info["perms"] |= $disabledByUser;
                     $disabled[$file] = $info;
                     $info = false;
                 }
             } else {
                 $info["perms"] |= $cantBeShutdowned;
             }
         }
         if ($info !== false) {
             if (!$theSettings->linkExist && $info["rtorrent.need"]) {
                 $disabled[$file] = $info;
Beispiel #3
0
/**
* 获取所有插件列表,未定义插件名称的插件将不予获取
* 插件目录:/plugins
* 仅识别 插件目录/插件/插件.php 目录结构的插件
* @param bool true为获取完整信息,false为获取标识符列表
* @return array 插件信息
*/
function getPlugins($full = true)
{
    $path = SYSTEM_ROOT . '/plugins/';
    $res = listDir($path);
    $r = array();
    foreach ($res as $x) {
        if (is_dir($path . $x) && file_exists($path . $x . '/' . $x . '.php')) {
            if ($full) {
                $r[] = getPluginInfo($x);
            } else {
                $r[] = $x;
            }
        }
    }
    return $r;
}
Beispiel #4
0
<?php

/**
 * 贴吧云签到
 * Copyright (c) 2012~2016 StusGame All Rights Reserved.
 * 
 * 获取开发文档:https://git.oschina.net/kenvix/Tieba-Cloud-Sign/wikis/
 */
require dirname(__FILE__) . '/init.php';
global $i;
if (!isset($_GET['plugin']) && !isset($_GET['pub_plugin']) && !isset($_GET['vip_plugin']) && !isset($_GET['pri_plugin']) && $i['mode'][0] != 'view') {
    template('control');
    loadfoot();
} elseif ($i['mode'][0] == 'view') {
    if (in_array($i['mode'][1], $i['plugins']['actived']) && file_exists(SYSTEM_ROOT . '/plugins/' . $i['mode'][1] . '/' . 'view_' . $i['mode'][2] . '.php')) {
        $plug = getPluginInfo($i['mode'][1]);
        if (in_array($i['mode'][2], $plug['page'])) {
            include SYSTEM_ROOT . '/plugins/' . $i['mode'][1] . '/' . 'view_' . $i['mode'][2] . '.php';
        } else {
            msg('无效的插件自定义页面,请在 插件名_desc.php 中的page键添加此页面');
        }
    } else {
        ReDirect('index.php');
    }
} elseif (isset($_GET['plugin'])) {
    $plug = strip_tags($_GET['plugin']);
    if (in_array($plug, $i['plugins']['actived'])) {
        if (file_exists(SYSTEM_ROOT . '/plugins/' . $plug . '/' . $plug . '_show.php') && !is_dir(SYSTEM_ROOT . '/plugins/' . $plug . '/' . $plug . '_show.php')) {
            require_once SYSTEM_ROOT . '/plugins/' . $plug . '/' . $plug . '_show.php';
        } else {
            msg('插件前台显示模块不存在或不正确');
Beispiel #5
0
/**
* This function returns an associative array with all the php files that are
* plugins and their plugin info. 
* 
* Following the wordpress model (and code) we search for plugins in the plugins
* directory and each subdirectory 1 level deep.
*/
function getPlugins()
{
    $plugin_dir_files = array();
    $rss_plugins = array();
    $plugin_dir = '../' . RSS_PLUGINS_DIR;
    $d = @dir($plugin_dir);
    //Put all the *.php files in the plugin dir and 1 level below into $plugin_dir_files
    while (($file = $d->read()) !== false) {
        if ($file != "CVS" && substr($file, 0, 1) != ".") {
            if (is_dir($plugin_dir . '/' . $file)) {
                $plugins_subdir = @dir($plugin_dir . '/' . $file);
                if ($plugins_subdir) {
                    while (($subfile = $plugins_subdir->read()) !== false) {
                        if (preg_match('|^\\.+$|', $subfile)) {
                            continue;
                        }
                        if (preg_match('|\\.php$|', $subfile)) {
                            $plugin_dir_files[] = "{$file}/{$subfile}";
                        }
                    }
                }
            } else {
                if (preg_match('|\\.php$|', $file)) {
                    $plugin_dir_files[] = $file;
                }
            }
        }
    }
    // See which of the php files in $plugin_dir_files are really plugins
    foreach ($plugin_dir_files as $plugin_dir_file) {
        $info = getPluginInfo($plugin_dir_file);
        // $info will have the filename in it. Does it have anything else?
        if (count($info) > 1) {
            $rss_plugins[$plugin_dir_file] = $info;
        }
    }
    ksort($rss_plugins);
    //return an associative array with the plugin files and their info
    return $rss_plugins;
}
    return $level;
}
if (!function_exists('preg_match_all')) {
    exit;
}
$_SERVER['REMOTE_USER'] = $argv[1];
require_once "util.php";
require_once "settings.php";
$theSettings = new rTorrentSettings();
$theSettings->obtain();
if ($theSettings->linkExist && ($handle = opendir('../plugins'))) {
    $permissions = parse_ini_file("../conf/plugins.ini", true);
    $init = array();
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != ".." && is_dir('../plugins/' . $file)) {
            $level = getPluginInfo($file, $permissions);
            if ($level !== false) {
                $php = "../plugins/" . $file . "/init.php";
                if (!is_readable($php)) {
                    $php = NULL;
                }
                $init[] = array("php" => $php, "name" => $file, "level" => $level);
            }
        }
    }
    closedir($handle);
    usort($init, "pluginsSort");
    $do_diagnostic = false;
    $jResult = '';
    $jEnd = '';
    foreach ($init as $plugin) {