+
+ // Return status
+ return $found;
+}
+
+// Checks wether the given module is locked by just checking the cache
+function isModuleLocked ($module) {
+ // Determine if there a cache entry and is it set
+ $return = ((isset($GLOBALS['cache_array']['modules']['locked'][$module])) && ($GLOBALS['cache_array']['modules']['locked'][$module] == 'Y'));
+
+ // Return determined value
+ return $return;
+}
+
+// Checks wether the given module is hidden by just checking the cache
+function isModuleHidden ($module) {
+ // Determine if there a cache entry and is it set
+ $return = ((isset($GLOBALS['cache_array']['modules']['hidden'][$module])) && ($GLOBALS['cache_array']['modules']['hidden'][$module] == 'Y'));
+
+ // Return determined value
+ return $return;
+}
+
+// Checks wether the given module is mem_only by just checking the cache
+function isModuleMemberOnly ($module) {
+ // Determine if there a cache entry and is it set
+ $return = ((isset($GLOBALS['cache_array']['modules']['mem_only'][$module])) && ($GLOBALS['cache_array']['modules']['mem_only'][$module] == 'Y'));
+
+ // Return determined value
+ return $return;
+}
+
+// Checks wether the given module is admin_only by just checking the cache
+function isModuleAdminOnly ($module) {
+ // Determine if there a cache entry and is it set
+ $return = ((isset($GLOBALS['cache_array']['modules']['admin_only'][$module])) && ($GLOBALS['cache_array']['modules']['admin_only'][$module] == 'Y'));
+
+ // Return determined value
+ return $return;
+}
+
+// Check validity of a given module name (no file extension)
+function checkModulePermissions ($module = '') {
+ // Is it empty (default), then take the current one
+ if (empty($module)) {
+ // Use current module
+ $module = getModule();
+ } // END - if
+
+ // Do we have cache?
+ if (isModuleStatusSet($module)) {
+ // Then use it
+ return getModuleStatus($module);
+ } // END - if
+
+ // Filter module name (names with low chars and underlines are fine!)
+ $module = preg_replace('/[^a-z_]/', '', $module);
+
+ // Check for prefix is a extension...
+ $modSplit = explode('_', $module);
+ $extension = ''; $module_chk = $module;
+ //* DEBUG: */ debugOutput(__LINE__.'*'.count($modSplit).'/'.$module.'*');
+ if (count($modSplit) == 2) {
+ // Okay, there is a seperator (_) in the name so is the first part a module?
+ //* DEBUG: */ debugOutput(__LINE__.'*'.$modSplit[0].'*');
+ if (isExtensionActive($modSplit[0])) {
+ // The prefix is an extension's name, so let's set it
+ $extension = $modSplit[0]; $module = $modSplit[1];
+ } // END - if
+ } // END - if
+
+ // Major error in module registry is the default
+ setModuleStatus($module_chk, 'major');
+
+ // Check if script is installed if not return a 'done' to prevent some errors
+ if ((isInstallationPhase()) || (!isAdminRegistered())) {
+ // Not installed or no admin registered or in installation phase
+ setModuleStatus($module_chk, 'done');
+
+ // Return status
+ return 'done';
+ } // END - if
+
+ // Check if the module is registered
+ $found = isModuleRegistered($module_chk);