+
+ // Return status
+ return $found;
+}
+
+// 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);