5include_once 
'Services/Mail/classes/class.ilMailOptions.php';
 
   51                        "method" => 
"getLogin",
 
   52                        "course_export_fix_value" => 1,
 
   53                        "group_export_fix_value" => 1,
 
   54                        "changeable_hide" => 
true,
 
   55                        "required_hide" => 
true,
 
   56                        "group" => 
"personal_data"),
 
   58                        "input" => 
"password",
 
   59                        "required_hide" => 
true,
 
   60                        "visib_reg_hide" => 
true,
 
   61                        'visib_lua_fix_value' => 0,
 
   62                        "course_export_hide" => 
true,
 
   63                        "export_hide" => 
false,
 
   64                        "group_export_hide" => 
true,
 
   66                        "group" => 
"personal_data"),
 
   71                        "method" => 
"getFirstname",
 
   72                        "required_fix_value" => 1,
 
   73                        "visib_reg_fix_value" => 1,
 
   74                        'visib_lua_fix_value' => 1,
 
   75                        "course_export_fix_value" => 1,
 
   76                        "group_export_fix_value" => 1,
 
   77                        "group" => 
"personal_data"),
 
   82                        "method" => 
"getLastname",
 
   83                        "required_fix_value" => 1,
 
   84                        "visib_reg_fix_value" => 1,
 
   85                        'visib_lua_fix_value' => 1,
 
   86                        "course_export_fix_value" => 1,
 
   87                        "group_export_fix_value" => 1,
 
   88                        "group" => 
"personal_data"),
 
   91                        "lang_var" => 
"person_title",
 
   94                        "method" => 
"getUTitle",
 
   95                        "group" => 
"personal_data"),
 
   97                        "input" => 
"birthday",
 
   98                        "lang_var" => 
"birthday",
 
  101                        "method" => 
"getBirthday",
 
  102                        "group" => 
"personal_data"),
 
  105                        "values" => array(
"n" => 
"salutation_n", 
"f" => 
"salutation_f", 
"m" => 
"salutation_m"),
 
  106                        "method" => 
"getGender",
 
  107                        "group" => 
"personal_data"),
 
  109                        "input" => 
"picture",
 
  110                        "required_hide" => 
true,
 
  111                        "visib_reg_hide" => 
true,
 
  112                        "course_export_hide" => 
true,
 
  113                        "group_export_hide" => 
true,
 
  114                        "lists_hide" => 
true,
 
  115                        "lang_var" => 
"personal_picture",
 
  116                        "group" => 
"personal_data"),
 
  119                        "changeable_hide" => 
true,
 
  120                        "required_hide" => 
true,
 
  121                        "visib_reg_hide" => 
true,
 
  122                        "export_hide" => 
true,
 
  123                        "course_export_hide" => 
true,
 
  124                        "group_export_hide" => 
true,
 
  125                        "lists_hide" => 
true,
 
  126                        "group" => 
"personal_data"),
 
  127        "interests_general" => array(
 
  128                        "input" => 
"multitext",
 
  131                        "method" => 
"getGeneralInterests",
 
  132                        "course_export_hide" => 
true,
 
  133                        "group_export_hide" => 
true,
 
  134                        "lists_hide" => 
true,
 
  135                        "group" => 
"interests"),
 
  136        "interests_help_offered" => array(
 
  137                        "input" => 
"multitext",
 
  140                        "method" => 
"getOfferingHelp",
 
  141                        "course_export_hide" => 
true,
 
  142                        "group_export_hide" => 
true,
 
  143                        "lists_hide" => 
true,
 
  144                        "group" => 
"interests"),
 
  145        "interests_help_looking" => array(
 
  146                        "input" => 
"multitext",
 
  149                        "method" => 
"getLookingForHelp",
 
  150                        "course_export_hide" => 
true,
 
  151                        "group_export_hide" => 
true,
 
  152                        "lists_hide" => 
true,
 
  153                        "group" => 
"interests"),
 
  154        "org_units" => array(
 
  155                        "input" => 
"noneditable",
 
  156                        "lang_var" => 
"objs_orgu",
 
  157                        "required_hide" => 
true,
 
  158                        "visib_reg_hide" => 
true,
 
  159                        "course_export_hide" => 
false,
 
  160                        "group_export_hide" => 
false,
 
  161                        "export_hide" => 
true,
 
  162                        "changeable_hide" => 
true,
 
  163                        "changeable_fix_value" => 0,
 
  164                        "changeable_lua_hide" => 
true,
 
  165                        "changeable_lua_fix_value" => 0,
 
  166                        "method" => 
"getOrgUnitsRepresentation",
 
  167                        "group" => 
"contact_data"),
 
  168        "institution" => array(
 
  172                        "method" => 
"getInstitution",
 
  173                        "group" => 
"contact_data"),
 
  174        "department" => array(
 
  178                        "method" => 
"getDepartment",
 
  179                        "group" => 
"contact_data"),
 
  184                        "method" => 
