ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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 ()
 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.

public

Parameters
objectcontainer object

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

45  {
46  parent::__construct($a_container);
47  }

Member Function Documentation

◆ add()

ilGroupRegistrationGUI::add ( )
protected

add user

protected

Parameters

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

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

468  {
469  global $ilUser,$tree, $rbacreview, $lng, $ilCtrl;
470 
471  // set aggreement accepted
472  $this->setAccepted(true);
473 
474  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
475  $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
476  $waiting_list = new ilGroupWaitingList($this->container->getId());
477  if(
478  $this->container->isMembershipLimited() and
479  $this->container->isWaitingListEnabled() and
480  (!$free or $waiting_list->getCountUsers()))
481  {
482  $waiting_list->addToList($ilUser->getId());
483  $info = sprintf($this->lng->txt('grp_added_to_list'),
484  $this->container->getTitle(),
485  $waiting_list->getPosition($ilUser->getId()));
486 
487  $this->participants->sendNotification(
489  $ilUser->getId()
490  );
492  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
493  $tree->getParentId($this->container->getRefId()));
494  $ilCtrl->redirectByClass("ilrepositorygui", "");
495  }
496 
497 
498  switch($this->container->getRegistrationType())
499  {
501 
502  $this->participants->addSubscriber($ilUser->getId());
503  $this->participants->updateSubscriptionTime($ilUser->getId(),time());
504  $this->participants->updateSubject($ilUser->getId(),ilUtil::stripSlashes($_POST['subject']));
505 
506  $this->participants->sendNotification(
508  $ilUser->getId()
509  );
510 
511  ilUtil::sendSuccess($this->lng->txt("application_completed"),true);
512  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
513  $tree->getParentId($this->container->getRefId()));
514  $ilCtrl->redirectByClass("ilrepositorygui", "");
515  break;
516 
517  default:
518 
519  $this->participants->add($ilUser->getId(),IL_GRP_MEMBER);
520  $this->participants->sendNotification(
522  $ilUser->getId()
523  );
524  $this->participants->sendNotification(
526  $ilUser->getId()
527  );
528 
529  include_once './Modules/Forum/classes/class.ilForumNotification.php';
530  ilForumNotification::checkForumsExistsInsert($this->container->getRefId(), $ilUser->getId());
531 
532  if(!$_SESSION["pending_goto"])
533  {
534  ilUtil::sendSuccess($this->lng->txt("grp_registration_completed"),true);
535  $this->ctrl->returnToParent($this);
536  }
537  else
538  {
539  $tgt = $_SESSION["pending_goto"];
540  unset($_SESSION["pending_goto"]);
541  ilUtil::redirect($tgt);
542  }
543  break;
544  }
545  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
addToList($a_usr_id)
Add to waiting list and raise event.
$_SESSION["AccountId"]
const IL_GRP_MEMBER
const GRP_REGISTRATION_REQUEST
global $ilCtrl
Definition: ilias.php:18
setAccepted($a_status)
Set Agreement accepted.
$info
Definition: example_052.php:80
Waiting list for groups.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilUser
Definition: imgupload.php:15
static checkForumsExistsInsert($ref_id, $user_id=0)
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ addCommandButtons()

ilGroupRegistrationGUI::addCommandButtons ( )
protected

Add group specific command buttons.

Returns

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

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

381  {
382  global $ilUser;
383 
384  parent::addCommandButtons();
385 
386 
387  switch($this->container->getRegistrationType())
388  {
390  if($this->participants->isSubscriber($ilUser->getId()))
391  {
392  $this->form->clearCommandButtons();
393  $this->form->addCommandButton('updateSubscriptionRequest', $this->lng->txt('grp_update_subscr_request'));
394  $this->form->addCommandButton('cancelSubscriptionRequest', $this->lng->txt('grp_cancel_subscr_request'));
395  }
396  else
397  {
398  if(!$this->isRegistrationPossible())
399  {
400  return false;
401  }
402  $this->form->clearCommandButtons();
403  $this->form->addCommandButton('join', $this->lng->txt('grp_join_request'));
404  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
405  }
406  break;
407  }
408  return true;
409  }
const GRP_REGISTRATION_REQUEST
isRegistrationPossible()
check if registration is possible
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ executeCommand()

ilGroupRegistrationGUI::executeCommand ( )

Execute command.

public

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

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

55  {
56  global $ilUser,$ilTabs;
57 
58  $next_class = $this->ctrl->getNextClass($this);
59 
60  if($this->getWaitingList()->isOnList($ilUser->getId()))
61  {
62  $ilTabs->activateTab('leave');
63  }
64 
65  switch($next_class)
66  {
67  default:
68  $cmd = $this->ctrl->getCmd("show");
69  $this->$cmd();
70  break;
71  }
72  return true;
73  }
getWaitingList()
Get waiting list object.
$cmd
Definition: sahs_server.php:35
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ fillInformations()

