ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilCronValidator.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
14  {
15  public function __construct()
16  {
17 
18  }
19 
20  public function check()
21  {
22  global $ilUser,$rbacsystem,$lng;
23 
24  $count_limit = (bool)$ilUser->getPref('systemcheck_count_limit');
25  $age_limit = (bool)$ilUser->getPref('systemcheck_age_limit');
26  $type_limit = $ilUser->getPref('systemcheck_type_limit');
27 
28  include_once "./Services/Repository/classes/class.ilValidator.php";
29  $validator = new ilValidator(true);
30 
31  $modes = array();
32  $possible_modes = $validator->getPossibleModes();
33  foreach($possible_modes as $possible_mode)
34  {
35  $pref_key = 'systemcheck_mode_'.$possible_mode;
36  $modes[$possible_mode] = (bool)$ilUser->getPref($pref_key);
37  }
38 
39  ob_start();
40 
41  /*if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
42  {
43  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
44  }*/
45 
46  $validator->setMode("all",false);
47 
48  $used_modes = array();
49  foreach($modes as $mode => $value)
50  {
51  $validator->setMode($mode,(bool) $value);
52  $used_modes[] = $mode.'='.$value;
53  }
54 
55  $scan_log = $validator->validate();
56 
57  $mode = $lng->txt("scan_modes").": ".implode(', ',$used_modes);
58 
59  // output
60  echo $lng->txt("scanning_system");
61  echo $scan_log."\n";
62  echo $mode."\n";
63  if ($logging === true)
64  {
65  echo $lng->txt("view_log");
66  }
67 
68  $validator->writeScanLogLine($mode);
69 
70  $echo = ob_get_contents();
71  ob_end_clean();
72 
73  $echo = preg_replace("/<br\/>/","\n",$echo);
74  $echo = preg_replace("/<br \/>/","\n",$echo);
75  $echo = preg_replace("/<br>/","\n",$echo);
76  echo $echo;
77  }
78  }
79 
80 
81 ?>