MDL-32787 user: rule required for custom profile fields applies to all users editing own profile

This commit is contained in:
Rajesh Taneja
2012-07-03 13:46:13 +08:00
parent d71b79a406
commit fc3aa0fbaf
5 changed files with 39 additions and 26 deletions
+14 -10
View File
@@ -13,16 +13,20 @@ class user_editadvanced_form extends moodleform {
global $USER, $CFG, $COURSE;
$mform =& $this->_form;
$editoroptions = null;
$filemanageroptions = null;
$userid = $USER->id;
if (is_array($this->_customdata) && array_key_exists('editoroptions', $this->_customdata)) {
$editoroptions = $this->_customdata['editoroptions'];
} else {
$editoroptions = null;
}
if (is_array($this->_customdata) && array_key_exists('filemanageroptions', $this->_customdata)) {
$filemanageroptions = $this->_customdata['filemanageroptions'];
} else {
$filemanageroptions = null;
if (is_array($this->_customdata)) {
if (array_key_exists('editoroptions', $this->_customdata)) {
$editoroptions = $this->_customdata['editoroptions'];
}
if (array_key_exists('filemanageroptions', $this->_customdata)) {
$filemanageroptions = $this->_customdata['filemanageroptions'];
}
if (array_key_exists('userid', $this->_customdata)) {
$userid = $this->_customdata['userid'];
}
}
//Accessibility: "Required" is bad legend text.
@@ -66,7 +70,7 @@ class user_editadvanced_form extends moodleform {
useredit_shared_definition($mform, $editoroptions, $filemanageroptions);
/// Next the customisable profile fields
profile_definition($mform);
profile_definition($mform, $userid);
$this->add_action_buttons(false, get_string('updatemyprofile'));
}