ilGroupRegistrationGUI::fillInformations ( )
protected

fill informations

protected

Parameters

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

References ilUtil\makeClickable().

101  {
102  if($this->container->getInformation())
103  {
104  $imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'),'',true);
105  $value = nl2br(ilUtil::makeClickable($this->container->getInformation(), true));
106  $imp->setValue($value);
107  $this->form->addItem($imp);
108  }
109  }
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
This class represents a non editable value in a property form.
+ Here is the call graph for this function:

◆ fillMaxMembers()

ilGroupRegistrationGUI::fillMaxMembers ( )
protected

fill max member informations

protected

Returns

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

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

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

◆ fillRegistrationPeriod()

ilGroupRegistrationGUI::fillRegistrationPeriod ( )
protected

show informations about the registration period

protected

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

References ilRegistrationGUI\$tpl, ilDateTime\_after(), ilDateTime\_before(), ilRegistrationGUI\enableRegistration(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ilUtil\sendFailure(), ilCustomInputGUI\setHtml(), and ilNonEditableValueGUI\setValue().

117  {
118  include_once('./Services/Calendar/classes/class.ilDateTime.php');
119  $now = new ilDateTime(time(),IL_CAL_UNIX,'UTC');
120 
121  if($this->container->isRegistrationUnlimited())
122  {
123  $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_period'));
124  $reg->setValue($this->lng->txt('mem_unlimited'));
125  $this->form->addItem($reg);
126  return true;
127  }
128 
129  $start = $this->container->getRegistrationStart();
130  $end = $this->container->getRegistrationEnd();
131 
132 
133  if(ilDateTime::_before($now,$start))
134  {
135  $tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
136  $tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_start'));
137  $tpl->setVariable('FIRST',ilDatePresentation::formatDate($start));
138 
139  $tpl->setVariable('TXT_END',$this->lng->txt('mem_end'));
140  $tpl->setVariable('END',ilDatePresentation::formatDate($end));
141 
142  $warning = $this->lng->txt('mem_reg_not_started');
143  }
144  elseif(ilDateTime::_after($now,$end))
145  {
146  $tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
147  $tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_start'));
148  $tpl->setVariable('FIRST',ilDatePresentation::formatDate($start));
149 
150  $tpl->setVariable('TXT_END',$this->lng->txt('mem_end'));
151  $tpl->setVariable('END',ilDatePresentation::formatDate($end));
152 
153  $warning = $this->lng->txt('mem_reg_expired');
154  }
155  else
156  {
157  $tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
158  $tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_end'));
159  $tpl->setVariable('FIRST',ilDatePresentation::formatDate($end));
160  }
161 
162  $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_period'));
163  $reg->setHtml($tpl->get());
164  if(strlen($warning))
165  {
166  // Disable registration
167  $this->enableRegistration(false);
168  #$reg->setAlert($warning);
169  ilUtil::sendFailure($warning);
170  }
171  $this->form->addItem($reg);
172  return true;
173  }
setHtml($a_html)
Set Html.
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.
const IL_CAL_UNIX
enableRegistration($a_status)
set registration disabled
special template class to simplify handling of ITX/PEAR
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a custom property in a property form.
This class represents a non editable value in a property form.
+ Here is the call graph for this function:

◆ fillRegistrationType()

ilGroupRegistrationGUI::fillRegistrationType ( )
protected

fill registration procedure

protected

Parameters

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

References $_POST, $ilUser, $pass, $txt, ilRegistrationGUI\enableRegistration(), ilRegistrationGUI\getWaitingList(), GRP_REGISTRATION_DEACTIVATED, GRP_REGISTRATION_DIRECT, GRP_REGISTRATION_PASSWORD, GRP_REGISTRATION_REQUEST, isWaitingListActive(), ilUtil\sendFailure(), ilNonEditableValueGUI\setValue(), and ilTextAreaInputGUI\setValue().

294  {
295  global $ilUser;
296 
297  if($this->getWaitingList()->isOnList($ilUser->getId()))
298  {
299  return true;
300  }
301 
302  switch($this->container->getRegistrationType())
303  {
305  $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
306  $reg->setValue($this->lng->txt('grp_reg_disabled'));
307  #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
308  $this->form->addItem($reg);
309 
310  // Disable registration
311  $this->enableRegistration(false);
312 
313  break;
314 
316  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
317  $txt->setValue($this->lng->txt('grp_pass_request'));
318 
319 
320  $pass = new ilTextInputGUI($this->lng->txt('passwd'),'grp_passw');
321  $pass->setInputType('password');
322  $pass->setSize(12);
323  $pass->setMaxLength(32);
324  #$pass->setRequired(true);
325  $pass->setInfo($this->lng->txt('group_password_registration_msg'));
326 
327  $txt->addSubItem($pass);
328  $this->form->addItem($txt);
329  break;
330 
332 
333  // no "request" info if waiting list is active
334  if($this->isWaitingListActive())
335  return true;
336 
337  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
338  $txt->setValue($this->lng->txt('grp_reg_request'));
339 
340  $sub = new ilTextAreaInputGUI($this->lng->txt('grp_reg_subject'),'subject');
341  $sub->setValue($_POST['subject']);
342  $sub->setInfo($this->lng->txt('group_req_registration_msg'));
343  $sub->setCols(40);
344  $sub->setRows(5);
345  if($this->participants->isSubscriber($ilUser->getId()))
346  {
347  $sub_data = $this->participants->getSubscriberData($ilUser->getId());
348  $sub->setValue($sub_data['subject']);
349  $sub->setInfo('');
350  ilUtil::sendFailure($this->lng->txt('grp_already_assigned'));
351  $this->enableRegistration(false);
352  }
353  $txt->addSubItem($sub);
354  $this->form->addItem($txt);
355  break;
356 
358 
359  // no "direct registration" info if waiting list is active
360  if($this->isWaitingListActive())
361  return true;
362 
363  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
364  $txt->setValue($this->lng->txt('group_req_direct'));
365 
366  $this->form->addItem($txt);
367  break;
368 
369  default:
370  return true;
371  }
372 
373  return true;
374  }
$_POST['username']
Definition: cron.php:12
const GRP_REGISTRATION_DEACTIVATED
getWaitingList()
Get waiting list object.
setValue($a_value)
Set Value.
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_REQUEST
enableRegistration($a_status)
set registration disabled
This class represents a text property in a property form.
$txt
Definition: error.php:12
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a non editable value in a property form.
global $ilUser
Definition: imgupload.php:15
This class represents a text area property in a property form.
const GRP_REGISTRATION_DIRECT
+ Here is the call graph for this function:

◆ getFormTitle()

ilGroupRegistrationGUI::getFormTitle ( )
protected

get form title

protected

Returns
string title

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

References $ilUser, and ilRegistrationGUI\getWaitingList().

83  {
84  global $ilUser;
85 
86  if($this->getWaitingList()->isOnList($ilUser->getId()))
87  {
88  return $this->lng->txt('member_status');
89  }
90  return $this->lng->txt('grp_registration');
91  }
getWaitingList()
Get waiting list object.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ initParticipants()

ilGroupRegistrationGUI::initParticipants ( )
protected

Init course participants.

protected

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

References ilGroupParticipants\_getInstanceByObjId().

554  {
555  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
556  $this->participants = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
557  }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
+ Here is the call graph for this function:

◆ initWaitingList()

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

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

564  {
565  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
566  $this->waiting_list = new ilGroupWaitingList($this->container->getId());
567  }
Waiting list for groups.

◆ isWaitingListActive()

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

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

References $ilUser, and ilRegistrationGUI\getWaitingList().

Referenced by fillRegistrationType().

573  {
574  global $ilUser;
575  static $active = null;
576 
577  if($active !== null)
578  {
579  return $active;
580  }
581  if(!$this->container->getMaxMembers())
582  {
583  return $active = false;
584  }
585  if(
586  !$this->container->isWaitingListEnabled() or
587  !$this->container->isMembershipLimited())
588  {
589  return $active = false;
590  }
591 
592  $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
593  return $active = (!$free or $this->getWaitingList()->getCountUsers());
594  }
getWaitingList()
Get waiting list object.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilGroupRegistrationGUI::validate ( )
protected

validate join request

protected

Returns

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

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

419  {
420  global $ilUser;
421 
422  if($ilUser->getId() == ANONYMOUS_USER_ID)
423  {
424  $this->join_error = $this->lng->txt('permission_denied');
425  return false;
426  }
427 
428  if(!$this->isRegistrationPossible())
429  {
430  $this->join_error = $this->lng->txt('mem_error_preconditions');
431  return false;
432  }
433  if($this->container->getRegistrationType() == GRP_REGISTRATION_PASSWORD)
434  {
435  if(!strlen($pass = ilUtil::stripSlashes($_POST['grp_passw'])))
436  {
437  $this->join_error = $this->lng->txt('err_wrong_password');
438  return false;
439  }
440  if(strcmp($pass,$this->container->getPassword()) !== 0)
441  {
442  $this->join_error = $this->lng->txt('err_wrong_password');
443  return false;
444  }
445  }
446  if(!$this->validateCustomFields())
447  {
448  $this->join_error = $this->lng->txt('fill_out_all_required_fields');
449  return false;
450  }
451  if(!$this->validateAgreement())
452  {
453  $this->join_error = $this->lng->txt($this->type.'_agreement_required');
454  return false;
455  }
456 
457  return true;
458  }
$_POST['username']
Definition: cron.php:12
const GRP_REGISTRATION_PASSWORD
validateAgreement()
Check Agreement.
isRegistrationPossible()
check if registration is possible
validateCustomFields()
Check required course fields.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

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