"getStreet",
 
  185                        "group" => 
"contact_data"),
 
  190                        "method" => 
"getZipcode",
 
  191                        "group" => 
"contact_data"),
 
  196                        "method" => 
"getCity",
 
  197                        "group" => 
"contact_data"),
 
  202                        "method" => 
"getCountry",
 
  203                        "group" => 
"contact_data"),
 
  204        "sel_country" => array(
 
  205                        "input" => 
"sel_country",
 
  206                        "method" => 
"getSelectedCountry",
 
  207                        "group" => 
"contact_data"),
 
  208        "phone_office" => array(
 
  212                        "method" => 
"getPhoneOffice",
 
  213                        "group" => 
"contact_data"),
 
  214        "phone_home" => array(
 
  218                        "method" => 
"getPhoneHome",
 
  219                        "group" => 
"contact_data"),
 
  220        "phone_mobile" => array(
 
  224                        "method" => 
"getPhoneMobile",
 
  225                        "group" => 
"contact_data"),
 
  230                        "method" => 
"getFax",
 
  231                        "group" => 
"contact_data"),
 
  236                        "method" => 
"getEmail",
 
  237                        "group" => 
"contact_data"),
 
  238        "second_email" => array(
 
  239                        "input" => 
"second_email",
 
  242                        "method" => 
"getSecondEmail",
 
  243                        "group" => 
"contact_data"),
 
  245                        "input" => 
"textarea",
 
  248                        "method" => 
"getHobby",
 
  249                        "lists_hide" => 
true,
 
  250                        "group" => 
"contact_data"),
 
  251        "referral_comment" => array(
 
  252                        "input" => 
"textarea",
 
  255                        "method" => 
"getComment",
 
  256                        "course_export_hide" => 
true,
 
  257                        "group_export_hide" => 
true,
 
  258                        "lists_hide" => 
true,
 
  259                        "group" => 
"contact_data"),
 
  260        "matriculation" => array(
 
  264                        "method" => 
"getMatriculation",
 
  267                        "input" => 
"language",
 
  268                        "method" => 
"getLanguage",
 
  269                        "required_hide" => 
true,
 
  270                        "visib_reg_hide" => 
true,
 
  271                        "course_export_hide" => 
true,
 
  272                        "group_export_hide" => 
true,
 
  273                        "group" => 
"settings"),
 
  274        "skin_style" => array(
 
  275                        "input" => 
"skinstyle",
 
  276                        "required_hide" => 
true,
 
  277                        "visib_reg_hide" => 
true,
 
  278                        "course_export_hide" => 
true,
 
  279                        "group_export_hide" => 
true,
 
  280                        "group" => 
"settings"),
 
  281        "hits_per_page" => array(
 
  282                        "input" => 
"hitsperpage",
 
  285                            10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
 
  286                            50 => 50, 100 => 100, 9999 => 9999),
 
  287                        "required_hide" => 
true,
 
  288                        "visib_reg_hide" => 
true,
 
  289                        "course_export_hide" => 
true,
 
  290                        "group_export_hide" => 
true,
 
  291                        "group" => 
