ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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

References $_POST, $_SESSION, $DIC, $ilCtrl, $ilUser, $info, ilRegistrationGUI\$lng, $tree, ilRegistrationGUI\$waiting_list, ilGroupWaitingList\addToList(), 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.

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

◆ addCommandButtons()

ilGroupRegistrationGUI::addCommandButtons ( )
protected

Add group specific command buttons.

Returns

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

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

359  {
360  global $DIC;
361 
362  $ilUser = $DIC['ilUser'];
363 
364  parent::addCommandButtons();
365 
366 
367  switch ($this->container->getRegistrationType()) {
369  if ($this->participants->isSubscriber($ilUser->getId())) {
370  $this->form->clearCommandButtons();
371  $this->form->addCommandButton('updateSubscriptionRequest', $this->lng->txt('grp_update_subscr_request'));
372  $this->form->addCommandButton('cancelSubscriptionRequest', $this->lng->txt('grp_cancel_subscr_request'));
373  } else {
374  if (!$this->isRegistrationPossible()) {
375  return false;
376  }
377  $this->form->clearCommandButtons();
378  $this->form->addCommandButton('join', $this->lng->txt('grp_join_request'));
379  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
380  }
381  break;
382  }
383  return true;
384  }
global $DIC
Definition: saml.php:7
const GRP_REGISTRATION_REQUEST
isRegistrationPossible()
check if registration is possible
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ executeCommand()

ilGroupRegistrationGUI::executeCommand ( )

Execute command.

public

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

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

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

◆ fillInformations()

ilGroupRegistrationGUI::fillInformations ( )
protected

fill informations

protected

Parameters

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

References ilUtil\makeClickable().

103  {
104  if ($this->container->getInformation()) {
105  $imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'), '', true);
106  $value = nl2br(ilUtil::makeClickable($this->container->getInformation(), true));
107  $imp->setValue($value);
108  $this->form->addItem($imp);
109  }
110  }
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 175 of file class.ilGroupRegistrationGUI.php.

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

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

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

118  {
119  include_once('./Services/Calendar/classes/class.ilDateTime.php');
120  $now = new ilDateTime(time(), IL_CAL_UNIX, 'UTC');
121 
122  if ($this->container->isRegistrationUnlimited()) {
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  $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
135  $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
136  $tpl->setVariable('FIRST', ilDatePresentation::formatDate($start));
137 
138  $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
139  $tpl->setVariable('END', ilDatePresentation::formatDate($end));
140 
141  $warning = $this->lng->txt('mem_reg_not_started');
142  } elseif (ilDateTime::_after($now, $end)) {
143  $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
144  $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
145  $tpl->setVariable('FIRST', ilDatePresentation::formatDate($start));
146 
147  $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
148  $tpl->setVariable('END', ilDatePresentation::formatDate($end));
149 
150  $warning = $this->lng->txt('mem_reg_expired');
151  } else {
152  $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'Services/Membership');
153  $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_end'));
154  $tpl->setVariable('FIRST', ilDatePresentation::formatDate($end));
155  }
156 
157  $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_period'));
158  $reg->setHtml($tpl->get());
159  if (strlen($warning)) {
160  // Disable registration
161  $this->enableRegistration(false);
162  #$reg->setAlert($warning);
164  }
165  $this->form->addItem($reg);
166  return true;
167  }
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
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
$start
Definition: bench.php:8
enableRegistration($a_status)
set registration disabled
$warning
Definition: X509warning.php:13
special template class to simplify handling of ITX/PEAR
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 270 of file class.ilGroupRegistrationGUI.php.

References $_POST, $DIC, $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().

