5 include_once
'Services/Mail/classes/class.ilMailOptions.php';
20 private static $mode = self::MODE_DESKTOP;
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(
"f" =>
"gender_f",
"m" =>
"gender_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"),
239 "input" =>
"textarea",
242 "method" =>
"getHobby",
243 "lists_hide" =>
true,
244 "group" =>
"contact_data"),
245 "referral_comment" =>
array(
246 "input" =>
"textarea",
249 "method" =>
"getComment",
250 "course_export_hide" =>
true,
251 "group_export_hide" =>
true,
252 "lists_hide" =>
true,
253 "group" =>
"contact_data"),
254 "matriculation" =>
array(
258 "method" =>
"getMatriculation",
261 "input" =>
"language",
262 "method" =>
"getLanguage",
263 "required_hide" =>
true,
264 "visib_reg_hide" =>
true,
265 "course_export_hide" =>
true,
266 "group_export_hide" =>
true,
267 "group" =>
"settings"),
268 "skin_style" =>
array(
269 "input" =>
"skinstyle",
270 "required_hide" =>
true,
271 "visib_reg_hide" =>
true,
272 "course_export_hide" =>
true,
273 "group_export_hide" =>
true,
274 "group" =>
"settings"),
275 "hits_per_page" =>
array(
276 "input" =>
"hitsperpage",
279 10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
280 50 => 50, 100 => 100, 9999 => 9999),
281 "required_hide" =>
true,
282 "visib_reg_hide" =>
true,
283 "course_export_hide" =>
true,
284 "group_export_hide" =>
true,
285 "group" =>
"settings"),
298 "hide_own_online_status" =>
array(
299 "input" =>
"selection",
300 "lang_var" =>
"awrn_hide_from_awareness",
301 "required_hide" =>
true,
302 "visib_reg_hide" =>
true,
303 "course_export_hide" =>
true,
304 "group_export_hide" =>
true,
305 "group" =>
"settings"),
306 "bs_allow_to_contact_me" =>
array(
307 "input" =>
"selection",
308 "lang_var" =>
"buddy_allow_to_contact_me",
309 "required_hide" =>
true,
310 "visib_reg_hide" =>
true,
311 "course_export_hide" =>
true,
312 "group_export_hide" =>
true,
313 "group" =>
"settings",
316 "n" =>
"buddy_allow_to_contact_me_no",
317 "y" =>
"buddy_allow_to_contact_me_yes" 320 "chat_osc_accept_msg" =>
array(
321 "input" =>
"selection",
322 "lang_var" =>
"chat_osc_accept_msg",
323 "required_hide" =>
true,
324 "visib_reg_hide" =>
true,
325 "course_export_hide" =>
true,
326 "group_export_hide" =>
true,
327 "group" =>
"settings",
330 "n" =>
"chat_osc_accepts_messages_no",
331 "y" =>
"chat_osc_accepts_messages_yes" 334 "preferences" =>
array(
335 "visible_fix_value" => 1,
336 "changeable_fix_value" => 1,
337 "required_hide" =>
true,
338 "visib_reg_hide" =>
true,
339 "course_export_hide" =>
true,
340 "group_export_hide" =>
true,
341 "group" =>
"preferences"),
342 "mail_incoming_mail" =>
array(
343 "input" =>
"selection",
349 "required_hide" =>
true,
350 "visib_reg_hide" =>
true,
351 "course_export_hide" =>
true,
352 "group_export_hide" =>
true,
353 "export_hide" =>
true,
354 "search_hide" =>
true,
355 "group" =>
"settings")
366 $this->skip_groups =
array();
367 $this->skip_fields =
array();
371 $lng->loadLanguageModule(
"awrn");
372 $lng->loadLanguageModule(
"buddysystem");
381 foreach (self::$user_field as $f => $p)
384 if (in_array($p[
"group"], $this->skip_groups) ||
385 in_array($f, $this->skip_fields))
402 $settings = $ilSetting->getAll();
407 if($ilSetting->get(
'usr_settings_visib_lua_'.$field,1))
409 $fields[$field] =
$info;
411 elseif(
$info[
'visib_lua_fix_value'])
413 $fields[$field] =
$info;
425 $this->skip_groups[] = $a_group;
433 $this->skip_fields[] = $a_field;
444 if(self::$mode == self::MODE_REGISTRATION)
446 include_once
'Services/Registration/classes/class.ilRegistrationSettings.php';
449 self::$user_field[
"username"][
"group"] =
"login_data";
450 self::$user_field[
"password"][
"group"] =
"login_data";
451 self::$user_field[
"language"][
"default"] = $lng->lang_key;
454 $roles = self::$user_field[
"roles"];
455 unset(self::$user_field[
"roles"]);
456 self::$user_field[
"roles"] = $roles;
457 self::$user_field[
"roles"][
"group"] =
"settings";
462 $custom_fields_done =
false;
463 foreach ($fields as $f => $p)
466 if (($p[
"group"] != $current_group) &&
469 if (is_array($custom_fields) && !$custom_fields_done)
472 if($current_group ==
"other" || $p[
"group"] ==
"settings")
475 if($current_group !=
"other")
478 $sh->setTitle($lng->txt(
"other"));
479 $a_form->addItem($sh);
481 foreach($custom_fields as $custom_field)
483 $a_form->addItem($custom_field);
485 $custom_fields_done =
true;
490 $sh->setTitle($lng->txt($p[
"group"]));
491 $a_form->addItem($sh);
492 $current_group = $p[
"group"];
496 if (isset($p[
"method"]))
501 $lv = (isset($p[
"lang_var"]) && $p[
"lang_var"] !=
"")
508 if ((
int)$ilSetting->get(
'allow_change_loginname') || self::$mode == self::MODE_REGISTRATION)
513 $val->
setValue($a_user->getLogin());
515 $val->setMaxLength($p[
'maxlength']);
517 $val->setRequired(
true);
525 $val->
setValue($a_user->getLogin());
528 $a_form->addItem($val);
539 $ti->setMaxLength($p[
"maxlength"]);
540 $ti->setSize($p[
"size"]);
541 $ti->setRequired($ilSetting->get(
"require_".$f));
542 if(!$ti->getRequired() || $ti->getValue())
544 $ti->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
546 $a_form->addItem($ti);
553 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
559 $ci->setRequired($ilSetting->get(
"require_".$f));
560 if(!$ci->getRequired() || $ci->getValue())
562 $ci->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
564 $a_form->addItem($ci);
572 include_once
"./Services/Calendar/classes/class.ilDateTime.php";
574 if ($a_user && strlen($a_user->$m()))
579 $bi->setRequired($ilSetting->get(
"require_".$f));
580 if(!$bi->getRequired() || $date)
582 $bi->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
584 $a_form->addItem($bi);
596 foreach ($p[
"values"] as $k => $v)
601 $rg->setRequired($ilSetting->get(
"require_".$f));
602 if(!$rg->getRequired() || $rg->getValue())
604 $rg->
setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
606 $a_form->addItem($rg);
614 $ii->
setDisabled($ilSetting->get(
"usr_settings_disable_upload"));
616 $upload = $a_form->getFileUpload(
"userfile");
619 $ii->setPending($upload[
"name"]);
628 $ii->setAlt($lng->txt(
"personal_picture"));
632 $a_form->addItem($ii);
637 if(self::$mode == self::MODE_DESKTOP)
641 $global_roles = $rbacreview->getGlobalRoles();
642 foreach($global_roles as $role_id)
644 if (in_array($role_id,$rbacreview->assignedRoles($a_user->getId())))
646 $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
647 $role_names .= $roleObj->getTitle().
", ";
652 $dr->
setValue(substr($role_names,0,-2));
653 $a_form->addItem($dr);
656 else if(self::$mode == self::MODE_REGISTRATION)
658 if($registration_settings->roleSelectionEnabled())
660 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
664 $options[$role[
"id"]] = $role[
"title"];
673 $ta->setRequired($ilSetting->get(
"require_".$f));
674 if(!$ta->getRequired())
676 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
683 $ta->setValue(array_shift(array_keys(
$options)));
685 $a_form->addItem($ta);
699 $em->setRequired($ilSetting->get(
"require_".$f));
700 if(!$em->getRequired() || $em->getValue())
702 $em->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
704 if(self::MODE_REGISTRATION == self::$mode)
706 $em->setRetype(
true);
708 $a_form->addItem($em);
720 $ta->setRows($p[
"rows"]);
721 $ta->setCols($p[
"cols"]);
722 $ta->setRequired($ilSetting->get(
"require_".$f));
723 if(!$ta->getRequired() || $ta->getValue())
725 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
727 $a_form->addItem($ta);
732 if (self::$mode == self::MODE_REGISTRATION)
734 if(!$registration_settings->passwordGenerationEnabled())
744 $ta->
setValue($lng->txt(
"reg_passwd_via_mail"));
746 $a_form->addItem($ta);
759 $lng->loadLanguageModule(
"meta");
760 foreach ($lng->getInstalledLanguages() as $lang_key)
762 $options[$lang_key] = $lng->txt(
"meta_l_".$lang_key);
766 $ta->setRequired($ilSetting->get(
"require_".$f));
767 if(!$ta->getRequired() || $ta->getValue())
769 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
771 $a_form->addItem($ta);
782 $ti->setValue($a_user->$m());
784 $ti->setMaxLength($p[
"maxlength"]);
785 $ti->setSize($p[
"size"]);
786 $ti->setRequired($ilSetting->get(
"require_".$f));
787 if(!$ti->getRequired() || $ti->getValue())
789 $ti->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
794 $ti->setDataSource($this->ajax_href.
"&f=".$f);
796 $a_form->addItem($ti);
803 $a_form->addItem($ne);
810 if(is_array($custom_fields) && !$custom_fields_done)
813 if($current_group !=
"other")
816 $sh->setTitle($lng->txt(
"other"));
817 $a_form->addItem($sh);
819 foreach($custom_fields as $custom_field)
821 $a_form->addItem($custom_field);
828 $this->ajax_href = $a_href;
838 if(self::$mode == self::MODE_DESKTOP)
840 return ($ilSetting->get(
"usr_settings_hide_".$a_setting) != 1);
844 if(isset(self::$user_field[$a_setting][
"visib_reg_hide"]) && self::$user_field[$a_setting][
"visib_reg_hide"] ===
true)
848 return ($ilSetting->get(
"usr_settings_visib_reg_".$a_setting,
"1") || $ilSetting->get(
"require_".$a_setting,
"0"));
856 if(in_array(
$mode,
array(self::MODE_DESKTOP, self::MODE_REGISTRATION)))
877 foreach(self::$user_field as $field => $definition)
880 if($a_personal_data_only && $ilSetting->get(
"usr_settings_hide_".$field))
885 if($ilSetting->get(
"require_".$field) && $definition[
"method"])
887 $value = $a_user->{$definition[
"method"]}();
898 $user_defined_data = $a_user->getUserDefinedData();
900 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
902 foreach($user_defined_fields->getRequiredDefinitions() as $field => $definition)
905 if($a_personal_data_only && !$definition[
"visible"])
910 if(!$user_defined_data[
"f_".$field])
941 if( $ilSetting->get(
'usr_settings_hide_'.$setting) == 1 ||
942 $ilSetting->get(
'usr_settings_disable_'.$setting) == 1 )
969 $ignorableSettings =
array();
971 foreach(self::$user_field as $field => $definition)
974 if(
'username' == $field ||
975 'password' == $field )
981 if( !$ilSetting->get(
'require_'.$field) )
986 if( self::isEditableByUser($field) )
988 $ignorableSettings[] = $field;
992 return $ignorableSettings;
static isProfileIncomplete($a_user, $a_include_udf=true, $a_personal_data_only=true)
Check if all required personal data fields are set.
This class represents an option in a radio group.
setValue($a_value)
Set Value.
static _getInstance()
Get instance.
getLocalUserAdministrationFields()
Get visible fields in local user administration.
static _lookupRegisterAllowed()
get all roles that are activated in user registration
getStandardFields()
Get standard user fields array.
__construct()
Constructor.
static userSettingVisible($a_setting)
Checks whether user setting is visible.
setValue($a_value)
Set Value.
static getIgnorableRequiredSettings()
Returns an array of all ignorable profiel fields.
skipField($a_field)
Skip a field.
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()
static isEditableByUser($setting)
Returns whether a profile setting is editable by an user in the profile gui.
if(!is_array($argv)) $options
This class represents a text property in a property form.
Create styles array
The data for the language used.
Class ilObjAuthSettingsGUI.
addStandardFieldsToForm($a_form, $a_user=NULL, array $custom_fields=NULL)
Add standard fields to form.
This class represents a non editable value in a property form.
setDate($a_date, $a_format)
set date
This class represents a text area property in a property form.
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
static getLogger($a_component_id)
Get component logger.
setValue($a_value)
Set Value.
skipGroup($a_group)
Skip a group.