/**
  * Show user agreement
  *
  * @access protected
  * @return
  */
 protected function fillAgreement()
 {
     global $ilUser;
     if (!$this->isRegistrationPossible()) {
         return true;
     }
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     if (!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
         return true;
     }
     $this->lng->loadLanguageModule('ps');
     include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->container->getId()));
     if (!count($fields_info->getExportableFields())) {
         return true;
     }
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('usr_agreement'));
     $this->form->addItem($section);
     include_once './Services/Membership/classes/class.ilMemberAgreementGUI.php';
     ilMemberAgreementGUI::addExportFieldInfo($this->form, $this->obj_id, $this->type);
     ilMemberAgreementGUI::addCustomFields($this->form, $this->obj_id, $this->type);
     // Checkbox agreement
     if ($this->privacy->confirmationRequired($this->type)) {
         ilMemberAgreementGUI::addAgreement($this->form, $this->obj_id, $this->type);
     }
     return true;
 }
 protected function saveMember()
 {
     global $ilUser;
     $GLOBALS['ilCtrl']->saveParameter($this, 'member_id');
     $form = $this->initMemberForm();
     if ($form->checkInput()) {
         // save history
         include_once './Services/Membership/classes/class.ilObjectCustomUserFieldHistory.php';
         $history = new ilObjectCustomUserFieldHistory($this->getObjId(), (int) $_REQUEST['member_id']);
         $history->setEditingTime(new ilDateTime(time(), IL_CAL_UNIX));
         $history->setUpdateUser($ilUser->getId());
         $history->save();
         ilMemberAgreementGUI::saveCourseDefinedFields($form, $this->getObjId(), (int) $_REQUEST['member_id']);
         ilUtil::sendSuccess($this->lng->txt('settings_saved'), TRUE);
         $GLOBALS['ilCtrl']->returnToParent($this);
         return TRUE;
     }
     $form->setValuesByPost();
     ilUtil::sendFailure($this->lng->txt('err_check_input'));
     return $this->editMember($form);
 }