ILIAS  release_8 Revision v8.24
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 35 of file class.ilGroupRegistrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilGroupRegistrationGUI::__construct ( ilObject  $a_container)

Reimplemented from ilRegistrationGUI.

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

38 {
39 parent::__construct($a_container);
40 }
__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 379 of file class.ilGroupRegistrationGUI.php.

379 : void
380 {
381 // set agreement accepted
382 $this->setAccepted(true);
383
384 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
385 $waiting_list = new ilGroupWaitingList($this->container->getId());
386 if (
387 $this->container->isMembershipLimited() and
388 $this->container->isWaitingListEnabled() and
389 (!$free or $waiting_list->getCountUsers())) {
390 $waiting_list->addToList($this->user->getId());
391 $info = sprintf(
392 $this->lng->txt('grp_added_to_list'),
393 $this->container->getTitle(),
394 $waiting_list->getPosition($this->user->getId())
395 );
396
397 $this->participants->sendNotification(
399 $this->user->getId()
400 );
401 $this->tpl->setOnScreenMessage('success', $info, true);
402 $this->ctrl->setParameterByClass(
403 "ilrepositorygui",
404 "ref_id",
405 $this->tree->getParentId($this->container->getRefId())
406 );
407 $this->ctrl->redirectByClass("ilrepositorygui", "");
408 }
409
410 switch ($this->container->getRegistrationType()) {
412
413 $this->participants->addSubscriber($this->user->getId());
414 $this->participants->updateSubscriptionTime($this->user->getId(), time());
415 $subject = '';
416 if ($this->http->wrapper()->post()->has('subject')) {
417 $subject = $this->http->wrapper()->post()->retrieve(
418 'subject',
419 $this->refinery->kindlyTo()->string()
420 );
421 }
422 $this->participants->updateSubject($this->user->getId(), $subject);
423 $this->participants->sendNotification(
425 $this->user->getId()
426 );
427
428 $this->tpl->setOnScreenMessage('success', $this->lng->txt("application_completed"), true);
429 $this->ctrl->setParameterByClass(
430 "ilrepositorygui",
431 "ref_id",
432 $this->tree->getParentId($this->container->getRefId())
433 );
434 $this->ctrl->redirectByClass("ilrepositorygui", "");
435 break;
436
437 default:
438
439 $this->participants->add($this->user->getId(), ilParticipants::IL_GRP_MEMBER);
440 $this->participants->sendNotification(
442 $this->user->getId()
443 );
444 $this->participants->sendNotification(
446 $this->user->getId()
447 );
448
449 ilForumNotification::checkForumsExistsInsert($this->container->getRefId(), $this->user->getId());
450
451 $pending_goto = ilSession::get('pending_goto');
452 if (!$pending_goto) {
453 $this->tpl->setOnScreenMessage('success', $this->lng->txt("grp_registration_completed"), true);
454 $this->ctrl->returnToParent($this);
455 } else {
456 $tgt = $pending_goto;
457 ilSession::clear('pending_goto');
458 ilUtil::redirect($tgt);
459 }
460 break;
461 }
462 }
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)
static http()
Fetches the global http state from ILIAS.

References 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 309 of file class.ilGroupRegistrationGUI.php.

309 : void
310 {
311 parent::addCommandButtons();
312 switch ($this->container->getRegistrationType()) {
314 if ($this->participants->isSubscriber($this->user->getId())) {
315 $this->form->clearCommandButtons();
316 $this->form->addCommandButton('updateSubscriptionRequest', $this->lng->txt('grp_update_subscr_request'));
317 $this->form->addCommandButton('cancelSubscriptionRequest', $this->lng->txt('grp_cancel_subscr_request'));
318 } else {
319 if (!$this->isRegistrationPossible()) {
320 return;
321 }
322 $this->form->clearCommandButtons();
323 $this->form->addCommandButton('join', $this->lng->txt('grp_join_request'));
324 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
325 }
326 break;
327 }
328 }
form( $class_path, string $cmd)

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 42 of file class.ilGroupRegistrationGUI.php.

