ILIAS  release_7 Revision v7.30-3-g800a261c036
ilGroupRegistrationGUI Class Reference

GUI class for group registrations. More...

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

Public Member Functions

 __construct ($a_container)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
- Public Member Functions inherited from ilRegistrationGUI
 __construct ($a_container)
 Constructor. More...
 
 getContainer ()
 Parent object. More...
 
 getRefId ()
 Get ref. More...
 
 cancel ()
 cancel subscription More...
 
 show (ilPropertyFormGUI $form=null)
 show registration form More...
 
 join ()
 join More...
 

Protected Member Functions

 getFormTitle ()
 get form title More...
 
 fillInformations ()
 fill informations More...
 
 fillRegistrationPeriod ()
 show informations about the registration period More...
 
 fillMaxMembers ()
 fill max member informations More...
 
 fillRegistrationType ()
 fill registration procedure More...
 
 addCommandButtons ()
 Add group specific command buttons. More...
 
 validate ()
 validate join request More...
 
 add ()
 add user More...
 
 initParticipants ()
 Init course participants. More...
 
 initWaitingList ()
 
 isWaitingListActive ()
 
- Protected Member Functions inherited from ilRegistrationGUI
 isRegistrationPossible ()
 check if registration is possible More...
 
 enableRegistration ($a_status)
 set registration disabled More...
 
 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 ()
 Show user agreement. More...
 
 showCustomFields ()
 Show course defined fields. More...
 
 validateAgreement ()
 Check Agreement. More...
 
 validateCustomFields ()
 Check required course fields. More...
 
 setAccepted ($a_status)
 Set Agreement accepted. More...
 
 validate ()
 validate join request More...
 
 initForm ()
 init registration form More...
 
 addCommandButtons ()
 Add command buttons. More...
 
 updateSubscriptionRequest ()
 Update subscription message. More...
 
 cancelSubscriptionRequest ()
 

Additional Inherited Members

- Protected Attributes inherited from ilRegistrationGUI
 $privacy = null
 
 $container = null
 
 $ref_id
 
 $obj_id
 
 $participants
 
 $waiting_list = null
 
 $form
 
 $registration_possible = true
 
 $join_error = ''
 
 $tpl
 
 $lng
 
 $ctrl
 

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

Constructor & Destructor Documentation

◆ __construct()

ilGroupRegistrationGUI::__construct (   $a_container)

Constructor.

@access public

Parameters
objectcontainer object

Reimplemented from ilRegistrationGUI.

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

45 {
46 parent::__construct($a_container);
47 }
__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

@access protected

Parameters

return

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

443 {
444 global $DIC;
445
446 $ilUser = $DIC['ilUser'];
447 $tree = $DIC['tree'];
448 $rbacreview = $DIC['rbacreview'];
449 $lng = $DIC['lng'];
450 $ilCtrl = $DIC['ilCtrl'];
451
452 // set aggreement accepted
453 $this->setAccepted(true);
454
455 include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
456 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
457 $waiting_list = new ilGroupWaitingList($this->container->getId());
458 if (
459 $this->container->isMembershipLimited() and
460 $this->container->isWaitingListEnabled() and
461 (!$free or $waiting_list->getCountUsers())) {
462 $waiting_list->addToList($ilUser->getId());
463 $info = sprintf(
464 $this->lng->txt('grp_added_to_list'),
465 $this->container->getTitle(),
466 $waiting_list->getPosition($ilUser->getId())
467 );
468
469 $this->participants->sendNotification(
471 $ilUser->getId()
472 );
473 ilUtil::sendSuccess($info, true);
474 $ilCtrl->setParameterByClass(
475 "ilrepositorygui",
476 "ref_id",
477 $tree->getParentId($this->container->getRefId())
478 );
479 $ilCtrl->redirectByClass("ilrepositorygui", "");
480 }
481
482
483 switch ($this->container->getRegistrationType()) {
485
486 $this->participants->addSubscriber($ilUser->getId());
487 $this->participants->updateSubscriptionTime($ilUser->getId(), time());
488 $this->participants->updateSubject($ilUser->getId(), ilUtil::stripSlashes($_POST['subject']));
489
490 $this->participants->sendNotification(
492 $ilUser->getId()
493 );
494
495 ilUtil::sendSuccess($this->lng->txt("application_completed"), true);
496 $ilCtrl->setParameterByClass(
497 "ilrepositorygui",
498 "ref_id",
499 $tree->getParentId($this->container->getRefId())
500 );
501 $ilCtrl->redirectByClass("ilrepositorygui", "");
502 break;
503
504 default:
505
506 $this->participants->add($ilUser->getId(), IL_GRP_MEMBER);
507 $this->participants->sendNotification(
509 $ilUser->getId()
510 );
511 $this->participants->sendNotification(
513 $ilUser->getId()
514 );
515
516 include_once './Modules/Forum/classes/class.ilForumNotification.php';
517 ilForumNotification::checkForumsExistsInsert($this->container->getRefId(), $ilUser->getId());
518
519 if (!$_SESSION["pending_goto"]) {
520 ilUtil::sendSuccess($this->lng->txt("grp_registration_completed"), true);
521 $this->ctrl->returnToParent($this);
522 } else {
523 $tgt = $_SESSION["pending_goto"];
524 unset($_SESSION["pending_goto"]);
525 ilUtil::redirect($tgt);
526 }
527 break;
528 }
529 }
$_POST["username"]
$_SESSION["AccountId"]
const GRP_REGISTRATION_REQUEST
const IL_GRP_MEMBER
static checkForumsExistsInsert($ref_id, $user_id=0)
Waiting list for groups.
setAccepted($a_status)
Set Agreement accepted.
static redirect($a_script)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18

