ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAccountRegistrationGUI Class Reference

Class ilAccountRegistrationGUI. More...

+ Collaboration diagram for ilAccountRegistrationGUI:

Public Member Functions

 __construct ()
 executeCommand ()
 displayForm ()
 saveForm ()
 login ($password)

Protected Member Functions

 __initForm ()
 __createUser ($a_role)
 __distributeMails ($password, $a_language=null)

Protected Attributes

 $registration_settings
 $code_enabled
 $code_was_used

Detailed Description

Constructor & Destructor Documentation

ilAccountRegistrationGUI::__construct ( )

Definition at line 27 of file class.ilAccountRegistrationGUI.php.

References $ilCtrl, $lng, and $tpl.

{
global $ilCtrl,$tpl,$lng;
$this->tpl =& $tpl;
$this->ctrl =& $ilCtrl;
$this->ctrl->saveParameter($this,'lang');
$this->lng =& $lng;
$this->lng->loadLanguageModule('registration');
$this->registration_settings = new ilRegistrationSettings();
$this->code_enabled = ($this->registration_settings->registrationCodeRequired() ||
$this->registration_settings->getAllowCodes());
}

Member Function Documentation

ilAccountRegistrationGUI::__createUser (   $a_role)
protected

Definition at line 395 of file class.ilAccountRegistrationGUI.php.

References $_POST, $client, $code_was_used, $ilSetting, ilUserDefinedFields\_getInstance(), ilUtil\generatePasswords(), IL_REG_ACTIVATION, IL_REG_CODES, IL_REG_DIRECT, ilUserProfile\MODE_REGISTRATION, and ilRegistrationCode\useCode().

Referenced by saveForm().

