From 0dd42320430efb55daf522aec91d312b6d2fbc80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 11 Mar 2009 18:17:29 +0000 Subject: [PATCH] opendir() should be rewritten to GET_DIR_AS_ARRAY() --- inc/modules/admin/admin-inc.php | 9 ++++----- inc/modules/admin/overview-inc.php | 9 +++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 7fbc40432c..7508d5c027 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -656,14 +656,14 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement = // Generate a selection box function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") { // Open the requested menu directory - $handle = opendir(sprintf("%sinc/modules/%s/", constant('PATH'), $menu)) or mxchange_die("Cannot load menu ".$menu."!"); + $menuArray = GET_DIR_AS_ARRAY(sprintf("inc/modules/%s/", $menu), "", false, false); // Init the selection box $OUT = "\n"; // Return contents diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 54f0fbf5b6..0ffec83911 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -52,8 +52,8 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) { $jobsDone = true; // Open the extension directory - $handle = opendir(constant('PATH')."inc/extensions/") or mxchange_die("Cannot read extension directory!"); - while ($file = readdir($handle)) { + $extensionList = GET_DIR_AS_ARRAY("inc/extensions/", "ext-", false, false); + foreach ($extensionList as $file) { // Is this file an extension? if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == ".php")) { //* DEBUG: */ echo $file."
\n"; @@ -96,10 +96,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) { } // END - if } } // END - if - } // END - while - - // Close directory handle - closedir($handle); + } // END - foreach // At last - but not least - check for own and new unassigned tasks... $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created -- 2.39.5