ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilGroupRegistrationGUI Class Reference

GUI class for group registrations. More...

+ Inheritance diagram for ilGroupRegistrationGUI:
+ Collaboration diagram for ilGroupRegistrationGUI:

Public Member Functions

 __construct (ilObject $a_container)
 
 executeCommand ()
 
- Public Member Functions inherited from ilRegistrationGUI
 __construct (ilObject $a_container)
 
 getContainer ()
 
 getRefId ()
 
 cancel ()
 cancel subscription More...
 
 show (?ilPropertyFormGUI $form=null)
 
 join ()
 

Protected Member Functions

 getFormTitle ()
 Get title for property form. More...
 
 fillInformations ()
 fill informations More...
 
 fillRegistrationPeriod ()
 show information about the registration period More...
 
 fillMaxMembers ()
 fill max member information @access protected More...
 
 fillRegistrationType ()
 show informations about registration procedure More...
 
 addCommandButtons ()
 Add group specific command buttons. More...
 
 validate ()
 validate join request @access protected More...
 
 add ()
 add user More...
 
 initParticipants ()
 Init course participants. More...
 
 initWaitingList ()
 
 isWaitingListActive ()
 
- Protected Member Functions inherited from ilRegistrationGUI
 isRegistrationPossible ()
 
 enableRegistration (bool $a_status)
 
 initParticipants ()
 Init participants object (course or group participants) More...
 
 initWaitingList ()
 Init waiting list (course or group waiting list) More...
 
 isWaitingListActive ()
 Check if the waiting list is active Maximum of members exceeded or any user on the waiting list. More...
 
 getWaitingList ()
 Get waiting list object. More...
 
 leaveWaitingList ()
 
 getFormTitle ()
 Get title for property form. More...
 
 fillInformations ()
 fill informations More...
 
 fillRegistrationPeriod ()
 show informations about the registration period More...
 
 fillMaxMembers ()
 show informations about the maximum number of user. More...
 
 fillRegistrationType ()
 show informations about registration procedure More...
 
 fillMembershipLimitation ()
 Show membership limitations. More...
 
 fillAgreement ()
 
 showCustomFields ()
 
 validateAgreement ()
 
 validateCustomFields ()
 
 setAccepted (bool $a_status)
 
 validate ()
 
 initForm ()
 
 addCommandButtons ()
 
 updateSubscriptionRequest ()
 
 cancelSubscriptionRequest ()
 

Additional Inherited Members

- Protected Attributes inherited from ilRegistrationGUI
int $ref_id
 
int $obj_id
 
string $type
 
string $join_error = ''
 
bool $registration_possible = true
 
ILIAS HTTP GlobalHttpState $http
 
ILIAS Refinery Factory $refinery
 
ilPrivacySettings $privacy
 
ilObject $container
 
ilParticipants $participants
 
ilWaitingList $waiting_list
 
ilPropertyFormGUI $form = null
 
ilObjUser $user
 
ilTabsGUI $tabs
 
ilTree $tree
 
ilRbacReview $rbacreview
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilAccessHandler $access
 

Detailed Description

GUI class for group registrations.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

\

Definition at line 29 of file class.ilGroupRegistrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilGroupRegistrationGUI::__construct ( ilObject  $a_container)

Reimplemented from ilRegistrationGUI.

Definition at line 31 of file class.ilGroupRegistrationGUI.php.

