$modPath = 'modules/general/'; $allModules = rcms_scandir($modPath); $ignoreMods = array('remoteapi','index','menu','manifestor'); $failCount=0; if (!empty($allModules)) { $ignoreMods = array_flip($ignoreMods); foreach ($allModules as $io => $eachDir) { if (!isset($ignoreMods[$eachDir])) { if (is_dir(MODULES_PATH . $eachDir)) { $controllerPath = $modPath . $eachDir . '/index.php'; if (file_exists($controllerPath)) { $controllerCode = file_get_contents($controllerPath); if (!empty($controllerCode)) { if (ispos($controllerCode, 'cfr(') OR ispos($controllerCode, '$system->checkForRight')) { // show_success(__('Rights check found in').' '.$eachDir); } else { show_error(__('No rights check in') . ' ' . $eachDir); $failCount++; } } else { show_error(__('Empty module') . ' ' . $controllerPath); $failCount++; } } } } } } if ($failCount>0) { show_error(__('Failures count').': '.$failCount); } else { show_info(__('Everything is Ok!')); }