23 public static function handleCode($a_ref_id, $a_type, $a_code)
30 include_once
'./Services/Link/classes/class.ilLink.php';
31 $lng->loadLanguageModule($a_type);
35 ilUtil::sendSuccess(sprintf(
$lng->txt($a_type .
"_admission_link_success_registration"), $title),
true);
38 switch (
$e->getCode()) {
40 ilUtil::sendSuccess(
$e->getMessage(),
true);
61 $parent_id = $tree->getParentId($a_ref_id);
78 protected static function useCode($a_code, $a_endnode)
88 include_once
'./Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
92 foreach ($tree->getPathId($a_endnode) as $ref_id) {
95 $member_obj =
$factory->getInstanceByRefId($ref_id,
false);
113 $map =
"23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
116 $max = strlen($map) - 1;
118 $code .= $map[mt_rand(0, $max)];
130 include_once
'./Modules/Group/classes/class.ilObjGroup.php';
131 include_once
'./Modules/Course/classes/class.ilObjCourse.php';
An exception for terminatinating execution or to throw for unit testing.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Stores registration keys for key based registration on courses and groups.
static handleCode($a_ref_id, $a_type, $a_code)
Handle target parameter.
static generateCode()
Generate new registration key.
static lookupObjectsByCode($a_code)
Get all objects with enabled access codes.
static useCode($a_code, $a_endnode)
Use a registration code and assign the logged in user to the (parent) course/group that offer the cod...
membership registration exception
const ADDED_TO_WAITINGLIST
const ADMISSION_LINK_INVALID
const REGISTRATION_INVALID_OFFLINE
const REGISTRATION_INVALID_AVAILABILITY
const OUT_OF_REGISTRATION_PERIOD
static lookupObjectsByCode($a_code)
static lookupObjectsByCode($a_code)
Class ilObjectFactory This class offers methods to get instances of the type-specific object classes ...
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.