From d87f76019fc231ec20d95126a7fee0487e7be5f0 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 14 Aug 2012 10:56:20 -0400
Subject: [PATCH] - Added new web folder named private to web folder layout. The folder is intended to store data that shall not be visible in the web directory, it is owned by the user of the web. - Changed ownership of web root directory to root user in all security modes to prevent symlink attacks. - Apache log files are now owned by user root. - Improved functions in system library.
---
interface/web/designer/module_list.php | 43 +++++++++++++++++--------------------------
1 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/interface/web/designer/module_list.php b/interface/web/designer/module_list.php
index 6449037..92aa4f0 100644
--- a/interface/web/designer/module_list.php
+++ b/interface/web/designer/module_list.php
@@ -30,49 +30,40 @@
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
-// Checking permissions for the module
-if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
- header("Location: ../index.php");
- exit;
-}
+//* Check permissions for module
+$app->auth->check_module_permissions('designer');
$app->uses('tpl');
-$app->tpl->newTemplate("form.tpl.htm");
+$app->tpl->newTemplate('form.tpl.htm');
$app->tpl->setInclude('content_tpl','templates/module_list.htm');
-// lese Module aus
-$bgcolor = "#FFFFFF";
+//* Pick out modules
+$bgcolor = '#FFFFFF';
$modules_list = array();
-$handle = @opendir($conf["rootpath"]."/web");
+$handle = @opendir(ISPC_WEB_PATH);
while ($file = @readdir ($handle)) {
- if ($file != "." && $file != "..") {
- if(@is_dir($conf["rootpath"]."/web/".$file)) {
- if(is_file($conf["rootpath"]."/web/".$file."/lib/module.conf.php") and $file != 'login') {
- include_once($conf["rootpath"]."/web/".$file."/lib/module.conf.php");
-
- // Farbwechsel
- $bgcolor = ($bgcolor == "#FFFFFF")?"#EEEEEE":"#FFFFFF";
-
- $modules_list[] = array( 'module' => $module["name"],
- 'title' => $module["title"],
- 'bgcolor' => $bgcolor);
+ if ($file != '.' && $file != '..') {
+ if(@is_dir(ISPC_WEB_PATH."/$file")) {
+ if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login') {
+ include_once(ISPC_WEB_PATH."/$file/lib/module.conf.php");
+ $modules_list[] = array( 'module' => $module['name'],
+ 'title' => $module['title'],
+ 'bgcolor' => ($bgcolor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF'
+ );
}
}
}
}
+$app->tpl->setLoop('records', $modules_list);
-$app->tpl->setLoop('records',$modules_list);
-
-// loading language file
-$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_module_list.lng";
+//* loading language file
+$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_module_list.lng';
include($lng_file);
$app->tpl->setVar($wb);
$app->tpl_defaults();
$app->tpl->pparse();
-
-
?>
\ No newline at end of file
--
Gitblit v1.9.1