271  {
272  global $DIC;
273 
274  $ilUser = $DIC['ilUser'];
275 
276  if ($this->getWaitingList()->isOnList($ilUser->getId())) {
277  return true;
278  }
279 
280  switch ($this->container->getRegistrationType()) {
282  $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
283  $reg->setValue($this->lng->txt('grp_reg_disabled'));
284  #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
285  $this->form->addItem($reg);
286 
287  // Disable registration
288  $this->enableRegistration(false);
289 
290  break;
291 
293  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
294  $txt->setValue($this->lng->txt('grp_pass_request'));
295 
296 
297  $pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
298  $pass->setInputType('password');
299  $pass->setSize(12);
300  $pass->setMaxLength(32);
301  #$pass->setRequired(true);
302  $pass->setInfo($this->lng->txt('group_password_registration_msg'));
303 
304  $txt->addSubItem($pass);
305  $this->form->addItem($txt);
306  break;
307 
309 
310  // no "request" info if waiting list is active
311  if ($this->isWaitingListActive()) {
312  return true;
313  }
314 
315  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
316  $txt->setValue($this->lng->txt('grp_reg_request'));
317 
318  $sub = new ilTextAreaInputGUI($this->lng->txt('grp_reg_subject'), 'subject');
319  $sub->setValue($_POST['subject']);
320  $sub->setInfo($this->lng->txt('group_req_registration_msg'));
321  $sub->setCols(40);
322  $sub->setRows(5);
323  if ($this->participants->isSubscriber($ilUser->getId())) {
324  $sub_data = $this->participants->getSubscriberData($ilUser->getId());
325  $sub->setValue($sub_data['subject']);
326  $sub->setInfo('');
327  ilUtil::sendFailure($this->lng->txt('grp_already_assigned'));
328  $this->enableRegistration(false);
329  }
330  $txt->addSubItem($sub);
331  $this->form->addItem($txt);
332  break;
333 
335 
336  // no "direct registration" info if waiting list is active
337  if ($this->isWaitingListActive()) {
338  return true;
339  }
340 
341  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
342  $txt->setValue($this->lng->txt('group_req_direct'));
343 
344  $this->form->addItem($txt);
345  break;
346 
347  default:
348  return true;
349  }
350 
351  return true;
352  }
const GRP_REGISTRATION_DEACTIVATED
global $DIC
Definition: saml.php:7
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.
$ilUser
Definition: imgupload.php:18
$txt
Definition: error.php:11
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
const GRP_REGISTRATION_DIRECT
$_POST["username"]
+ Here is the call graph for this function:

◆ getFormTitle()

ilGroupRegistrationGUI::getFormTitle ( )
protected

get form title

protected

Returns
string title

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

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

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

◆ initParticipants()

ilGroupRegistrationGUI::initParticipants ( )
protected

Init course participants.

protected

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

References ilGroupParticipants\_getInstanceByObjId().

533  {
534  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
535  $this->participants = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
536  }
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 542 of file class.ilGroupRegistrationGUI.php.

543  {
544  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
545  $this->waiting_list = new ilGroupWaitingList($this->container->getId());
546  }
Waiting list for groups.

◆ isWaitingListActive()

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

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

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

Referenced by fillRegistrationType().

552  {
553  global $DIC;
554 
555  $ilUser = $DIC['ilUser'];
556  static $active = null;
557 
558  if ($active !== null) {
559  return $active;
560  }
561  if (!$this->container->getMaxMembers()) {
562  return $active = false;
563  }
564  if (
565  !$this->container->isWaitingListEnabled() or
566  !$this->container->isMembershipLimited()) {
567  return $active = false;
568  }
569 
570  $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
571  return $active = (!$free or $this->getWaitingList()->getCountUsers());
572  }
global $DIC
Definition: saml.php:7
getWaitingList()
Get waiting list object.
$ilUser
Definition: imgupload.php:18
+ 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 393 of file class.ilGroupRegistrationGUI.php.

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

394  {
395  global $DIC;
396 
397  $ilUser = $DIC['ilUser'];
398 
399  if ($ilUser->getId() == ANONYMOUS_USER_ID) {
400  $this->join_error = $this->lng->txt('permission_denied');
401  return false;
402  }
403 
404  if (!$this->isRegistrationPossible()) {
405  $this->join_error = $this->lng->txt('mem_error_preconditions');
406  return false;
407  }
408  if ($this->container->getRegistrationType() == GRP_REGISTRATION_PASSWORD) {
409  if (!strlen($pass = ilUtil::stripSlashes($_POST['grp_passw']))) {
410  $this->join_error = $this->lng->txt('err_wrong_password');
411  return false;
412  }
413  if (strcmp($pass, $this->container->getPassword()) !== 0) {
414  $this->join_error = $this->lng->txt('err_wrong_password');
415  return false;
416  }
417  }
418  if (!$this->validateCustomFields()) {
419  $this->join_error = $this->lng->txt('fill_out_all_required_fields');
420  return false;
421  }
422  if (!$this->validateAgreement()) {
423  $this->join_error = $this->lng->txt($this->type . '_agreement_required');
424  return false;
425  }
426 
427  return true;
428  }
global $DIC
Definition: saml.php:7
const GRP_REGISTRATION_PASSWORD
validateAgreement()
Check Agreement.
isRegistrationPossible()
check if registration is possible
$ilUser
Definition: imgupload.php:18
validateCustomFields()
Check required course fields.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

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