]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18040 adding warning that the security report processing may take a long time
authorskodak <skodak>
Tue, 27 Jan 2009 16:21:56 +0000 (16:21 +0000)
committerskodak <skodak>
Tue, 27 Jan 2009 16:21:56 +0000 (16:21 +0000)
admin/report/security/index.php
admin/report/security/lib.php
lang/en_utf8/report_security.php
theme/standard/styles_layout.css

index b0de42d2f9bdc735cb242adbc6a6b58133b7e7c5..789e373c68e1e60664970d146a8e584d796d6b37 100644 (file)
@@ -48,6 +48,10 @@ admin_externalpage_print_header();
 
 print_heading(get_string('reportsecurity', 'report_security'));
 
+echo '<div id="timewarning">'.get_string('timewarning', 'report_security').'</div>';
+while(@ob_end_flush());
+@flush();
+
 $strok       = '<span class="statusok">'.get_string('statusok', 'report_security').'</span>';
 $strinfo     = '<span class="statusinfo">'.get_string('statusinfo', 'report_security').'</span>';
 $strwarning  = '<span class="statuswarning">'.get_string('statuswarning', 'report_security').'</span>';
@@ -68,6 +72,8 @@ $statusarr = array(REPORT_SECURITY_OK       => $strok,
 $url = "$CFG->wwwroot/$CFG->admin/report/security/index.php";
 
 if ($issue and ($result = $issue(true))) {
+    report_security_hide_timearning();
+
     $table = new object();
     $table->head  = array($strissue, $strstatus, $strdesc, $strconfig);
     $table->size  = array('30%', '10%', '50%', '10%' );
@@ -91,6 +97,8 @@ if ($issue and ($result = $issue(true))) {
     print_continue($url);
 
 } else {
+    report_security_hide_timearning();
+
     $table = new object();
     $table->head  = array($strissue, $strstatus, $strdesc);
     $table->size  = array('30%', '10%', '60%' );
index 75561b761bdbaef93ccaf14d6f128b5a62f5e760..0891ce3b1c004230509f421dddd2e23916a2e404 100644 (file)
@@ -32,6 +32,15 @@ define('REPORT_SECURITY_WARNING', 'warning');
 define('REPORT_SECURITY_SERIOUS', 'serious');
 define('REPORT_SECURITY_CRITICAL', 'critical');
 
+function report_security_hide_timearning() {
+     echo '<script type="text/javascript">
+//<![CDATA[
+    var el = document.getElementById("timewarning");
+    el.setAttribute("class", "timewarninghidden");
+//]]>
+</script>';
+
+}
 
 function report_security_get_issue_list() {
     return array(
index 14a170ad28ef566f0b6132d883d10998d8f11706..80029c1fa67819b1fad757bfc3b36e4d59d5cab8 100644 (file)
@@ -15,6 +15,7 @@ $string['statusinfo'] = 'Information';
 $string['statusok'] = 'OK';
 $string['statusserious'] = 'Serious';
 $string['statuswarning'] = 'Warning';
+$string['timewarning'] = 'Data processing may take a long time, please be patient...';
 
 $string['check_configrw_details'] = '<p>It is recommended that the file permissions of config.php are changed after installation so that the file cannot be modified by the web server.
 Please note that this measure does not improve security of the server significantly, though it may slow down or limit general exploits.</p>';
index 9ddc98a9801731ed34912052f620700ccc91f865..b7fd9468465b86a317544daad2c9d246d48766e7 100644 (file)
@@ -1026,6 +1026,14 @@ body#admin-modules table.generaltable td.c0
   margin-top: 1em;
 }
 
+#admin-report-security-index #timewarning {
+  text-align:center;
+}
+
+#admin-report-security-index .timewarninghidden {
+  display:none;
+}
+
 #admin-report-capability-index .rolecaps th {
   text-align: left;
 }