References $_POST, $_SESSION, $DIC, $ilUser, ilRegistrationGUI\$lng, ilRegistrationGUI\$waiting_list, ilForumNotification\checkForumsExistsInsert(), GRP_REGISTRATION_REQUEST, IL_GRP_MEMBER, ilUtil\redirect(), ilRegistrationGUI\setAccepted(), ilUtil\stripSlashes(), ilGroupMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION, ilGroupMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION_REQUEST, ilGroupMembershipMailNotification\TYPE_SUBSCRIBE_MEMBER, and ilGroupMembershipMailNotification\TYPE_WAITING_LIST_MEMBER.

+ Here is the call graph for this function:

◆ addCommandButtons()

ilGroupRegistrationGUI::addCommandButtons ( )
protected

Add group specific command buttons.

Returns

Reimplemented from ilRegistrationGUI.

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

364 {
365 global $DIC;
366
367 $ilUser = $DIC['ilUser'];
368
369 parent::addCommandButtons();
370
371
372 switch ($this->container->getRegistrationType()) {
374 if ($this->participants->isSubscriber($ilUser->getId())) {
375 $this->form->clearCommandButtons();
376 $this->form->addCommandButton('updateSubscriptionRequest', $this->lng->txt('grp_update_subscr_request'));
377 $this->form->addCommandButton('cancelSubscriptionRequest', $this->lng->txt('grp_cancel_subscr_request'));
378 } else {
379 if (!$this->isRegistrationPossible()) {
380 return false;
381 }
382 $this->form->clearCommandButtons();
383 $this->form->addCommandButton('join', $this->lng->txt('grp_join_request'));
384 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
385 }
386 break;
387 }
388 return true;
389 }
isRegistrationPossible()
check if registration is possible

References $DIC, $ilUser, GRP_REGISTRATION_REQUEST, and ilRegistrationGUI\isRegistrationPossible().

+ Here is the call graph for this function:

◆ executeCommand()

ilGroupRegistrationGUI::executeCommand ( )

Execute command.

@access public

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

55 {
56 global $DIC;
57
58 $ilUser = $DIC['ilUser'];
59 $ilTabs = $DIC['ilTabs'];
60
61 $next_class = $this->ctrl->getNextClass($this);
62
63 if (!$DIC->access()->checkAccess('join', '', $this->getRefId())) {
64 $this->ctrl->redirectByClass(ilObjGroupGUI::class, 'infoScreen');
65 }
66
67 if ($this->getWaitingList()->isOnList($ilUser->getId())) {
68 $ilTabs->activateTab('leave');
69 }
70
71 switch ($next_class) {
72 default:
73 $cmd = $this->ctrl->getCmd("show");
74 $this->$cmd();
75 break;
76 }
77 return true;
78 }
getWaitingList()
Get waiting list object.

References $DIC, $ilUser, and ilRegistrationGUI\getWaitingList().