{
global $ilSetting, $rbacadmin;
$this->userObj = new ilObjUser();
include_once("./Services/User/classes/class.ilUserProfile.php");
$up = new ilUserProfile();
$map = array();
$up->skipGroup("preferences");
$up->skipGroup("settings");
$up->skipGroup("instant_messengers");
$up->skipField("password");
$up->skipField("birthday");
$up->skipField("upload");
foreach ($up->getStandardFields() as $k => $v)
{
if($v["method"])
{
$method = "set".substr($v["method"], 3);
if(method_exists($this->userObj, $method))
{
if ($k != "username")
{
$k = "usr_".$k;
}
$field_obj = $this->form->getItemByPostVar($k);
if($field_obj)
{
$this->userObj->$method($this->form->getInput($k));
}
}
}
}
$this->userObj->setFullName();
$birthday_obj = $this->form->getItemByPostVar("usr_birthday");
if ($birthday_obj)
{
$birthday = $this->form->getInput("usr_birthday");
$birthday = $birthday["date"];
// when birthday was not set, array will not be substituted with string by ilBirthdayInputGui
if(!is_array($birthday))
{
$this->userObj->setBirthday($birthday);
}
}
// messenger
$map = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip");
foreach($map as $client)
{
$field = "usr_im_".$client;
$field_obj = $this->form->getItemByPostVar($field);
if($field_obj)
{
$this->userObj->setInstantMessengerId($client, $this->form->getInput($field));
}
}
$this->userObj->setTitle($this->userObj->getFullname());
$this->userObj->setDescription($this->userObj->getEmail());
if ($this->registration_settings->passwordGenerationEnabled())
{
$password = ilUtil::generatePasswords(1);
$password = $password[0];
}
else
{
$password = $this->form->getInput("usr_password");
}
$this->userObj->setPasswd($password);
// Set user defined data
include_once './Services/User/classes/class.ilUserDefinedFields.php';
$user_defined_fields =& ilUserDefinedFields::_getInstance();
$defs = $user_defined_fields->getRegistrationDefinitions();
$udf = array();
foreach ($_POST as $k => $v)
{
if (substr($k, 0, 4) == "udf_")
{
$f = substr($k, 4);
$udf[$f] = $v;
}
}
$this->userObj->setUserDefinedData($udf);
$this->userObj->setTimeLimitOwner(7);
$this->code_was_used = false;
if($this->code_enabled)
{
// #10853 - could be optional
$code = $this->form->getInput('usr_registration_code');
if($code)
{
// set code to used
include_once './Services/Registration/classes/class.ilRegistrationCode.php';
$this->code_was_used = true;
}
}
// something went wrong with the form validation
if(!$a_role)
{
global $ilias;
$ilias->raiseError("Invalid role selection in registration".
", IP: ".$_SERVER["REMOTE_ADDR"], $ilias->error_obj->FATAL);
}
if ($this->registration_settings->getAccessLimitation())
{
include_once 'Services/Registration/classes/class.ilRegistrationRoleAccessLimitations.php';
$access_limitations_obj = new ilRegistrationRoleAccessLimitations();
$access_limit_mode = $access_limitations_obj->getMode($a_role);
if ($access_limit_mode == 'absolute')
{
$access_limit = $access_limitations_obj->getAbsolute($a_role);
$this->userObj->setTimeLimitUnlimited(0);
$this->userObj->setTimeLimitUntil($access_limit);
}
elseif ($access_limit_mode == 'relative')
{
$rel_d = (int) $access_limitations_obj->getRelative($a_role,'d');
$rel_m = (int) $access_limitations_obj->getRelative($a_role,'m');
$rel_y = (int) $access_limitations_obj->getRelative($a_role,'y');
$access_limit = $rel_d * 86400 + $rel_m * 2592000 + $rel_y * 31536000 + time();
$this->userObj->setTimeLimitUnlimited(0);
$this->userObj->setTimeLimitUntil($access_limit);
}
else
{
$this->userObj->setTimeLimitUnlimited(1);
$this->userObj->setTimeLimitUntil(time());
}
}
else
{
$this->userObj->setTimeLimitUnlimited(1);
$this->userObj->setTimeLimitUntil(time());
}
$this->userObj->setTimeLimitFrom(time());
$this->userObj->create();
if($this->registration_settings->getRegistrationType() == IL_REG_DIRECT ||
$this->registration_settings->getRegistrationType() == IL_REG_CODES ||
{
$this->userObj->setActive(1,0);
}
else if($this->registration_settings->getRegistrationType() == IL_REG_ACTIVATION)
{
$this->userObj->setActive(0,0);
}
else
{
$this->userObj->setActive(0,0);
}
$this->userObj->updateOwner();
// set a timestamp for last_password_change
// this ts is needed by the ACCOUNT_SECURITY_MODE_CUSTOMIZED
// in ilSecuritySettings
$this->userObj->setLastPasswordChangeTS( time() );
$this->userObj->setIsSelfRegistered(true);
//insert user data in table user_data
$this->userObj->saveAsNew();
// store acceptance of user agreement
$this->userObj->writeAccepted();
// setup user preferences
$this->userObj->setLanguage($this->form->getInput('usr_language'));
$hits_per_page = $ilSetting->get("hits_per_page");
if ($hits_per_page < 10)
{
$hits_per_page = 10;
}
$this->userObj->setPref("hits_per_page", $hits_per_page);
$show_online = $ilSetting->get("show_users_online");
if ($show_online == "")
{
$show_online = "y";
}
$this->userObj->setPref("show_users_online", $show_online);
$this->userObj->writePrefs();
$rbacadmin->assignUser((int)$a_role, $this->userObj->getId(), true);
return $password;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAccountRegistrationGUI::__distributeMails (   $password,
  $a_language = null 
)
protected

Definition at line 604 of file class.ilAccountRegistrationGUI.php.

References $code_was_used, $GLOBALS, $ilSetting, $path, ilObjUserFolder\_lookupNewAccountMail(), IL_REG_ACTIVATION, IL_REG_APPROVE, ilRegistrationMimeMailNotification\TYPE_NOTIFICATION_ACTIVATION, ilRegistrationMailNotification\TYPE_NOTIFICATION_APPROVERS, ilRegistrationMailNotification\TYPE_NOTIFICATION_CONFIRMATION, and USER_FOLDER_ID.

Referenced by saveForm().

{
global $ilSetting;
include_once './Services/Language/classes/class.ilLanguage.php';
include_once './Services/User/classes/class.ilObjUser.php';
include_once "Services/Mail/classes/class.ilFormatMail.php";
include_once './Services/Registration/classes/class.ilRegistrationMailNotification.php';
// Always send mail to approvers
if($this->registration_settings->getRegistrationType() == IL_REG_APPROVE && !$this->code_was_used)
{
$mail->setRecipients($this->registration_settings->getApproveRecipients());
$mail->setAdditionalInformation(array('usr' => $this->userObj));
$mail->send();
}
else
{
$mail->setRecipients($this->registration_settings->getApproveRecipients());
$mail->setAdditionalInformation(array('usr' => $this->userObj));
$mail->send();
}
// Send mail to new user
// Registration with confirmation link ist enabled
if($this->registration_settings->getRegistrationType() == IL_REG_ACTIVATION && !$this->code_was_used)
{
include_once './Services/Registration/classes/class.ilRegistrationMimeMailNotification.php';
$mail->setRecipients(array($this->userObj));
$mail->setAdditionalInformation(
array(
'usr' => $this->userObj,
'hash_lifetime' => $this->registration_settings->getRegistrationHashLifetime()
)
);
$mail->send();
}
else
{
// try individual account mail in user administration
include_once("Services/Mail/classes/class.ilAccountMail.php");
include_once './Services/User/classes/class.ilObjUserFolder.php';
if (trim($amail["body"]) == "" || trim($amail["subject"]) == "")
{
$amail = ilObjUserFolder::_lookupNewAccountMail($GLOBALS["lng"]->getDefaultLanguage());
}
if (trim($amail["body"]) != "" && trim($amail["subject"]) != "")
{
$acc_mail = new ilAccountMail();
$acc_mail->setUser($this->userObj);
if ($this->registration_settings->passwordGenerationEnabled())
{
$acc_mail->setUserPassword($password);
}
if($amail["att_file"])
{
include_once "Services/User/classes/class.ilFSStorageUserFolder.php";
$fs->create();
$path = $fs->getAbsolutePath()."/";
$acc_mail->addAttachment($path."/".$amail["lang"], $amail["att_file"]);
}
$acc_mail->send();
}
else // do default mail
{
include_once "Services/Mail/classes/class.ilMimeMail.php";
$mmail = new ilMimeMail();
$mmail->autoCheck(false);
$mmail->From($ilSetting->get("admin_email"));
$mmail->To($this->userObj->getEmail());
// mail subject
$subject = $this->lng->txt("reg_mail_subject");
// mail body
$body = $this->lng->txt("reg_mail_body_salutation")." ".$this->userObj->getFullname().",\n\n".
$this->lng->txt("reg_mail_body_text1")."\n\n".
$this->lng->txt("reg_mail_body_text2")."\n".
ILIAS_HTTP_PATH."/login.php?client_id=".CLIENT_ID."\n";
$body .= $this->lng->txt("login").": ".$this->userObj->getLogin()."\n";
if ($this->registration_settings->passwordGenerationEnabled())
{
$body.= $this->lng->txt("passwd").": ".$password."\n";
}
$body.= "\n";
// Info about necessary approvement
if($this->registration_settings->getRegistrationType() == IL_REG_APPROVE && !$this->code_was_used)
{
$body .= ($this->lng->txt('reg_mail_body_pwd_generation')."\n\n");
}
$body .= ($this->lng->txt("reg_mail_body_text3")."\n\r");
$body .= $this->userObj->getProfileAsString($this->lng);
$mmail->Subject($subject);
$mmail->Body($body);
$mmail->Send();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAccountRegistrationGUI::__initForm ( )
protected

Definition at line 124 of file class.ilAccountRegistrationGUI.php.

References $ilUser, $lng, ilUserDefinedFields\_getInstance(), ilUserAgreement\_getText(), ilRegistrationCode\CODE_LENGTH, IL_REG_ACTIVATION, ilUserProfile\MODE_REGISTRATION, ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), UDF_TYPE_TEXT, and UDF_TYPE_WYSIWYG.

Referenced by displayForm(), and saveForm().

{
global $lng, $ilUser;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
// code handling
if($this->code_enabled)
{
include_once 'Services/Registration/classes/class.ilRegistrationCode.php';
$code = new ilTextInputGUI($lng->txt("registration_code"), "usr_registration_code");
$code->setSize(40);
$code->setMaxLength(ilRegistrationCode::CODE_LENGTH);
if((bool)$this->registration_settings->registrationCodeRequired())
{
$code->setRequired(true);
$code->setInfo($lng->txt("registration_code_required_info"));
}
else
{
$code->setInfo($lng->txt("registration_code_optional_info"));
}
$this->form->addItem($code);
}
// user defined fields
$user_defined_data = $ilUser->getUserDefinedData();
include_once './Services/User/classes/class.ilUserDefinedFields.php';
$user_defined_fields =& ilUserDefinedFields::_getInstance();
$custom_fields = array();
foreach($user_defined_fields->getRegistrationDefinitions() as $field_id => $definition)
{
if($definition['field_type'] == UDF_TYPE_TEXT)
{
$custom_fields["udf_".$definition['field_id']] =
new ilTextInputGUI($definition['field_name'], "udf_".$definition['field_id']);
$custom_fields["udf_".$definition['field_id']]->setValue($user_defined_data["f_".$field_id]);
$custom_fields["udf_".$definition['field_id']]->setMaxLength(255);
$custom_fields["udf_".$definition['field_id']]->setSize(40);
}
else if($definition['field_type'] == UDF_TYPE_WYSIWYG)
{
$custom_fields["udf_".$definition['field_id']] =
new ilTextAreaInputGUI($definition['field_name'], "udf_".$definition['field_id']);
$custom_fields["udf_".$definition['field_id']]->setValue($user_defined_data["f_".$field_id]);
$custom_fields["udf_".$definition['field_id']]->setUseRte(true);
}
else
{
$custom_fields["udf_".$definition['field_id']] =
new ilSelectInputGUI($definition['field_name'], "udf_".$definition['field_id']);
$custom_fields["udf_".$definition['field_id']]->setValue($user_defined_data["f_".$field_id]);
$custom_fields["udf_".$definition['field_id']]->setOptions(
$user_defined_fields->fieldValuesToSelectArray($definition['field_values']));
}
if($definition['required'])
{
$custom_fields["udf_".$definition['field_id']]->setRequired(true);
}
}
// standard fields
include_once("./Services/User/classes/class.ilUserProfile.php");
$up = new ilUserProfile();
$up->skipGroup("preferences");
// add fields to form
$up->addStandardFieldsToForm($this->form, NULL, $custom_fields);
unset($custom_fields);
// set language selection to current display language
$flang = $this->form->getItemByPostVar("usr_language");
if($flang)
{
$flang->setValue($lng->getLangKey());
}
// add information to role selection (if not hidden)
if($this->code_enabled)
{
$role = $this->form->getItemByPostVar("usr_roles");
if($role && $role->getType() == "select")
{
$role->setInfo($lng->txt("registration_code_role_info"));
}
}
// #14272
if($this->registration_settings->getRegistrationType() == IL_REG_ACTIVATION)
{
$mail_obj = $this->form->getItemByPostVar('usr_email');
$mail_obj->setRequired(true);
}
// user agreement
$field = new ilFormSectionHeaderGUI();
$field->setTitle($lng->txt("usr_agreement"));
$this->form->addItem($field);
$field = new ilCustomInputGUI();
$field->setHTML('<div id="agreement">'.ilUserAgreement::_getText().'</div>');
$this->form->addItem($field);
$field = new ilCheckboxInputGUI($lng->txt("accept_usr_agreement"), "usr_agreement");
$field->setRequired(true);
$field->setValue(1);
$this->form->addItem($field);
$this->form->addCommandButton("saveForm", $lng->txt("register"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAccountRegistrationGUI::displayForm ( )

Definition at line 74 of file class.ilAccountRegistrationGUI.php.

References $lng, __initForm(), ilLanguage\_lookupEntry(), and ilUtil\getImagePath().

Referenced by executeCommand(), and saveForm().

{
global $lng;
$this->tpl->addBlockFile("CONTENT", "content", "tpl.startup_screen.html", "Services/Init");
$this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
$this->tpl->addBlockFile("STARTUP_CONTENT", "startup_content", "tpl.usr_registration.html",
"Services/Registration");
$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
$this->tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("registration"));
$lang_opts = array();
foreach ($lng->getInstalledLanguages() as $lang_key)
{
$lang_opts[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_".$lang_key);
}
// #11237
if(sizeof($lang_opts) > 1)
{
// language selection
$this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_OK",$lng->txt("ok"));
$this->tpl->setVariable("TXT_CHOOSE_LANGUAGE", $lng->txt("choose_language"));
asort($lang_opts);
$this->tpl->setCurrentBlock("languages");
foreach($lang_opts as $lang_key => $lang_caption)
{
$this->tpl->setVariable("LANG_NAME", $lang_caption);
$this->tpl->setVariable("LANG_ICON", $lang_key);
if($lang_key == $lng->getLangKey())
{
$this->tpl->setVariable("SELECTED_LANG", " selected=\"selected\"");
}
$this->tpl->parseCurrentBlock();
}
}
if(!$this->form)
{
$this->__initForm();
}
$this->tpl->setVariable("FORM", $this->form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAccountRegistrationGUI::executeCommand ( )

Definition at line 45 of file class.ilAccountRegistrationGUI.php.

References $cmd, $ilErr, $tpl, displayForm(), and IL_REG_DISABLED.

{
global $ilErr, $tpl;
if($this->registration_settings->getRegistrationType() == IL_REG_DISABLED)
{
$ilErr->raiseError($this->lng->txt('reg_disabled'),$ilErr->FATAL);
}
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
default:
if($cmd)
{
$this->$cmd();
}
else
{
$this->displayForm();
}
break;
}
$tpl->show();
return true;
}

+ Here is the call graph for this function:

ilAccountRegistrationGUI::login (   $password)

Definition at line 721 of file class.ilAccountRegistrationGUI.php.

References $_GET, $_SESSION, $code_was_used, $ilLog, $lng, ilUtil\getImagePath(), IL_REG_ACTIVATION, IL_REG_APPROVE, IL_REG_CODES, and IL_REG_DIRECT.

Referenced by saveForm().

{
global $ilias,$lng,$ilLog;
$ilLog->write("Entered login");
$this->tpl->addBlockFile("CONTENT", "content", "tpl.startup_screen.html", "Services/Init");
$this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
$this->tpl->addBlockFile("STARTUP_CONTENT", "startup_content", "tpl.usr_registered.html",
"Services/Registration");
$this->tpl->setVariable("IMG_USER",
ilUtil::getImagePath("icon_usr_b.png"));
$this->tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("registration"));
$this->tpl->setVariable("TXT_WELCOME", $lng->txt("welcome").", ".$this->userObj->getTitle()."!");
if (($this->registration_settings->getRegistrationType() == IL_REG_DIRECT or
$this->registration_settings->getRegistrationType() == IL_REG_CODES or
!$this->registration_settings->passwordGenerationEnabled())
{
$this->tpl->setCurrentBlock("activation");
$this->tpl->setVariable("TXT_REGISTERED", $lng->txt("txt_registered"));
$this->tpl->setVariable("FORMACTION", "login.php?cmd=post&target=".$_GET["target"]);
if(isset($_SESSION['forceShoppingCartRedirect']))
{
$this->tpl->setVariable("FORMACTION", './login.php?forceShoppingCartRedirect=1');
}
$this->tpl->setVariable("TARGET","target=\"_parent\"");
$this->tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias"));
$this->tpl->setVariable("USERNAME",$this->userObj->getLogin());
$this->tpl->setVariable("PASSWORD",$password);
$this->tpl->parseCurrentBlock();
}
else if ($this->registration_settings->getRegistrationType() == IL_REG_APPROVE)
{
$this->tpl->setVariable("TXT_REGISTERED", $lng->txt("txt_submitted"));
}
else if($this->registration_settings->getRegistrationType() == IL_REG_ACTIVATION)
{
$login_url = './login.php?cmd=force_login&lang='.$this->userObj->getLanguage();
$this->tpl->setVariable("TXT_REGISTERED", sprintf($lng->txt("reg_confirmation_link_successful"), $login_url));
$this->tpl->setVariable("REDIRECT_URL", $login_url);
}
else
{
$this->tpl->setVariable("TXT_REGISTERED", $lng->txt("txt_registered_passw_gen"));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAccountRegistrationGUI::saveForm ( )

Definition at line 247 of file class.ilAccountRegistrationGUI.php.

References $ilSetting, $lng, __createUser(), __distributeMails(), __initForm(), ilObjUser\_doesLoginnameExistInHistory(), ilObjUser\_loginExists(), ilObjRole\_lookupAllowRegister(), displayForm(), ilRegistrationCode\getCodeRole(), ilUtil\isLogin(), ilRegistrationCode\isUnusedCode(), login(), ilUtil\sendFailure(), and ilUtil\sendInfo().

{
global $lng, $ilSetting;
$this->__initForm();
$form_valid = $this->form->checkInput();
require_once 'Services/User/classes/class.ilObjUser.php';
// custom validation
// validate email against restricted domains
$email = $this->form->getInput("usr_email");
if($email)
{
// #10366
$domains = array();
foreach($this->registration_settings->getAllowedDomains() as $item)
{
if(trim($item))
{
$domains[] = $item;
}
}
if(sizeof($domains))
{
$mail_valid = false;
foreach($domains as $domain)
{
$domain = str_replace("*", "~~~", $domain);
$domain = preg_quote($domain);
$domain = str_replace("~~~", ".+", $domain);
if(preg_match("/^".$domain."$/", $email, $hit))
{
$mail_valid = true;
break;
}
}
if(!$mail_valid)
{
$mail_obj = $this->form->getItemByPostVar('usr_email');
$mail_obj->setAlert(sprintf($lng->txt("reg_email_domains"),
implode(", ", $domains)));
$form_valid = false;
}
}
}
if(!$this->form->getInput("usr_agreement"))
{
$agr_obj = $this->form->getItemByPostVar('usr_agreement');
$agr_obj->setAlert($lng->txt("force_accept_usr_agreement"));
$form_valid = false;
}
$valid_role = false;
// code
if($this->code_enabled)
{
$code = $this->form->getInput('usr_registration_code');
// could be optional
if($code)
{
// code validation
include_once './Services/Registration/classes/class.ilRegistrationCode.php';
{
$code_obj = $this->form->getItemByPostVar('usr_registration_code');
$code_obj->setAlert($lng->txt('registration_code_not_valid'));
$form_valid = false;
}
else
{
// get role from valid code
$valid_role = (int)ilRegistrationCode::getCodeRole($code);
}
}
}
// no need if role is attached to code
if(!$valid_role)
{
// manual selection
if ($this->registration_settings->roleSelectionEnabled())
{
include_once "./Services/AccessControl/classes/class.ilObjRole.php";
$selected_role = $this->form->getInput("usr_roles");
if ($selected_role && ilObjRole::_lookupAllowRegister($selected_role))
{
$valid_role = (int)$selected_role;
}
}
// assign by email
else
{
include_once 'Services/Registration/classes/class.ilRegistrationEmailRoleAssignments.php';
$registration_role_assignments = new ilRegistrationRoleAssignments();
$valid_role = (int)$registration_role_assignments->getRoleByEmail($this->form->getInput("usr_email"));
}
}
// no valid role could be determined
if (!$valid_role)
{
ilUtil::sendInfo($lng->txt("registration_no_valid_role"));
$form_valid = false;
}
// validate username
$login_obj = $this->form->getItemByPostVar('username');
$login = $this->form->getInput("username");
if (!ilUtil::isLogin($login))
{
$login_obj->setAlert($lng->txt("login_invalid"));
$form_valid = false;
}
else if (ilObjUser::_loginExists($login))
{
$login_obj->setAlert($lng->txt("login_exists"));
$form_valid = false;
}
else if ((int)$ilSetting->get('allow_change_loginname') &&
(int)$ilSetting->get('reuse_of_loginnames') == 0 &&
{
$login_obj->setAlert($lng->txt('login_exists'));
$form_valid = false;
}
if(!$form_valid)
{
ilUtil::sendFailure($lng->txt('form_input_not_valid'));
}
else
{
$password = $this->__createUser($valid_role);
$this->__distributeMails($password, $this->form->getInput("usr_language"));
$this->login($password);
return true;
}
$this->form->setValuesByPost();
$this->displayForm();
return false;
}

+ Here is the call graph for this function:

Field Documentation

ilAccountRegistrationGUI::$code_enabled
protected

Definition at line 24 of file class.ilAccountRegistrationGUI.php.

ilAccountRegistrationGUI::$code_was_used
protected

Definition at line 25 of file class.ilAccountRegistrationGUI.php.

Referenced by __createUser(), __distributeMails(), and login().

ilAccountRegistrationGUI::$registration_settings
protected

Definition at line 23 of file class.ilAccountRegistrationGUI.php.


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