ILIAS  release_4-4 Revision
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 451 of file class.ilGroupRegistrationGUI.php.

References $_POST, $_SESSION, $ilCtrl, $ilUser, ilRegistrationGUI\$lng, ilRegistrationGUI\$waiting_list, ilWaitingList\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.

452  {
453  global $ilUser,$tree, $rbacreview, $lng, $ilCtrl;
454 
455  // set aggreement accepted
456  $this->setAccepted(true);
457 
458  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
459  $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
460  $waiting_list = new ilGroupWaitingList($this->container->getId());
461  if(
462  $this->container->isMembershipLimited() and
463  $this->container->isWaitingListEnabled() and
464  (!$free or $waiting_list->getCountUsers()))
465  {
466  $waiting_list->addToList($ilUser->getId());
467  $info = sprintf($this->lng->txt('grp_added_to_list'),
468  $this->container->getTitle(),
469  $waiting_list->getPosition($ilUser->getId()));
470 
471  $this->participants->sendNotification(
473  $ilUser->getId()
474  );
475  ilUtil::sendSuccess($info,true);
476  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
477  $tree->getParentId($this->container->getRefId()));
478  $ilCtrl->redirectByClass("ilrepositorygui", "");
479  }
480 
481 
482  switch($this->container->getRegistrationType())
483  {
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("ilrepositorygui", "ref_id",
497  $tree->getParentId($this->container->getRefId()));
498  $ilCtrl->redirectByClass("ilrepositorygui", "");
499  break;
500 
501  default:
502 
503  $this->participants->add($ilUser->getId(),IL_GRP_MEMBER);
504  $this->participants->sendNotification(
506  $ilUser->getId()
507  );
508  $this->participants->sendNotification(
510  $ilUser->getId()
511  );
512 
513  include_once './Modules/Forum/classes/class.ilForumNotification.php';
514  ilForumNotification::checkForumsExistsInsert($this->container->getRefId(), $ilUser->getId());
515 
516  if(!$_SESSION["pending_goto"])
517  {
518  ilUtil::sendSuccess($this->lng->txt("grp_registration_completed"),true);
519  $this->ctrl->returnToParent($this);
520  }
521  else
522  {
523  $tgt = $_SESSION["pending_goto"];
524  unset($_SESSION["pending_goto"]);
525  ilUtil::redirect($tgt);
526  }
527  break;
528  }
529  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
const IL_GRP_MEMBER
const GRP_REGISTRATION_REQUEST
global $ilCtrl
Definition: ilias.php:18
setAccepted($a_status)
Set Agreement accepted.
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
addToList($a_usr_id)
add to list
+ Here is the call graph for this function:

◆ addCommandButtons()

ilGroupRegistrationGUI::addCommandButtons ( )
protected

Add group specific command buttons.

Returns

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

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

365  {
366  global $ilUser;
367 
368  parent::addCommandButtons();
369 
370 
371  switch($this->container->getRegistrationType())
372  {
374  if($this->participants->isSubscriber($ilUser->getId()))
375  {
376  $this->form->clearCommandButtons();
377  $this->form->addCommandButton('updateSubscriptionRequest', $this->lng->txt('grp_update_subscr_request'));
378  $this->form->addCommandButton('cancelSubscriptionRequest', $this->lng->txt('grp_cancel_subscr_request'));
379  }
380  else
381  {
382  if(!$this->isRegistrationPossible())
383  {
384  return false;
385  }
386  $this->form->clearCommandButtons();
387  $this->form->addCommandButton('join', $this->lng->txt('grp_join_request'));
388  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
389  }
390  break;
391  }
392  return true;
393  }
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\getWaitingList(), ilUtil\sendFailure(), and ilCustomInputGUI\setHtml().