+ Here is the call graph for this function:

◆ fillInformations()

ilGroupRegistrationGUI::fillInformations ( )
protected

fill informations

@access protected

Parameters

return

Reimplemented from ilRegistrationGUI.

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

107 {
108 if ($this->container->getInformation()) {
109 $imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'), '', true);
110 $value = nl2br(ilUtil::makeClickable($this->container->getInformation(), true));
111 $imp->setValue($value);
112 $this->form->addItem($imp);
113 }
114 }
This class represents a non editable value in a property form.
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen

References ilUtil\makeClickable().

+ Here is the call graph for this function:

◆ fillMaxMembers()

ilGroupRegistrationGUI::fillMaxMembers ( )
protected

fill max member informations

@access protected

Returns

Reimplemented from ilRegistrationGUI.

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

180 {
181 global $DIC;
182
183 $ilUser = $DIC['ilUser'];
184
185 if (!$this->container->isMembershipLimited()) {
186 return true;
187 }
188
189 $tpl = new ilTemplate('tpl.max_members_form.html', true, true, 'Services/Membership');
190
191 if ($this->container->getMinMembers()) {
192 $tpl->setVariable('TXT_MIN', $this->lng->txt('mem_min_users'));
193 $tpl->setVariable('NUM_MIN', $this->container->getMinMembers());
194 }
195
196 if ($this->container->getMaxMembers()) {
197 $tpl->setVariable('TXT_MAX', $this->lng->txt('mem_max_users'));
198 $tpl->setVariable('NUM_MAX', $this->container->getMaxMembers());
199 $tpl->setVariable('TXT_FREE', $this->lng->txt('mem_free_places') . ":");
200
201 include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
202 $reg_info = ilObjGroupAccess::lookupRegistrationInfo($this->getContainer()->getId());
203 $free = $reg_info['reg_info_free_places'];
204
205
206 if ($free) {
207 $tpl->setVariable('NUM_FREE', $free);
208 } else {
209 $tpl->setVariable('WARN_FREE', $free);
210 }
211
212 include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
213 $waiting_list = new ilGroupWaitingList($this->container->getId());
214
215 if (
216 $this->container->isWaitingListEnabled() and
217 $this->container->isMembershipLimited() and
218 (!$free or $waiting_list->getCountUsers())) {
219 if ($waiting_list->isOnList($ilUser->getId())) {
220 $tpl->setVariable('TXT_WAIT', $this->lng->txt('mem_waiting_list_position'));
221 $tpl->setVariable('NUM_WAIT', $waiting_list->getPosition($ilUser->getId()));
222 } else {
223 $tpl->setVariable('TXT_WAIT', $this->lng->txt('mem_waiting_list'));
224 if ($free and $waiting_list->getCountUsers()) {
225 $tpl->setVariable('WARN_WAIT', $waiting_list->getCountUsers());
226 } else {
227 $tpl->setVariable('NUM_WAIT', $waiting_list->getCountUsers());
228 }
229 }
230 }
231
232 $alert = '';
233 if (
234 !$free and
235 !$this->container->isWaitingListEnabled()) {
236 // Disable registration
237 $this->enableRegistration(false);
238 $alert = $this->lng->txt('mem_alert_no_places');
239 } elseif (
240 $this->container->isWaitingListEnabled() and
241 $this->container->isMembershipLimited() and
242 $waiting_list->isOnList($ilUser->getId())) {
243 // Disable registration
244 $this->enableRegistration(false);
245 } elseif (
246 !$free and
247 $this->container->isWaitingListEnabled() and
248 $this->container->isMembershipLimited()) {
249 $alert = $this->lng->txt('grp_warn_no_max_set_on_waiting_list');
250 } elseif (
251 $free and
252 $this->container->isWaitingListEnabled() and
253 $this->container->isMembershipLimited() and
254 $this->getWaitingList()->getCountUsers()) {
255 $alert = $this->lng->txt('grp_warn_wl_set_on_waiting_list');
256 }
257 }
258
259 $max = new ilCustomInputGUI($this->lng->txt('mem_participants'));
260 $max->setHtml($tpl->get());
261 if (strlen($alert)) {
262 #$max->setAlert($alert);
263 ilUtil::sendFailure($alert);
264 }
265 $this->form->addItem($max);
266 }
This class represents a custom property in a property form.
static lookupRegistrationInfo($a_obj_id)
Lookup registration info @global ilDB $ilDB @global ilObjUser $ilUser @global ilLanguage $lng.
enableRegistration($a_status)
set registration disabled
special template class to simplify handling of ITX/PEAR
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $DIC, $ilUser, ilRegistrationGUI\$tpl, ilRegistrationGUI\$waiting_list, ilRegistrationGUI\enableRegistration(), ilRegistrationGUI\getContainer(), ilObjGroupAccess\lookupRegistrationInfo(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ fillRegistrationPeriod()

ilGroupRegistrationGUI::fillRegistrationPeriod ( )
protected

show informations about the registration period

@access protected

Reimplemented from ilRegistrationGUI.

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

122 {
123 include_once('./Services/Calendar/classes/class.ilDateTime.php');
124 $now = new ilDateTime(time(), IL_CAL_UNIX, 'UTC');
125
126 if ($this->container->isRegistrationUnlimited()) {
127 $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_period'));
128 $reg->setValue($this->lng->txt('mem_unlimited'));
129 $this->form->addItem($reg);
130 return true;
131 }
132
133 $start = $this->container->getRegistrationStart();
134 $end = $this->container->getRegistrationEnd();
135
136
137 if (ilDateTime::_before($now, $start)) {
138 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
139 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
140 $tpl->setVariable('FIRST', ilDatePresentation::formatDate($start));
141
142 $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
143 $tpl->setVariable('END', ilDatePresentation::formatDate($end));
144
145 $warning = $this->lng->txt('mem_reg_not_started');
146 } elseif (ilDateTime::_after($now, $end)) {
147 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
148 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
149 $tpl->setVariable('FIRST', ilDatePresentation::formatDate($start));
150
151 $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
152 $tpl->setVariable('END', ilDatePresentation::formatDate($end));
153
154 $warning = $this->lng->txt('mem_reg_expired');
155 } else {
156 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
157 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_end'));
158 $tpl->setVariable('FIRST', ilDatePresentation::formatDate($end));
159 }
160
161 $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_period'));
162 $reg->setHtml($tpl->get());
163 if (strlen($warning)) {
164 // Disable registration
165 $this->enableRegistration(false);
166 #$reg->setAlert($warning);
167 ilUtil::sendFailure($warning);
168 }
169 $this->form->addItem($reg);
170 return true;
171 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $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(), ilDatePresentation\formatDate(), IL_CAL_UNIX, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ fillRegistrationType()

ilGroupRegistrationGUI::fillRegistrationType ( )
protected

fill registration procedure

@access protected

Parameters

return

Reimplemented from ilRegistrationGUI.

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

276 {
277 global $DIC;
278
279 $ilUser = $DIC['ilUser'];
280
281 if ($this->getWaitingList()->isOnList($ilUser->getId())) {
282 return true;
283 }
284
285 switch ($this->container->getRegistrationType()) {
287 $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
288 $reg->setValue($this->lng->txt('grp_reg_disabled'));
289 #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
290 $this->form->addItem($reg);
291
292 // Disable registration
293 $this->enableRegistration(false);
294
295 break;
296
298 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
299 $txt->setValue($this->lng->txt('grp_pass_request'));
300
301
302 $pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
303 $pass->setInputType('password');
304 $pass->setSize(12);
305 $pass->setMaxLength(32);
306 #$pass->setRequired(true);
307 $pass->setInfo($this->lng->txt('group_password_registration_msg'));
308
309 $txt->addSubItem($pass);
310 $this->form->addItem($txt);
311 break;
312
314
315 // no "request" info if waiting list is active
316 if ($this->isWaitingListActive()) {
317 return true;
318 }
319
320 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
321 $txt->setValue($this->lng->txt('grp_reg_request'));
322
323 $sub = new ilTextAreaInputGUI($this->lng->txt('grp_reg_subject'), 'subject');
324 $sub->setValue($_POST['subject']);
325 $sub->setInfo($this->lng->txt('group_req_registration_msg'));
326 $sub->setCols(40);
327 $sub->setRows(5);
328 if ($this->participants->isSubscriber($ilUser->getId())) {
329 $sub_data = $this->participants->getSubscriberData($ilUser->getId());
330 $sub->setValue($sub_data['subject']);
331 $sub->setInfo('');
332 ilUtil::sendFailure($this->lng->txt('grp_already_assigned'));
333 $this->enableRegistration(false);
334 }
335 $txt->addSubItem($sub);
336 $this->form->addItem($txt);
337 break;
338
340
341 // no "direct registration" info if waiting list is active
342 if ($this->isWaitingListActive()) {
343 return true;
344 }
345
346 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
347 $txt->setValue($this->lng->txt('group_req_direct'));
348
349 $this->form->addItem($txt);
350 break;
351
352 default:
353 return true;
354 }
355
356 return true;
357 }
const GRP_REGISTRATION_DIRECT
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_DEACTIVATED
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 $_POST, $DIC, $ilUser, $pass, $txt, ilRegistrationGUI\enableRegistration(), ilRegistrationGUI\getWaitingList(), GRP_REGISTRATION_DEACTIVATED, GRP_REGISTRATION_DIRECT, GRP_REGISTRATION_PASSWORD, GRP_REGISTRATION_REQUEST, isWaitingListActive(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ getFormTitle()

ilGroupRegistrationGUI::getFormTitle ( )
protected

get form title

@access protected

Returns
string title

Reimplemented from ilRegistrationGUI.

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

88 {
89 global $DIC;
90
91 $ilUser = $DIC['ilUser'];
92
93 if ($this->getWaitingList()->isOnList($ilUser->getId())) {
94 return $this->lng->txt('member_status');
95 }
96 return $this->lng->txt('grp_registration');
97 }

References $DIC, $ilUser, and ilRegistrationGUI\getWaitingList().

+ Here is the call graph for this function:

◆ initParticipants()

ilGroupRegistrationGUI::initParticipants ( )
protected

Init course participants.

@access protected

Reimplemented from ilRegistrationGUI.

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

538 {
539 include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
540 $this->participants = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
541 }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.

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

548 {
549 include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
550 $this->waiting_list = new ilGroupWaitingList($this->container->getId());
551 }

◆ isWaitingListActive()

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

Reimplemented from ilRegistrationGUI.

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

557 {
558 global $DIC;
559
560 $ilUser = $DIC['ilUser'];
561 static $active = null;
562
563 if ($active !== null) {
564 return $active;
565 }
566 if (!$this->container->getMaxMembers()) {
567 return $active = false;
568 }
569 if (
570 !$this->container->isWaitingListEnabled() or
571 !$this->container->isMembershipLimited()) {
572 return $active = false;
573 }
574
575 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
576 return $active = (!$free or $this->getWaitingList()->getCountUsers());
577 }

References $DIC, $ilUser, and 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

Reimplemented from ilRegistrationGUI.

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

399 {
400 global $DIC;
401
402 $ilUser = $DIC['ilUser'];
403
404 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
405 $this->join_error = $this->lng->txt('permission_denied');
406 return false;
407 }
408
409 if (!$this->isRegistrationPossible()) {
410 $this->join_error = $this->lng->txt('mem_error_preconditions');
411 return false;
412 }
413 if ($this->container->getRegistrationType() == GRP_REGISTRATION_PASSWORD) {
414 if (!strlen($pass = ilUtil::stripSlashes($_POST['grp_passw']))) {
415 $this->join_error = $this->lng->txt('err_wrong_password');
416 return false;
417 }
418 if (strcmp($pass, $this->container->getPassword()) !== 0) {
419 $this->join_error = $this->lng->txt('err_wrong_password');
420 return false;
421 }
422 }
423 if (!$this->validateCustomFields()) {
424 $this->join_error = $this->lng->txt('fill_out_all_required_fields');
425 return false;
426 }
427 if (!$this->validateAgreement()) {
428 $this->join_error = $this->lng->txt($this->type . '_agreement_required');
429 return false;
430 }
431
432 return true;
433 }
validateAgreement()
Check Agreement.
validateCustomFields()
Check required course fields.
const ANONYMOUS_USER_ID
Definition: constants.php:25

References $_POST, $DIC, $ilUser, $pass, ANONYMOUS_USER_ID, GRP_REGISTRATION_PASSWORD, ilRegistrationGUI\isRegistrationPossible(), ilUtil\stripSlashes(), ilRegistrationGUI\validateAgreement(), and ilRegistrationGUI\validateCustomFields().

+ Here is the call graph for this function:

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