Пример #1
0
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
// Include header
include __DIR__ . '/header.php';
if (isset($fct) && $fct === 'users') {
    $xoopsOption['pagetype'] = 'user';
}
$error = false;
if ($admintest != 0) {
    if (isset($fct) && $fct !== '') {
        $fct = preg_replace("/[^a-z0-9_\\-]/i", '', $fct);
        if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/admin/' . $fct . '/xoops_version.php')) {
            // Load language file
            system_loadLanguage($fct, $xoopsModule->getVar('dirname', 'n'));
            // Include Configuration file
            require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/admin/' . $fct . '/xoops_version.php';
            // Get System permission handler
            $sysperm_handler = xoops_getHandler('groupperm');
            $category = !empty($modversion['category']) ? (int) $modversion['category'] : 0;
            unset($modversion);
            if ($category > 0) {
                $group = $xoopsUser->getGroups();
                if (in_array(XOOPS_GROUP_ADMIN, $group) || false !== $sysperm_handler->checkRight('system_admin', $category, $group, $xoopsModule->getVar('mid'))) {
                    if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/admin/' . $fct . '/main.php')) {
                        include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/admin/' . $fct . '/main.php';
                    } else {
                        $error = true;
                    }
                } else {
Пример #2
0
 *
 * @copyright   The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license     GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author      Maxime Cointin (AKA Kraven30)
 * @package     system
 * @version     $Id$
 */
// Require mainfile
require dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/mainfile.php';
$xoops = Xoops::getInstance();
$xoops->disableErrorReporting();
$system = System::getInstance();
// Include module functions
include $xoops->path('modules/system/include/functions.php');
// Load language
system_loadLanguage('filemanager', 'system');
// Get Action type
$op = $system->cleanVars($_REQUEST, 'op', 'filemanager_display_folder', 'string');
switch ($op) {
    // Display files in tree
    case 'filemanager_display_folder':
        $_REQUEST['dir'] = urldecode($_REQUEST['dir']);
        $root = XOOPS_ROOT_PATH . '/';
        if (file_exists($root . $_REQUEST['dir'])) {
            $files = scandir($root . $_REQUEST['dir']);
            natcasesort($files);
            if (count($files) > 2) {
                /* The 2 accounts for . and .. */
                echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
                if ('/' == $_REQUEST['dir']) {
                    $url = $xoops->url('modules/system/admin.php?fct=filemanager');