182  {
183  global $ilUser;
184 
185  if(!$this->container->isMembershipLimited())
186  {
187  return true;
188  }
189  $tpl = new ilTemplate('tpl.max_members_form.html',true,true,'Services/Membership');
190  $tpl->setVariable('TXT_MAX',$this->lng->txt('mem_max_users'));
191  $tpl->setVariable('NUM_MAX',$this->container->getMaxMembers());
192 
193  $tpl->setVariable('TXT_FREE',$this->lng->txt('mem_free_places').":");
194  $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
195 
196  if($free)
197  $tpl->setVariable('NUM_FREE',$free);
198  else
199  $tpl->setVariable('WARN_FREE',$free);
200 
201 
202  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
203  $waiting_list = new ilGroupWaitingList($this->container->getId());
204 
205  if(
206  $this->container->isWaitingListEnabled() and
207  $this->container->isMembershipLimited() and
208  (!$free or $waiting_list->getCountUsers()))
209  {
210  if($waiting_list->isOnList($ilUser->getId()))
211  {
212  $tpl->setVariable('TXT_WAIT',$this->lng->txt('mem_waiting_list_position'));
213  $tpl->setVariable('NUM_WAIT',$waiting_list->getPosition($ilUser->getId()));
214 
215  }
216  else
217  {
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  {
232  // Disable registration
233  $this->enableRegistration(false);
234  $alert = $this->lng->txt('mem_alert_no_places');
235  }
236  elseif(
237  $this->container->isWaitingListEnabled() and
238  $this->container->isMembershipLimited() and
239  $waiting_list->isOnList($ilUser->getId()))
240  {
241  // Disable registration
242  $this->enableRegistration(false);
243  }
244  elseif(
245  !$free and
246  $this->container->isWaitingListEnabled() and
247  $this->container->isMembershipLimited())
248  {
249  $alert = $this->lng->txt('grp_warn_no_max_set_on_waiting_list');
250  }
251  elseif(
252  $free and
253  $this->container->isWaitingListEnabled() and
254  $this->container->isMembershipLimited() and
255  $this->getWaitingList()->getCountUsers())
256  {
257  $alert = $this->lng->txt('grp_warn_wl_set_on_waiting_list');
258  }
259 
260  $max = new ilCustomInputGUI($this->lng->txt('mem_participants'));
261  $max->setHtml($tpl->get());
262  if(strlen($alert))
263  {
264  #$max->setAlert($alert);
265  ilUtil::sendFailure($alert);
266  }
267  $this->form->addItem($max);
268  }
setHtml($a_html)
Set Html.
getWaitingList()
Get waiting list object.
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
+ 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 277 of file class.ilGroupRegistrationGUI.php.

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

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

References ilGroupParticipants\_getInstanceByObjId().

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.
+ Here is the call graph for this function:

◆ initWaitingList()

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

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  }
Waiting list for groups.

◆ isWaitingListActive()

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

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

References $ilUser, and ilRegistrationGUI\getWaitingList().

Referenced by fillRegistrationType().

557  {
558  global $ilUser;
559  static $active = null;
560 
561  if($active !== null)
562  {
563  return $active;
564  }
565  if(!$this->container->getMaxMembers())
566  {
567  return $active = false;
568  }
569  if(
570  !$this->container->isWaitingListEnabled() or
571  !$this->container->isMembershipLimited())
572  {
573  return $active = false;
574  }
575 
576  $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
577  return $active = (!$free or $this->getWaitingList()->getCountUsers());
578  }
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 402 of file class.ilGroupRegistrationGUI.php.

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

403  {
404  global $ilUser;
405 
406  if($ilUser->getId() == ANONYMOUS_USER_ID)
407  {
408  $this->join_error = $this->lng->txt('permission_denied');
409  return false;
410  }
411 
412  if(!$this->isRegistrationPossible())
413  {
414  $this->join_error = $this->lng->txt('mem_error_preconditions');
415  return false;
416  }
417  if($this->container->getRegistrationType() == GRP_REGISTRATION_PASSWORD)
418  {
419  if(!strlen($pass = ilUtil::stripSlashes($_POST['grp_passw'])))
420  {
421  $this->join_error = $this->lng->txt('err_wrong_password');
422  return false;
423  }
424  if(strcmp($pass,$this->container->getPassword()) !== 0)
425  {
426  $this->join_error = $this->lng->txt('err_wrong_password');
427  return false;
428  }
429  }
430  if(!$this->validateCustomFields())
431  {
432  $this->join_error = $this->lng->txt('fill_out_all_required_fields');
433  return false;
434  }
435  if(!$this->validateAgreement())
436  {
437  $this->join_error = $this->lng->txt($this->type.'_agreement_required');
438  return false;
439  }
440 
441  return true;
442  }
$_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: