public function check() { global $ilUser, $rbacsystem, $lng; $count_limit = (bool) $ilUser->getPref('systemcheck_count_limit'); $age_limit = (bool) $ilUser->getPref('systemcheck_age_limit'); $type_limit = $ilUser->getPref('systemcheck_type_limit'); $lng->loadLanguageModule("administration"); // #13486 include_once "./Services/Repository/classes/class.ilValidator.php"; $validator = new ilValidator(true); $modes = array(); $possible_modes = $validator->getPossibleModes(); foreach ($possible_modes as $possible_mode) { $pref_key = 'systemcheck_mode_' . $possible_mode; $modes[$possible_mode] = (bool) $ilUser->getPref($pref_key); } ob_start(); /*if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId())) { $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE); }*/ $validator->setMode("all", false); $used_modes = array(); foreach ($modes as $mode => $value) { $validator->setMode($mode, (bool) $value); $used_modes[] = $mode . '=' . $value; } $scan_log = $validator->validate(); $mode = $lng->txt("scan_modes") . ": " . implode(', ', $used_modes); // output echo $lng->txt("scanning_system"); echo $scan_log . "\n"; echo $mode . "\n"; if ($logging === true) { echo $lng->txt("view_log"); } $validator->writeScanLogLine($mode); $echo = ob_get_contents(); ob_end_clean(); $echo = preg_replace("/<br\\/>/", "\n", $echo); $echo = preg_replace("/<br \\/>/", "\n", $echo); $echo = preg_replace("/<br>/", "\n", $echo); echo $echo; }
function startValidator($a_mode, $a_log) { global $rbacsystem; if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) { $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE); } $logging = $a_log ? true : false; include_once "./Services/Repository/classes/class.ilValidator.php"; $validator = new ilValidator($logging); $validator->setMode("all", false); $modes = array(); foreach ($a_mode as $mode => $value) { $validator->setMode($mode, (bool) $value); $modes[] = $mode . '=' . $value; } $scan_log = $validator->validate(); $mode = $this->lng->txt("scan_modes") . ": " . implode(', ', $modes); // output $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_scan.html", "Modules/SystemFolder"); $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system")); $this->tpl->setVariable("COLSPAN", 3); $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log); $this->tpl->setVariable("TXT_MODE", $mode); if ($logging === true) { $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log")); } $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done")); $validator->writeScanLogLine($mode); }