diff --git a/lib.php b/lib.php index 2ee7744..781fe41 100644 --- a/lib.php +++ b/lib.php @@ -70,7 +70,6 @@ class enrol_apply_plugin extends enrol_plugin { return $OUTPUT->notification(get_string('maxenrolledreached', 'enrol_self')); } } - require_once("$CFG->dirroot/enrol/apply/locallib.php"); $form = new enrol_apply_enrol_form(NULL, $instance); @@ -100,11 +99,13 @@ class enrol_apply_plugin extends enrol_plugin { if(!$show_standard_user_profile && $show_extra_user_profile){ profile_save_data($userInfo); - //$res = $DB->update_record('user',$userInfoProfile); - }else{ - profile_save_data($userInfo); + $res = $DB->update_record('user',$userInfoProfile); //$res = $DB->update_record('user',$userInfo); } + /*elseif($show_standard_user_profile && $show_extra_user_profile){ + profile_save_data($userInfo); + $res = $DB->update_record('user',$userInfo); + }*/ $enrol = enrol_get_plugin('self'); $timestart = time(); @@ -139,7 +140,7 @@ class enrol_apply_plugin extends enrol_plugin { redirect("$CFG->wwwroot/course/view.php?id=$instance->courseid"); } } - + //exit; ob_start(); $form->display(); $output = ob_get_clean(); diff --git a/locallib.php b/locallib.php index ab9c828..d2d1609 100644 --- a/locallib.php +++ b/locallib.php @@ -86,9 +86,9 @@ class enrol_apply_enrol_form extends moodleform { } if($show_standard_user_profile){ - useredit_shared_definition($mform, $editoroptions, $filemanageroptions); + useredit_shared_definition($mform, $editoroptions, $filemanageroptions,$user); } - + if($show_extra_user_profile){ profile_definition($mform, $user->id); }