From 3ae478ffd10d5e79f8b176e6901599b718d02790 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 6 Jan 2012 11:52:31 +0000 Subject: [PATCH] MDL-21042 report_security: don't display warning for riskbackup unnecessarily --- report/security/locallib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/report/security/locallib.php b/report/security/locallib.php index 793ae7f037b..e9e654a6271 100644 --- a/report/security/locallib.php +++ b/report/security/locallib.php @@ -766,7 +766,12 @@ function report_security_check_riskbackup($detailed=false) { $systemrolecount = empty($systemroles) ? 0 : count($systemroles); $overriddenrolecount = empty($overriddenroles) ? 0 : count($overriddenroles); - $result->status = REPORT_SECURITY_WARNING; // there is always at least one admin + if (max($usercount, $systemrolecount, $overriddenrolecount) > 0) { + $result->status = REPORT_SECURITY_WARNING; + } else { + $result->status = REPORT_SECURITY_OK; + } + $a = (object)array('rolecount'=>$systemrolecount,'overridecount'=>$overriddenrolecount,'usercount'=>$usercount); $result->info = get_string('check_riskbackup_warning', 'report_security', $a);