42 : void
43 {
44 $next_class = $this->ctrl->getNextClass($this);
45
46 if (!$this->access->checkAccess('join', '', $this->getRefId())) {
47 $this->ctrl->redirectByClass(ilObjGroupGUI::class, 'infoScreen');
48 }
49
50 if ($this->getWaitingList()->isOnList($this->user->getId())) {
51 $this->tabs->activateTab('leave');
52 }
53
54 switch ($next_class) {
55 default:
56 $cmd = $this->ctrl->getCmd("show");
57 $this->$cmd();
58 break;
59 }
60 }
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 71 of file class.ilGroupRegistrationGUI.php.

71 : void
72 {
73 if ($this->container->getInformation()) {
74 $imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'), '', true);
75 $value = nl2br(ilUtil::makeClickable($this->container->getInformation(), true));
76 $imp->setValue($value);
77 $this->form->addItem($imp);
78 }
79 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeClickable(string $a_text, bool $detectGotoLinks=false)

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 139 of file class.ilGroupRegistrationGUI.php.

139 : void
140 {
141 $alert = '';
142 if (!$this->container->isMembershipLimited()) {
143 return;
144 }
145
146 $tpl = new ilTemplate('tpl.max_members_form.html', true, true, 'Services/Membership');
147
148 if ($this->container->getMinMembers()) {
149 $tpl->setVariable('TXT_MIN', $this->lng->txt('mem_min_users'));
150 $tpl->setVariable('NUM_MIN', $this->container->getMinMembers());
151 }
152
153 if ($this->container->getMaxMembers()) {
154 $tpl->setVariable('TXT_MAX', $this->lng->txt('mem_max_users'));
155 $tpl->setVariable('NUM_MAX', $this->container->getMaxMembers());
156 $tpl->setVariable('TXT_FREE', $this->lng->txt('mem_free_places') . ":");
157
159 $free = $reg_info['reg_info_free_places'];
160
161
162 if ($free) {
163 $tpl->setVariable('NUM_FREE', $free);
164 } else {
165 $tpl->setVariable('WARN_FREE', $free);
166 }
167
168 $waiting_list = new ilGroupWaitingList($this->container->getId());
169
170 if (
171 $this->container->isWaitingListEnabled() and
172 $this->container->isMembershipLimited() and
173 (!$free or $waiting_list->getCountUsers())) {
174 if ($waiting_list->isOnList($this->user->getId())) {
175 $tpl->setVariable('TXT_WAIT', $this->lng->txt('mem_waiting_list_position'));
176 $tpl->setVariable('NUM_WAIT', $waiting_list->getPosition($this->user->getId()));
177 } else {
178 $tpl->setVariable('TXT_WAIT', $this->lng->txt('mem_waiting_list'));
179 if ($free and $waiting_list->getCountUsers()) {
181 } else {
183 }
184 }
185 }
186
187 if (
188 !$free and
189 !$this->container->isWaitingListEnabled()) {
190 // Disable registration
191 $this->enableRegistration(false);
192 $alert = $this->lng->txt('mem_alert_no_places');
193 } elseif (
194 $this->container->isWaitingListEnabled() and
195 $this->container->isMembershipLimited() and
196 $waiting_list->isOnList($this->user->getId())) {
197 // Disable registration
198 $this->enableRegistration(false);
199 } elseif (
200 !$free and
201 $this->container->isWaitingListEnabled() and
202 $this->container->isMembershipLimited()) {
203 $alert = $this->lng->txt('grp_warn_no_max_set_on_waiting_list');
204 } elseif (
205 $free and
206 $this->container->isWaitingListEnabled() and
207 $this->container->isMembershipLimited() and
208 $this->getWaitingList()->getCountUsers()) {
209 $alert = $this->lng->txt('grp_warn_wl_set_on_waiting_list');
210 }
211 }
212
213 $max = new ilCustomInputGUI($this->lng->txt('mem_participants'));
214 $max->setHtml($tpl->get());
215 if (strlen($alert)) {
216 #$max->setAlert($alert);
217 $this->tpl->setOnScreenMessage('failure', $alert);
218 }
219 $this->form->addItem($max);
220 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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(), ilGlobalTemplateInterface\get(), ilRegistrationGUI\getContainer(), ilWaitingList\getCountUsers(), ILIAS\Survey\Mode\getId(), ilWaitingList\getPosition(), ilWaitingList\isOnList(), ILIAS\Repository\lng(), ilObjGroupAccess\lookupRegistrationInfo(), and ilGlobalTemplateInterface\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 84 of file class.ilGroupRegistrationGUI.php.

84 : void
85 {
86 $now = new ilDateTime(time(), IL_CAL_UNIX, 'UTC');
87
88 if ($this->container->isRegistrationUnlimited()) {
89 $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_period'));
90 $reg->setValue($this->lng->txt('mem_unlimited'));
91 $this->form->addItem($reg);
92 return;
93 }
94
95 $start = $this->container->getRegistrationStart();
96 $end = $this->container->getRegistrationEnd();
97
98 $warning = '';
99 if (ilDateTime::_before($now, $start)) {
100 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
101 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
103
104 $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
106
107 $warning = $this->lng->txt('mem_reg_not_started');
108 } elseif (ilDateTime::_after($now, $end)) {
109 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
110 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
112
113 $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
115
116 $warning = $this->lng->txt('mem_reg_expired');
117 } else {
118 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
119 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_end'));
121 }
122
123 $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_period'));
124 $reg->setHtml($tpl->get());
125 if (strlen($warning)) {
126 // Disable registration
127 $this->enableRegistration(false);
128 #$reg->setAlert($warning);
129 $this->tpl->setOnScreenMessage('failure', $warning);
130 }
131 $this->form->addItem($reg);
132 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@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(), ilGlobalTemplateInterface\get(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setVariable().

+ Here is the call graph for this function:

◆ fillRegistrationType()

ilGroupRegistrationGUI::fillRegistrationType ( )
protected

show informations about registration procedure

Reimplemented from ilRegistrationGUI.

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

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

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 63 of file class.ilGroupRegistrationGUI.php.

63 : string
64 {
65 if ($this->getWaitingList()->isOnList($this->user->getId())) {
66 return $this->lng->txt('member_status');
67 }
68 return $this->lng->txt('grp_registration');
69 }

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 470 of file class.ilGroupRegistrationGUI.php.

471 {
472 $this->participants = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
473 return $this->participants;
474 }
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 480 of file class.ilGroupRegistrationGUI.php.

481 {
482 $this->waiting_list = new ilGroupWaitingList($this->container->getId());
483 return $this->waiting_list;
484 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilRegistrationGUI\$waiting_list.

◆ isWaitingListActive()

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

Reimplemented from ilRegistrationGUI.

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

489 : bool
490 {
491 static $active = null;
492
493 if ($active !== null) {
494 return $active;
495 }
496 if (!$this->container->getMaxMembers()) {
497 return $active = false;
498 }
499 if (
500 !$this->container->isWaitingListEnabled() or
501 !$this->container->isMembershipLimited()) {
502 return $active = false;
503 }
504
505 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
506 return $active = (!$free or $this->getWaitingList()->getCountUsers());
507 }

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 336 of file class.ilGroupRegistrationGUI.php.

336 : bool
337 {
338 if ($this->user->getId() == ANONYMOUS_USER_ID) {
339 $this->join_error = $this->lng->txt('permission_denied');
340 return false;
341 }
342
343 if (!$this->isRegistrationPossible()) {
344 $this->join_error = $this->lng->txt('mem_error_preconditions');
345 return false;
346 }
347 if ($this->container->getRegistrationType() == ilGroupConstants::GRP_REGISTRATION_PASSWORD) {
348 $password = '';
349 if ($this->http->wrapper()->post()->has('grp_passw')) {
350 $password = $this->http->wrapper()->post()->retrieve(
351 'grp_passw',
352 $this->refinery->kindlyTo()->string()
353 );
354 }
355 if (!strlen($password)) {
356 $this->join_error = $this->lng->txt('err_wrong_password');
357 return false;
358 }
359 if (strcmp($password, $this->container->getPassword()) !== 0) {
360 $this->join_error = $this->lng->txt('err_wrong_password');
361 return false;
362 }
363 }
364 if (!$this->validateCustomFields()) {
365 $this->join_error = $this->lng->txt('fill_out_all_required_fields');
366 return false;
367 }
368 if (!$this->validateAgreement()) {
369 $this->join_error = $this->lng->txt($this->type . '_agreement_required');
370 return false;
371 }
372
373 return true;
374 }
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: