From d9729643318075504eb74eaaa00750d315045e99 Mon Sep 17 00:00:00 2001
From: Derick Turner <derick@e-learndesign.co.uk>
Date: Thu, 17 Apr 2014 17:19:53 +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 9f68f59..39d6d77 100644
--- a/user/profile/lib.php
+++ b/user/profile/lib.php
@@ -179,8 +179,7 @@ class profile_field_base {
      * @param   object   instance of the moodleform class
      */
     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