32 {
33 parent::__construct($a_container);
34 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilGroupRegistrationGUI::add ( )
protected

add user

Definition at line 372 of file class.ilGroupRegistrationGUI.php.

372 : void
373 {
374 // set agreement accepted
375 $this->setAccepted(true);
376
377 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
378 $waiting_list = new ilGroupWaitingList($this->container->getId());
379 if (
380 $this->container->isMembershipLimited() and
381 $this->container->isWaitingListEnabled() and
382 (!$free or $waiting_list->getCountUsers())) {
383 $waiting_list->addToList($this->user->getId());
384 $info = sprintf(
385 $this->lng->txt('grp_added_to_list'),
386 $this->container->getTitle(),
387 $waiting_list->getPosition($this->user->getId())
388 );
389
390 $this->participants->sendNotification(
392 $this->user->getId()
393 );
394 $this->tpl->setOnScreenMessage('success', $info, true);
395 $this->ctrl->setParameterByClass(
396 "ilrepositorygui",
397 "ref_id",
398 $this->tree->getParentId($this->container->getRefId())
399 );
400 $this->ctrl->redirectByClass("ilrepositorygui", "");
401 }
402
403 switch ($this->container->getRegistrationType()) {
405
406 $this->participants->addSubscriber($this->user->getId());
407 $this->participants->updateSubscriptionTime($this->user->getId(), time());
408 $subject = '';
409 if ($this->http->wrapper()->post()->has('subject')) {
410 $subject = $this->http->wrapper()->post()->retrieve(
411 'subject',
412 $this->refinery->kindlyTo()->string()
413 );
414 }
415 $this->participants->updateSubject($this->user->getId(), $subject);
416 $this->participants->sendNotification(
418 $this->user->getId()
419 );
420
421 $this->tpl->setOnScreenMessage('success', $this->lng->txt("application_completed"), true);
422 $this->ctrl->setParameterByClass(
423 "ilrepositorygui",
424 "ref_id",
425 $this->tree->getParentId($this->container->getRefId())
426 );
427 $this->ctrl->redirectByClass("ilrepositorygui", "");
428 break;
429
430 default:
431
432 $this->participants->add($this->user->getId(), ilParticipants::IL_GRP_MEMBER);
433 $this->participants->sendNotification(
435 $this->user->getId()
436 );
437 $this->participants->sendNotification(
439 $this->user->getId()
440 );
441
442 ilForumNotification::checkForumsExistsInsert($this->container->getRefId(), $this->user->getId());
443
444 $pending_goto = ilSession::get('pending_goto');
445 if (!$pending_goto) {
446 $this->tpl->setOnScreenMessage('success', $this->lng->txt("grp_registration_completed"), true);
447 $this->ctrl->returnToParent($this);
448 } else {
449 $tgt = $pending_goto;
450 ilSession::clear('pending_goto');
451 ilUtil::redirect($tgt);
452 }
453 break;
454 }
455 }
static checkForumsExistsInsert(int $ref_id, int $user_id)
Waiting list for groups.
static get(string $a_var)
static clear(string $a_var)
static redirect(string $a_script)
addToList(int $a_usr_id)
getPosition(int $a_usr_id)
$info
Definition: entry_point.php:21
static http()
Fetches the global http state from ILIAS.

References $info, ilRegistrationGUI\$waiting_list, ilWaitingList\addToList(), ilForumNotification\checkForumsExistsInsert(), ilSession\clear(), ILIAS\Repository\ctrl(), ilSession\get(), ilWaitingList\getCountUsers(), ilWaitingList\getPosition(), ilGroupConstants\GRP_REGISTRATION_REQUEST, ILIAS\FileDelivery\http(), ilParticipants\IL_GRP_MEMBER, ILIAS\Repository\lng(), ilUtil\redirect(), ILIAS\Repository\refinery(), ilRegistrationGUI\setAccepted(), ilGroupMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION, ilGroupMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION_REQUEST, ilGroupMembershipMailNotification\TYPE_SUBSCRIBE_MEMBER, ilGroupMembershipMailNotification\TYPE_WAITING_LIST_MEMBER, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ addCommandButtons()

ilGroupRegistrationGUI::addCommandButtons ( )
protected

Add group specific command buttons.

Returns
void

Reimplemented from ilRegistrationGUI.

Definition at line 302 of file class.ilGroupRegistrationGUI.php.

302 : void
303 {
304 parent::addCommandButtons();
305 switch ($this->container->getRegistrationType()) {
307 if ($this->participants->isSubscriber($this->user->getId())) {
308 $this->form->clearCommandButtons();
309 $this->form->addCommandButton('updateSubscriptionRequest', $this->lng->txt('grp_update_subscr_request'));
310 $this->form->addCommandButton('cancelSubscriptionRequest', $this->lng->txt('grp_cancel_subscr_request'));
311 } else {
312 if (!$this->isRegistrationPossible()) {
313 return;
314 }
315 $this->form->clearCommandButtons();
316 $this->form->addCommandButton('join', $this->lng->txt('grp_join_request'));
317 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
318 }
319 break;
320 }
321 }
form( $class_path, string $cmd, string $submit_caption="")

References ILIAS\Repository\form(), ilGroupConstants\GRP_REGISTRATION_REQUEST, ilRegistrationGUI\isRegistrationPossible(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ executeCommand()

ilGroupRegistrationGUI::executeCommand ( )

Definition at line 36 of file class.ilGroupRegistrationGUI.php.

36 : void
37 {
38 $next_class = $this->ctrl->getNextClass($this);
39
40 if (!$this->access->checkAccess('join', '', $this->getRefId())) {
41 $this->ctrl->redirectByClass(ilObjGroupGUI::class, 'infoScreen');
42 }
43
44 if ($this->getWaitingList()->isOnList($this->user->getId())) {
45 $this->tabs->activateTab('leave');
46 }
47
48 switch ($next_class) {
49 default:
50 $cmd = $this->ctrl->getCmd("show");
51 $this->$cmd();
52 break;
53 }
54 }
getWaitingList()
Get waiting list object.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilRegistrationGUI\getWaitingList(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ fillInformations()

ilGroupRegistrationGUI::fillInformations ( )
protected

fill informations

Reimplemented from ilRegistrationGUI.

Definition at line 65 of file class.ilGroupRegistrationGUI.php.

65 : void
66 {
67 if ($this->container->getInformation()) {
68 $imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'), '', true);
69 $value = nl2br(ilUtil::makeClickable($this->container->getInformation(), true));
70 $imp->setValue($value);
71 $this->form->addItem($imp);
72 }
73 }
This class represents a non editable value in a property form.
static makeClickable(string $a_text, bool $detectGotoLinks=false, ?string $ilias_http_path=null)

References ILIAS\Repository\form(), ILIAS\Repository\lng(), and ilUtil\makeClickable().

+ Here is the call graph for this function:

◆ fillMaxMembers()

ilGroupRegistrationGUI::fillMaxMembers ( )
protected

fill max member information @access protected

Returns
void

Reimplemented from ilRegistrationGUI.

Definition at line 133 of file class.ilGroupRegistrationGUI.php.

133 : void
134 {
135 $alert = '';
136 if (!$this->container->isMembershipLimited()) {
137 return;
138 }
139
140 $tpl = new ilTemplate('tpl.max_members_form.html', true, true, 'components/ILIAS/Membership');
141
142 if ($this->container->getMinMembers()) {
143 $tpl->setVariable('TXT_MIN', $this->lng->txt('mem_min_users'));
144 $tpl->setVariable('NUM_MIN', $this->container->getMinMembers());
145 }
146
147 if ($this->container->getMaxMembers()) {
148 $tpl->setVariable('TXT_MAX', $this->lng->txt('mem_max_users'));
149 $tpl->setVariable('NUM_MAX', $this->container->getMaxMembers());
150 $tpl->setVariable('TXT_FREE', $this->lng->txt('mem_free_places') . ":");
151
153 $free = $reg_info['reg_info_free_places'];
154
155
156 if ($free) {
157 $tpl->setVariable('NUM_FREE', $free);
158 } else {
159 $tpl->setVariable('WARN_FREE', $free);
160 }
161
162 $waiting_list = new ilGroupWaitingList($this->container->getId());
163
164 if (
165 $this->container->isWaitingListEnabled() and
166 $this->container->isMembershipLimited() and
167 (!$free or $waiting_list->getCountUsers())) {
168 if ($waiting_list->isOnList($this->user->getId())) {
169 $tpl->setVariable('TXT_WAIT', $this->lng->txt('mem_waiting_list_position'));
170 $tpl->setVariable('NUM_WAIT', $waiting_list->getPosition($this->user->getId()));
171 } else {
172 $tpl->setVariable('TXT_WAIT', $this->lng->txt('mem_waiting_list'));
173 if ($free and $waiting_list->getCountUsers()) {
175 } else {
177 }
178 }
179 }
180
181 if (
182 !$free and
183 !$this->container->isWaitingListEnabled()) {
184 // Disable registration
185 $this->enableRegistration(false);
186 $alert = $this->lng->txt('mem_alert_no_places');
187 } elseif (
188 $this->container->isWaitingListEnabled() and
189 $this->container->isMembershipLimited() and
190 $waiting_list->isOnList($this->user->getId())) {
191 // Disable registration
192 $this->enableRegistration(false);
193 } elseif (
194 !$free and
195 $this->container->isWaitingListEnabled() and
196 $this->container->isMembershipLimited()) {
197 $alert = $this->lng->txt('grp_warn_no_max_set_on_waiting_list');
198 } elseif (
199 $free and
200 $this->container->isWaitingListEnabled() and
201 $this->container->isMembershipLimited() and
202 $this->getWaitingList()->getCountUsers()) {
203 $alert = $this->lng->txt('grp_warn_wl_set_on_waiting_list');
204 }
205 }
206
207 $max = new ilCustomInputGUI($this->lng->txt('mem_participants'));
208 $max->setHtml($tpl->get());
209 if (strlen($alert)) {
210 #$max->setAlert($alert);
211 $this->tpl->setOnScreenMessage('failure', $alert);
212 }
213 $this->form->addItem($max);
214 }
This class represents a custom property in a property form.
static lookupRegistrationInfo(int $a_obj_id)
ilGlobalTemplateInterface $tpl
enableRegistration(bool $a_status)
special template class to simplify handling of ITX/PEAR
isOnList(int $a_usr_id)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References ilRegistrationGUI\$tpl, ilRegistrationGUI\$waiting_list, ilRegistrationGUI\enableRegistration(), ILIAS\Repository\form(), ILIAS\UICore\GlobalTemplate\get(), ilRegistrationGUI\getContainer(), ilWaitingList\getCountUsers(), ILIAS\Survey\Mode\getId(), ilWaitingList\getPosition(), ilWaitingList\isOnList(), ILIAS\Repository\lng(), ilObjGroupAccess\lookupRegistrationInfo(), and ILIAS\UICore\GlobalTemplate\setVariable().

+ Here is the call graph for this function:

◆ fillRegistrationPeriod()

ilGroupRegistrationGUI::fillRegistrationPeriod ( )
protected

show information about the registration period

Reimplemented from ilRegistrationGUI.

Definition at line 78 of file class.ilGroupRegistrationGUI.php.

78 : void
79 {
80 $now = new ilDateTime(time(), IL_CAL_UNIX, 'UTC');
81
82 if ($this->container->isRegistrationUnlimited()) {
83 $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_period'));
84 $reg->setValue($this->lng->txt('mem_unlimited'));
85 $this->form->addItem($reg);
86 return;
87 }
88
89 $start = $this->container->getRegistrationStart();
90 $end = $this->container->getRegistrationEnd();
91
92 $warning = '';
93 if (ilDateTime::_before($now, $start)) {
94 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'components/ILIAS/Membership');
95 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
97
98 $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
100
101 $warning = $this->lng->txt('mem_reg_not_started');
102 } elseif (ilDateTime::_after($now, $end)) {
103 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'components/ILIAS/Membership');
104 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
106
107 $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
109
110 $warning = $this->lng->txt('mem_reg_expired');
111 } else {
112 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'components/ILIAS/Membership');
113 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_end'));
115 }
116
117 $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_period'));
118 $reg->setHtml($tpl->get());
119 if (strlen($warning)) {
120 // Disable registration
121 $this->enableRegistration(false);
122 #$reg->setAlert($warning);
123 $this->tpl->setOnScreenMessage('failure', $warning);
124 }
125 $this->form->addItem($reg);
126 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.

References ilRegistrationGUI\$tpl, ilDateTime\_after(), ilDateTime\_before(), ilRegistrationGUI\enableRegistration(), ILIAS\Repository\form(), ilDatePresentation\formatDate(), ILIAS\UICore\GlobalTemplate\get(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setVariable().

+ Here is the call graph for this function:

◆ fillRegistrationType()

ilGroupRegistrationGUI::fillRegistrationType ( )
protected

show informations about registration procedure

Reimplemented from ilRegistrationGUI.

Definition at line 216 of file class.ilGroupRegistrationGUI.php.

216 : void
217 {
218 if ($this->getWaitingList()->isOnList($this->user->getId())) {
219 return;
220 }
221
222 switch ($this->container->getRegistrationType()) {
224 $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
225 $reg->setValue($this->lng->txt('grp_reg_disabled'));
226 #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
227 $this->form->addItem($reg);
228
229 // Disable registration
230 $this->enableRegistration(false);
231
232 break;
233
235 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
236 $txt->setValue($this->lng->txt('grp_pass_request'));
237
238
239 $pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
240 $pass->setInputType('password');
241 $pass->setSize(12);
242 $pass->setMaxLength(32);
243 #$pass->setRequired(true);
244 $pass->setInfo($this->lng->txt('group_password_registration_msg'));
245
246 $txt->addSubItem($pass);
247 $this->form->addItem($txt);
248 break;
249
251
252 // no "request" info if waiting list is active
253 if ($this->isWaitingListActive()) {
254 return;
255 }
256
257 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
258 $txt->setValue($this->lng->txt('grp_reg_request'));
259
260 $sub = new ilTextAreaInputGUI($this->lng->txt('grp_reg_subject'), 'subject');
261 $subject = '';
262 if ($this->http->wrapper()->post()->has('subject')) {
263 $subject = $this->http->wrapper()->post()->retrieve(
264 'subject',
265 $this->refinery->kindlyTo()->string()
266 );
267 }
268 $sub->setValue($subject);
269 $sub->setInfo($this->lng->txt('group_req_registration_msg'));
270 $sub->setCols(40);
271 $sub->setRows(5);
272 if ($this->participants->isSubscriber($this->user->getId())) {
273 $sub_data = $this->participants->getSubscriberData($this->user->getId());
274 $sub->setValue($sub_data['subject']);
275 $sub->setInfo('');
276 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('grp_already_assigned'));
277 $this->enableRegistration(false);
278 }
279 $txt->addSubItem($sub);
280 $this->form->addItem($txt);
281 break;
282
284
285 // no "direct registration" info if waiting list is active
286 if ($this->isWaitingListActive()) {
287 return;
288 }
289
290 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
291 $txt->setValue($this->lng->txt('group_req_direct'));
292
293 $this->form->addItem($txt);
294 break;
295 }
296 }
This class represents a text area property in a property form.
This class represents a text property in a property form.
$txt
Definition: error.php:31

References $txt, ilRegistrationGUI\enableRegistration(), ILIAS\Repository\form(), ilRegistrationGUI\getWaitingList(), ilGroupConstants\GRP_REGISTRATION_DEACTIVATED, ilGroupConstants\GRP_REGISTRATION_DIRECT, ilGroupConstants\GRP_REGISTRATION_PASSWORD, ilGroupConstants\GRP_REGISTRATION_REQUEST, ILIAS\FileDelivery\http(), isWaitingListActive(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getFormTitle()

ilGroupRegistrationGUI::getFormTitle ( )
protected

Get title for property form.

Reimplemented from ilRegistrationGUI.

Definition at line 57 of file class.ilGroupRegistrationGUI.php.

57 : string
58 {
59 if ($this->getWaitingList()->isOnList($this->user->getId())) {
60 return $this->lng->txt('member_status');
61 }
62 return $this->lng->txt('grp_registration');
63 }

References ilRegistrationGUI\getWaitingList(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ initParticipants()

ilGroupRegistrationGUI::initParticipants ( )
protected

Init course participants.

@access protected

Reimplemented from ilRegistrationGUI.

Definition at line 463 of file class.ilGroupRegistrationGUI.php.

464 {
465 $this->participants = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
466 return $this->participants;
467 }
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
Base class for course and group participants.

References ilRegistrationGUI\$participants, and ilGroupParticipants\_getInstanceByObjId().

+ Here is the call graph for this function:

◆ initWaitingList()

ilGroupRegistrationGUI::initWaitingList ( )
protected
See also
ilRegistrationGUI::initWaitingList() @access protected

Reimplemented from ilRegistrationGUI.

Definition at line 473 of file class.ilGroupRegistrationGUI.php.

474 {
475 $this->waiting_list = new ilGroupWaitingList($this->container->getId());
476 return $this->waiting_list;
477 }
Base class for course and group waiting lists.

References ilRegistrationGUI\$waiting_list.

◆ isWaitingListActive()

ilGroupRegistrationGUI::isWaitingListActive ( )
protected
See also
ilRegistrationGUI::isWaitingListActive()

Reimplemented from ilRegistrationGUI.

Definition at line 482 of file class.ilGroupRegistrationGUI.php.

482 : bool
483 {
484 static $active = null;
485
486 if ($active !== null) {
487 return $active;
488 }
489 if (!$this->container->getMaxMembers()) {
490 return $active = false;
491 }
492 if (
493 !$this->container->isWaitingListEnabled() or
494 !$this->container->isMembershipLimited()) {
495 return $active = false;
496 }
497
498 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
499 return $active = (!$free or $this->getWaitingList()->getCountUsers());
500 }

References ilRegistrationGUI\getWaitingList().

Referenced by fillRegistrationType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilGroupRegistrationGUI::validate ( )
protected

validate join request @access protected

Returns
bool

Reimplemented from ilRegistrationGUI.

Definition at line 329 of file class.ilGroupRegistrationGUI.php.

329 : bool
330 {
331 if ($this->user->getId() == ANONYMOUS_USER_ID) {
332 $this->join_error = $this->lng->txt('permission_denied');
333 return false;
334 }
335
336 if (!$this->isRegistrationPossible()) {
337 $this->join_error = $this->lng->txt('mem_error_preconditions');
338 return false;
339 }
340 if ($this->container->getRegistrationType() == ilGroupConstants::GRP_REGISTRATION_PASSWORD) {
341 $password = '';
342 if ($this->http->wrapper()->post()->has('grp_passw')) {
343 $password = $this->http->wrapper()->post()->retrieve(
344 'grp_passw',
345 $this->refinery->kindlyTo()->string()
346 );
347 }
348 if (!strlen($password)) {
349 $this->join_error = $this->lng->txt('err_wrong_password');
350 return false;
351 }
352 if (strcmp($password, $this->container->getPassword()) !== 0) {
353 $this->join_error = $this->lng->txt('err_wrong_password');
354 return false;
355 }
356 }
357 if (!$this->validateCustomFields()) {
358 $this->join_error = $this->lng->txt('fill_out_all_required_fields');
359 return false;
360 }
361 if (!$this->validateAgreement()) {
362 $this->join_error = $this->lng->txt($this->type . '_agreement_required');
363 return false;
364 }
365
366 return true;
367 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

References ANONYMOUS_USER_ID, ilGroupConstants\GRP_REGISTRATION_PASSWORD, ILIAS\FileDelivery\http(), ilRegistrationGUI\isRegistrationPossible(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\user(), ilRegistrationGUI\validateAgreement(), and ilRegistrationGUI\validateCustomFields().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: