From 1050cd2be5424029416434c99012d01b30198dfe Mon Sep 17 00:00:00 2001
From: Derick Turner <derick@e-learndesign.co.uk>
Date: Thu, 17 Apr 2014 17:32:44 +0100
Subject: [PATCH] MDL-40570: Extra profile fields marked as required are not
 required when manually adding/editing users.  Removed check
 for the user matching the userid on the form as it isn't
 required when adding a new user and only users with
 appropriate capabilities can edit users in any case

---
 user/profile/lib.php |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/user/profile/lib.php b/user/profile/lib.php
index d8b93b7..4d420d3 100644
--- a/user/profile/lib.php
+++ b/user/profile/lib.php
@@ -209,8 +209,7 @@ class profile_field_base {
      * @param moodleform $mform instance of the moodleform class
      */
     public function edit_field_set_required($mform) {
-        global $USER;
-        if ($this->is_required() && ($this->userid == $USER->id)) {
+        if ($this->is_required()) {
             $mform->addRule($this->inputname, get_string('required'), 'required', null, 'client');
         }
     }
-- 
1.7.10.4

