From 7fe908c50c8dbc5cc05f571dbe11d66141caacd4 Mon Sep 17 00:00:00 2001 From: Marius Cramer <m.cramer@pixcept.de> Date: Thu, 14 Nov 2013 09:01:22 -0500 Subject: [PATCH] Cleaning up code to match coding guidelines --- interface/web/capp.php | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/interface/web/capp.php b/interface/web/capp.php index 7917aa0..2c14318 100644 --- a/interface/web/capp.php +++ b/interface/web/capp.php @@ -28,8 +28,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -require_once('../lib/config.inc.php'); -require_once('../lib/app.inc.php'); +require_once '../lib/config.inc.php'; +require_once '../lib/app.inc.php'; //* Import module variable $mod = $_REQUEST["mod"]; @@ -45,28 +45,28 @@ if(!preg_match("/^[a-z]{2,20}$/i", $mod)) die('module name contains unallowed chars.'); //* Check if user may use the module. -$user_modules = explode(",",$_SESSION["s"]["user"]["modules"]); +$user_modules = explode(",", $_SESSION["s"]["user"]["modules"]); -if(!in_array($mod,$user_modules)) $app->error($app->lng(301)); +if(!in_array($mod, $user_modules)) $app->error($app->lng(301)); //* Load module configuration into the session. if(is_file($mod."/lib/module.conf.php")) { - include_once($mod."/lib/module.conf.php"); - - $menu_dir = ISPC_WEB_PATH.'/' . $mod . '/lib/menu.d'; + include_once $mod."/lib/module.conf.php"; - if (is_dir($menu_dir)) { - if ($dh = opendir($menu_dir)) { - //** Go through all files in the menu dir - while (($file = readdir($dh)) !== false) { - if ($file != '.' && $file != '..' && substr($file, -9, 9) == '.menu.php' && $file != 'dns_resync.menu.php') { - include_once($menu_dir . '/' . $file); - } - } - } - } - - $_SESSION["s"]["module"] = $module; + $menu_dir = ISPC_WEB_PATH.'/' . $mod . '/lib/menu.d'; + + if (is_dir($menu_dir)) { + if ($dh = opendir($menu_dir)) { + //** Go through all files in the menu dir + while (($file = readdir($dh)) !== false) { + if ($file != '.' && $file != '..' && substr($file, -9, 9) == '.menu.php' && $file != 'dns_resync.menu.php') { + include_once $menu_dir . '/' . $file; + } + } + } + } + + $_SESSION["s"]["module"] = $module; session_write_close(); if($redirect == ''){ echo "HEADER_REDIRECT:".$_SESSION["s"]["module"]["startpage"]; @@ -77,4 +77,4 @@ } else { $app->error($app->lng(302)); } -?> \ No newline at end of file +?> -- Gitblit v1.9.1