"settings"),
 
  304        "hide_own_online_status" => array(
 
  305                        "input" => 
"selection",
 
  306                        "lang_var" => 
"awrn_user_show",
 
  307                        "required_hide" => 
true,
 
  308                        "visib_reg_hide" => 
true,
 
  309                        "course_export_hide" => 
true,
 
  310                        "group_export_hide" => 
true,
 
  311                        "group" => 
"settings",
 
  314                            "y" => 
"user_awrn_hide",
 
  315                            "n" => 
"user_awrn_show" 
  317        "bs_allow_to_contact_me" => array(
 
  318            "input" => 
"selection",
 
  319            "lang_var" => 
"buddy_allow_to_contact_me",
 
  320            "required_hide" => 
true,
 
  321            "visib_reg_hide" => 
true,
 
  322            "course_export_hide" => 
true,
 
  323            "group_export_hide" => 
true,
 
  324            "group" => 
"settings",
 
  327                "n" => 
"buddy_allow_to_contact_me_no",
 
  328                "y" => 
"buddy_allow_to_contact_me_yes" 
  331        "chat_osc_accept_msg" => array(
 
  332            "input" => 
"selection",
 
  333            "lang_var" => 
"chat_osc_accept_msg",
 
  334            "required_hide" => 
true,
 
  335            "visib_reg_hide" => 
true,
 
  336            "course_export_hide" => 
true,
 
  337            "group_export_hide" => 
true,
 
  338            "group" => 
"settings",
 
  341                "n" => 
"chat_osc_accepts_messages_no",
 
  342                "y" => 
"chat_osc_accepts_messages_yes" 
  345        "preferences" => array(
 
  346                        "visible_fix_value" => 1,
 
  347                        "changeable_fix_value" => 1,
 
  348                        "required_hide" => 
true,
 
  349                        "visib_reg_hide" => 
true,
 
  350                        "course_export_hide" => 
true,
 
  351                        "group_export_hide" => 
true,
 
  352                        "group" => 
"preferences"),
 
  353        "mail_incoming_mail" => array(
 
  354                        "input" => 
"selection",
 
  360                        "required_hide" => 
true,
 
  361                        "visib_reg_hide" => 
true,
 
  362                        "course_export_hide" => 
true,
 
  363                        "group_export_hide" => 
true,
 
  364                        "export_hide" => 
true,
 
  365                        "search_hide" => 
true,
 
  366                        "group" => 
"settings")
 
  385        $this->skip_groups = array();
 
  386        $this->skip_fields = array();
 
  390        $lng->loadLanguageModule(
"awrn");
 
  391        $lng->loadLanguageModule(
"buddysystem");
 
  402        foreach (self::$user_field as 
$f => $p) {
 
  404            if (in_array($p[
"group"], $this->skip_groups) ||
 
  405                in_array(
$f, $this->skip_fields)) {
 
  427            if (
$ilSetting->get(
'usr_settings_visib_lua_' . $field, 1)) {
 
  428                $fields[$field] = $info;
 
  429            } elseif ($info[
'visib_lua_fix_value']) {
 
  430                $fields[$field] = $info;
 
  442        $this->skip_groups[] = $a_group;
 
  450        $this->skip_fields[] = $a_field;
 
  462        $rbacreview = 
$DIC[
'rbacreview'];
 
  463        $ilias = 
$DIC[
'ilias'];
 
  466        if (self::$mode == self::MODE_REGISTRATION) {
 
  467            include_once 
'Services/Registration/classes/class.ilRegistrationSettings.php';
 
  470            self::$user_field[
"username"][
"group"] = 
"login_data";
 
  471            self::$user_field[
"password"][
"group"] = 
"login_data";
 
  472            self::$user_field[
"language"][
"default"] = 
$lng->lang_key;
 
  475            $roles = self::$user_field[
"roles"];
 
  476            unset(self::$user_field[
"roles"]);
 
  477            self::$user_field[
"roles"] = $roles;
 
  478            self::$user_field[
"roles"][
"group"] = 
"settings";
 
  483        $custom_fields_done = 
false;
 
  484        foreach ($fields as 
$f => $p) {
 
  486            if (($p[
"group"] != $current_group) &&
 
  488                if (is_array($custom_fields) && !$custom_fields_done) {
 
  490                    if ($current_group == 
"other" || $p[
"group"] == 
"settings") {
 
  492                        if ($current_group != 
"other") {
 
  494                            $sh->setTitle(
$lng->txt(
"other"));
 
  495                            $a_form->addItem($sh);
 
  497                        foreach ($custom_fields as $custom_field) {
 
  498                            $a_form->addItem($custom_field);
 
  500                        $custom_fields_done = 
true;
 
  505                $sh->setTitle(
$lng->txt($p[
"group"]));
 
  506                $a_form->addItem($sh);
 
  507                $current_group = $p[
"group"];
 
  511            if (isset($p[
"method"])) {
 
  515            $lv = (isset($p[
"lang_var"]) && $p[
"lang_var"] != 
"")
 
  519            switch ($p[
"input"]) {
 
  524                            $val->setValue($a_user->getLogin());
 
  526                        $val->setMaxLength($p[
'maxlength']);
 
  528                        $val->setRequired(
true);
 
  533                            $val->setValue($a_user->getLogin());
 
  536                    $a_form->addItem($val);
 
  543                            $ti->setValue($a_user->$m());
 
  545                        $ti->setMaxLength($p[
"maxlength"]);
 
  546                        $ti->setSize($p[
"size"]);
 
  548                        if (!$ti->getRequired() || $ti->getValue()) {
 
  549                            $ti->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  551                        $a_form->addItem($ti);
 
  557                        include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
 
  560                            $ci->setValue($a_user->$m());
 
  563                        if (!$ci->getRequired() || $ci->getValue()) {
 
  564                            $ci->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  566                        $a_form->addItem($ci);
 
  573                        include_once 
"./Services/Calendar/classes/class.ilDateTime.php";
 
  575                        if ($a_user && strlen($a_user->$m())) {
 
  580                        if (!$bi->getRequired() || $date) {
 
  581                            $bi->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  583                        $a_form->addItem($bi);
 
  591                            $rg->setValue($a_user->$m());
 
  593                        foreach ($p[
"values"] as $k => $v) {
 
  598                        if (!$rg->getRequired() || $rg->getValue()) {
 
  599                            $rg->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  601                        $a_form->addItem($rg);
 
  608                        $ii->setDisabled(
$ilSetting->get(
"usr_settings_disable_upload"));
 
  610                        $upload = $a_form->getFileUpload(
"userfile");
 
  611                        if ($upload[
"name"]) {
 
  612                            $ii->setPending($upload[
"name"]);
 
  622                                $ii->setAlt(
$lng->txt(
"personal_picture"));
 
  626                        $a_form->addItem($ii);
 
  631                    if (self::$mode == self::MODE_DESKTOP) {
 
  633                            $global_roles = $rbacreview->getGlobalRoles();
 
  634                            foreach ($global_roles as $role_id) {
 
  635                                if (in_array($role_id, $rbacreview->assignedRoles($a_user->getId()))) {
 
  636                                    $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
 
  637                                    $role_names .= $roleObj->getTitle() . 
", ";
 
  642                            $dr->setValue(substr($role_names, 0, -2));
 
  643                            $a_form->addItem($dr);
 
  645                    } elseif (self::$mode == self::MODE_REGISTRATION) {
 
  646                        if ($registration_settings->roleSelectionEnabled()) {
 
  647                            include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
 
  650                                $options[$role[
"id"]] = $role[
"title"];
 
  654                                if (
sizeof($options) > 1) {
 
  656                                    $ta->setOptions($options);
 
  658                                    if (!$ta->getRequired()) {
 
  659                                        $ta->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  665                                    $ta->setValue(array_shift(array_keys($options)));
 
  667                                $a_form->addItem($ta);
 
  677                            $em->setValue($a_user->$m());
 
  680                        if (!$em->getRequired() || $em->getValue()) {
 
  681                            $em->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  683                        if (self::MODE_REGISTRATION == self::$mode) {
 
  684                            $em->setRetype(
true);
 
  686                        $a_form->addItem($em);
 
  693                            $em->setValue($a_user->$m());
 
  696                        if (!$em->getRequired() || $em->getValue()) {
 
  697                            $em->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  699                        if (self::MODE_REGISTRATION == self::$mode) {
 
  700                            $em->setRetype(
true);
 
  702                        $a_form->addItem($em);
 
  709                            $ta->setValue($a_user->$m());
 
  711                        $ta->setRows($p[
"rows"]);
 
  712                        $ta->setCols($p[
"cols"]);
 
  714                        if (!$ta->getRequired() || $ta->getValue()) {
 
  715                            $ta->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  717                        $a_form->addItem($ta);
 
  722                    if (self::$mode == self::MODE_REGISTRATION) {
 
  723                        if (!$registration_settings->passwordGenerationEnabled()) {
 
  725                            $ta->setUseStripSlashes(
false);
 
  726                            $ta->setRequired(
true);
 
  731                            $ta->setValue(
$lng->txt(
"reg_passwd_via_mail"));
 
  733                        $a_form->addItem($ta);
 
  741                            $ta->setValue($a_user->$m());
 
  744                        $lng->loadLanguageModule(
"meta");
 
  745                        foreach (
$lng->getInstalledLanguages() as $lang_key) {
 
  746                            $options[$lang_key] = 
$lng->txt(
"meta_l_" . $lang_key);
 
  749                        $ta->setOptions($options);
 
  751                        if (!$ta->getRequired() || $ta->getValue()) {
 
  752                            $ta->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  754                        $a_form->addItem($ta);
 
  763                            $ti->setValue($a_user->$m());
 
  765                        $ti->setMaxLength($p[
"maxlength"]);
 
  766                        $ti->setSize($p[
"size"]);
 
  768                        if (!$ti->getRequired() || $ti->getValue()) {
 
  769                            $ti->setDisabled(
$ilSetting->get(
"usr_settings_disable_" . 
$f));
 
  771                        if ($this->ajax_href) {
 
  773                            $ti->setDataSource($this->ajax_href . 
"&f=" . 
$f);
 
  775                        $a_form->addItem($ti);
 
  781                        $ne->setValue($a_user->$m());
 
  782                        $a_form->addItem($ne);
 
  789        if (is_array($custom_fields) && !$custom_fields_done) {
 
  791            if ($current_group != 
"other") {
 
  793                $sh->setTitle(
$lng->txt(
"other"));
 
  794                $a_form->addItem($sh);
 
  796            foreach ($custom_fields as $custom_field) {
 
  797                $a_form->addItem($custom_field);
 
  804        $this->ajax_href = $a_href;
 
  819        if (self::$mode == self::MODE_DESKTOP) {
 
  822            if (isset(self::$user_field[$a_setting][
"visib_reg_hide"]) && self::$user_field[$a_setting][
"visib_reg_hide"] === 
true) {
 
  825            return (
$ilSetting->get(
"usr_settings_visib_reg_" . $a_setting, 
"1") || 
$ilSetting->get(
"require_" . $a_setting, 
"0"));
 
  835        if (in_array(
$mode, array(self::MODE_DESKTOP, self::MODE_REGISTRATION))) {
 
  859        foreach (self::$user_field as $field => $definition) {
 
  865            if (
$ilSetting->get(
"require_" . $field) && $definition[
"method"]) {
 
  866                $value = $a_user->{$definition[
"method"]}();
 
  874        if ($a_include_udf) {
 
  875            $user_defined_data = $a_user->getUserDefinedData();
 
  877            include_once 
'./Services/User/classes/class.ilUserDefinedFields.php';
 
  879            foreach ($user_defined_fields->getRequiredDefinitions() as $field => $definition) {
 
  881                if ($a_personal_data_only && !$definition[
"visible"]) {
 
  885                if (!$user_defined_data[
"f_" . $field]) {
 
  908        return $user_settings_config->isVisibleAndChangeable($setting);
 
  931        $ignorableSettings = array();
 
  933        foreach (self::$user_field as $field => $definition) {
 
  935            if (
'username' == $field ||
 
  936                'password' == $field) {
 
  945            if (self::isEditableByUser($field)) {
 
  946                $ignorableSettings[] = $field;
 
  950        return $ignorableSettings;
 
An exception for terminatinating execution or to throw for unit testing.
@classDescription Date and time handling
static getLogger($a_component_id)
Get component logger.
This class represents a non editable value in a property form.
static _lookupRegisterAllowed()
get all roles that are activated in user registration
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false, $html_export=false)
Get path to personal picture.
This class represents an option in a radio group.
Class ilObjAuthSettingsGUI.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static _getInstance()
Get instance.
addStandardFieldsToForm($a_form, $a_user=null, array $custom_fields=null)
Add standard fields to form.
__construct()
Constructor.
getStandardFields()
Get standard user fields array.
getLocalUserAdministrationFields()
Get visible fields in local user administration.
skipField($a_field)
Skip a field.
skipGroup($a_group)
Skip a group.
static isEditableByUser($setting)
Returns whether a profile setting is editable by an user in the profile gui.
static userSettingVisible($a_setting)
Checks whether user setting is visible.
static getIgnorableRequiredSettings()
Returns an array of all ignorable profiel fields.
static isProfileIncomplete($a_user, $a_include_udf=true, $a_personal_data_only=true)
Check if all required personal data fields are set.
User settings configuration (what preferences can be visible/changed/...)
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()