### Eclipse Workspace Patch 1.0
#P moodle
Index: user/profile/field/menu/field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/user/profile/field/menu/field.class.php,v
retrieving revision 1.10.2.2
diff -u -r1.10.2.2 field.class.php
--- user/profile/field/menu/field.class.php	29 Jan 2009 13:43:50 -0000	1.10.2.2
+++ user/profile/field/menu/field.class.php	10 Mar 2009 10:14:52 -0000
@@ -71,6 +71,20 @@
         $user->{$this->inputname} = $this->datakey;
     }
 
+    /**
+     * HardFreeze the field if locked.
+     * @param   object   instance of the moodleform class
+     */
+    function edit_field_set_locked(&$mform) {
+        if (!$mform->elementExists($this->inputname)) {
+            return;
+        }
+        if ($this->is_locked() and !has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM))) {
+            $mform->hardFreeze($this->inputname);
+            $mform->setConstant($this->inputname, $this->datakey);
+        }
+    }
+    
 }
 
 ?>
