mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-72325 user: Use the core_user::awaiting_action() in existing places
There were existing places each doing its own checks similar to the ones covered by the newly added core_user::awaiting_action() method. This patch replaces those custom checks with this new API call.
This commit is contained in:
parent
124b82831b
commit
f9ee118e94
@ -551,10 +551,7 @@ class helper {
|
||||
global $USER, $CFG, $PAGE;
|
||||
|
||||
// Early bail out conditions.
|
||||
if (empty($CFG->messaging) || !isloggedin() || isguestuser() || user_not_fully_set_up($USER) ||
|
||||
get_user_preferences('auth_forcepasswordchange') ||
|
||||
(!$USER->policyagreed && !is_siteadmin() &&
|
||||
($manager = new \core_privacy\local\sitepolicy\manager()) && $manager->is_defined())) {
|
||||
if (empty($CFG->messaging) || !isloggedin() || isguestuser() || \core_user::awaiting_action()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -34,10 +34,7 @@ function message_popup_render_navbar_output(\renderer_base $renderer) {
|
||||
global $USER, $CFG;
|
||||
|
||||
// Early bail out conditions.
|
||||
if (!isloggedin() || isguestuser() || user_not_fully_set_up($USER) ||
|
||||
get_user_preferences('auth_forcepasswordchange') ||
|
||||
(!$USER->policyagreed && !is_siteadmin() &&
|
||||
($manager = new \core_privacy\local\sitepolicy\manager()) && $manager->is_defined())) {
|
||||
if (!isloggedin() || isguestuser() || \core_user::awaiting_action()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,7 @@ class user_profile_set extends \core_analytics\local\indicator\linear {
|
||||
// Nothing set results in -1.
|
||||
$calculatedvalue = self::MIN_VALUE;
|
||||
|
||||
$sitepolicymanager = new \core_privacy\local\sitepolicy\manager();
|
||||
if ($sitepolicymanager->is_defined() && !$user->policyagreed) {
|
||||
if (\core_user::awaiting_action($user)) {
|
||||
return self::MIN_VALUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user