5 include_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(
"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 "institution" => array(
158 "method" =>
"getInstitution",
159 "group" =>
"contact_data"),
160 "department" => array(
164 "method" =>
"getDepartment",
165 "group" =>
"contact_data"),
170 "method" =>
"getStreet",
171 "group" =>
"contact_data"),
176 "method" =>
"getZipcode",
177 "group" =>
"contact_data"),
182 "method" =>
"getCity",
183 "group" =>
"contact_data"),
188 "method" =>
"getCountry",
189 "group" =>
"contact_data"),
190 "sel_country" => array(
191 "input" =>
"sel_country",
192 "method" =>
"getSelectedCountry",
193 "group" =>
"contact_data"),
194 "phone_office" => array(
198 "method" =>
"getPhoneOffice",
199 "group" =>
"contact_data"),
200 "phone_home" => array(
204 "method" =>
"getPhoneHome",
205 "group" =>
"contact_data"),
206 "phone_mobile" => array(
210 "method" =>
"getPhoneMobile",
211 "group" =>
"contact_data"),
216 "method" =>
"getFax",
217 "group" =>
"contact_data"),
222 "method" =>
"getEmail",
223 "group" =>
"contact_data"),
225 "input" =>
"textarea",
228 "method" =>
"getHobby",
229 "lists_hide" =>
true,
230 "group" =>
"contact_data"),
231 "referral_comment" => array(
232 "input" =>
"textarea",
235 "method" =>
"getComment",
236 "course_export_hide" =>
true,
237 "group_export_hide" =>
true,
238 "lists_hide" =>
true,
239 "group" =>
"contact_data"),
240 "instant_messengers" => array(
241 "input" =>
"messenger",
242 "types" => array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip"),
245 "course_export_hide" =>
true,
246 "group_export_hide" =>
true,
247 "lists_hide" =>
true,
248 "group" =>
"instant_messengers"),
249 "matriculation" => array(
253 "method" =>
"getMatriculation",
255 "delicious" => array(
259 "method" =>
"getDelicious",
262 "input" =>
"language",
263 "method" =>
"getLanguage",
264 "required_hide" =>
true,
265 "visib_reg_hide" =>
true,
266 "course_export_hide" =>
true,
267 "group_export_hide" =>
true,
268 "group" =>
"settings"),
269 "skin_style" => array(
270 "input" =>
"skinstyle",
271 "required_hide" =>
true,
272 "visib_reg_hide" =>
true,
273 "course_export_hide" =>
true,
274 "group_export_hide" =>
true,
275 "group" =>
"settings"),
276 "hits_per_page" => array(
277 "input" =>
"hitsperpage",
280 10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
281 50 => 50, 100 => 100, 9999 => 9999),
282 "required_hide" =>
true,
283 "visib_reg_hide" =>
true,
284 "course_export_hide" =>
true,
285 "group_export_hide" =>
true,
286 "group" =>
"settings"),
287 "show_users_online" => array(
288 "input" =>
"selection",
291 "y" =>
"users_online_show_short_y",
292 "associated" =>
"users_online_show_short_associated",
293 "n" =>
"users_online_show_short_n"),
294 "required_hide" =>
true,
295 "visib_reg_hide" =>
true,
296 "course_export_hide" =>
true,
297 "group_export_hide" =>
true,
298 "group" =>
"settings"),
299 "hide_own_online_status" => array(
300 "input" =>
"selection",
301 "required_hide" =>
true,
302 "visib_reg_hide" =>
true,
303 "course_export_hide" =>
true,
304 "group_export_hide" =>
true,
305 "group" =>
"settings"),
306 "preferences" => array(
307 "visible_fix_value" => 1,
308 "changeable_fix_value" => 1,
309 "required_hide" =>
true,
310 "visib_reg_hide" =>
true,
311 "course_export_hide" =>
true,
312 "group_export_hide" =>
true,
313 "group" =>
"preferences"),
314 "mail_incoming_mail" => array(
315 "input" =>
"selection",
321 "required_hide" =>
true,
322 "visib_reg_hide" =>
true,
323 "course_export_hide" =>
true,
324 "group_export_hide" =>
true,
325 "export_hide" =>
true,
326 "search_hide" =>
true,
327 "group" =>
"settings")
336 $this->skip_groups = array();
337 $this->skip_fields = array();
346 foreach (self::$user_field as $f => $p)
349 if (in_array($p[
"group"], $this->skip_groups) ||
350 in_array($f, $this->skip_fields))
367 $settings = $ilSetting->getAll();
372 if($ilSetting->get(
'usr_settings_visib_lua_'.$field,1))
374 $fields[$field] = $info;
376 elseif($info[
'visib_lua_fix_value'])
378 $fields[$field] = $info;
390 $this->skip_groups[] = $a_group;
398 $this->skip_fields[] = $a_field;
409 if(self::$mode == self::MODE_REGISTRATION)
411 include_once
'Services/Registration/classes/class.ilRegistrationSettings.php';
414 self::$user_field[
"username"][
"group"] =
"login_data";
415 self::$user_field[
"password"][
"group"] =
"login_data";
416 self::$user_field[
"language"][
"default"] = $lng->lang_key;
419 $roles = self::$user_field[
"roles"];
420 unset(self::$user_field[
"roles"]);
421 self::$user_field[
"roles"] = $roles;
422 self::$user_field[
"roles"][
"group"] =
"settings";
427 $custom_fields_done =
false;
428 foreach ($fields as $f => $p)
431 if (($p[
"group"] != $current_group) &&
434 if (is_array($custom_fields) && !$custom_fields_done)
437 if($current_group ==
"other" || $p[
"group"] ==
"settings")
440 if($current_group !=
"other")
443 $sh->setTitle($lng->txt(
"other"));
444 $a_form->addItem($sh);
446 foreach($custom_fields as $custom_field)
448 $a_form->addItem($custom_field);
450 $custom_fields_done =
true;
455 $sh->setTitle($lng->txt($p[
"group"]));
456 $a_form->addItem($sh);
457 $current_group = $p[
"group"];
461 if (isset($p[
"method"]))
466 $lv = (isset($p[
"lang_var"]) && $p[
"lang_var"] !=
"")
478 $val->
setValue($a_user->getLogin());
480 $val->setMaxLength(32);
482 $val->setRequired(
true);
490 $val->
setValue($a_user->getLogin());
493 $a_form->addItem($val);
504 $ti->setMaxLength($p[
"maxlength"]);
505 $ti->setSize($p[
"size"]);
506 $ti->setRequired($ilSetting->get(
"require_".$f));
507 if(!$ti->getRequired() || $ti->getValue())
509 $ti->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
511 $a_form->addItem($ti);
518 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
524 $ci->setRequired($ilSetting->get(
"require_".$f));
525 if(!$ci->getRequired() || $ci->getValue())
527 $ci->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
529 $a_form->addItem($ci);
537 include_once
"./Services/Calendar/classes/class.ilDateTime.php";
539 if ($a_user && strlen($a_user->$m()))
544 $bi->setShowEmpty(
true);
545 $bi->setStartYear(1900);
546 $bi->setRequired($ilSetting->get(
"require_".$f));
547 if(!$bi->getRequired() || $date)
549 $bi->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
551 $a_form->addItem($bi);
563 foreach ($p[
"values"] as $k => $v)
568 $rg->setRequired($ilSetting->get(
"require_".$f));
569 if(!$rg->getRequired() || $rg->getValue())
571 $rg->
setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
573 $a_form->addItem($rg);
581 $ii->
setDisabled($ilSetting->get(
"usr_settings_disable_upload"));
583 $upload = $a_form->getFileUpload(
"userfile");
586 $ii->setPending($upload[
"name"]);
595 $ii->setAlt($lng->txt(
"personal_picture"));
599 $a_form->addItem($ii);
604 if(self::$mode == self::MODE_DESKTOP)
608 $global_roles = $rbacreview->getGlobalRoles();
609 foreach($global_roles as $role_id)
611 if (in_array($role_id,$rbacreview->assignedRoles($a_user->getId())))
613 $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
614 $role_names .= $roleObj->getTitle().
", ";
619 $dr->
setValue(substr($role_names,0,-2));
620 $a_form->addItem($dr);
623 else if(self::$mode == self::MODE_REGISTRATION)
625 if($registration_settings->roleSelectionEnabled())
627 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
631 $options[$role[
"id"]] = $role[
"title"];
640 $ta->setRequired($ilSetting->get(
"require_".$f));
641 if(!$ta->getRequired())
643 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
650 $ta->setValue(array_shift(array_keys(
$options)));
652 $a_form->addItem($ta);
666 $em->setRequired($ilSetting->get(
"require_".$f));
667 if(!$em->getRequired() || $em->getValue())
669 $em->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
671 if(self::MODE_REGISTRATION == self::$mode)
673 $em->setRetype(
true);
675 $a_form->addItem($em);
687 $ta->setRows($p[
"rows"]);
688 $ta->setCols($p[
"cols"]);
689 $ta->setRequired($ilSetting->get(
"require_".$f));
690 if(!$ta->getRequired() || $ta->getValue())
692 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
694 $a_form->addItem($ta);
701 $im_arr = $p[
"types"];
702 foreach ($im_arr as $im_name)
704 $im =
new ilTextInputGUI($lng->txt(
"im_".$im_name),
"usr_im_".$im_name);
707 $im->
setValue($a_user->getInstantMessengerId($im_name));
709 $im->setMaxLength($p[
"maxlength"]);
710 $im->setSize($p[
"size"]);
711 $im->setRequired($ilSetting->get(
"require_".
"instant_messengers"));
712 if(!$im->getRequired() || $im->getValue())
714 $im->setDisabled($ilSetting->get(
"usr_settings_disable_".
"instant_messengers"));
716 $a_form->addItem($im);
722 if (self::$mode == self::MODE_REGISTRATION)
724 if(!$registration_settings->passwordGenerationEnabled())
733 $ta->
setValue($lng->txt(
"reg_passwd_via_mail"));
735 $a_form->addItem($ta);
748 $lng->loadLanguageModule(
"meta");
749 foreach ($lng->getInstalledLanguages() as $lang_key)
751 $options[$lang_key] = $lng->txt(
"meta_l_".$lang_key);
755 $ta->setRequired($ilSetting->get(
"require_".$f));
756 if(!$ta->getRequired() || $ta->getValue())
758 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
760 $a_form->addItem($ta);
771 $ti->setValue($a_user->$m());
773 $ti->setMaxLength($p[
"maxlength"]);
774 $ti->setSize($p[
"size"]);
775 $ti->setRequired($ilSetting->get(
"require_".$f));
776 if(!$ti->getRequired() || $ti->getValue())
778 $ti->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
783 $ti->setDataSource($this->ajax_href.
"&f=".$f);
785 $a_form->addItem($ti);
792 if(is_array($custom_fields) && !$custom_fields_done)
795 if($current_group !=
"other")
798 $sh->setTitle($lng->txt(
"other"));
799 $a_form->addItem($sh);
801 foreach($custom_fields as $custom_field)
803 $a_form->addItem($custom_field);
810 $this->ajax_href = $a_href;
820 if(self::$mode == self::MODE_DESKTOP)
822 return ($ilSetting->get(
"usr_settings_hide_".$a_setting) != 1);
826 if(isset(self::$user_field[$a_setting][
"visib_reg_hide"]) && self::$user_field[$a_setting][
"visib_reg_hide"] ===
true)
830 return ($ilSetting->get(
"usr_settings_visib_reg_".$a_setting,
"1") || $ilSetting->get(
"require_".$a_setting,
"0"));
838 if(in_array(
$mode, array(self::MODE_DESKTOP, self::MODE_REGISTRATION)))
859 foreach(self::$user_field as $field => $definition)
862 if($a_personal_data_only && $ilSetting->get(
"usr_settings_hide_".$field))
867 if($ilSetting->get(
"require_".$field) && $definition[
"method"])
869 $value = $a_user->{$definition[
"method"]}();
880 $user_defined_data = $a_user->getUserDefinedData();
882 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
884 foreach($user_defined_fields->getRequiredDefinitions() as $field => $definition)
887 if($a_personal_data_only && !$definition[
"visible"])
892 if(!$user_defined_data[
"f_".$field])
912 protected static function isEditableByUser($setting)
922 if( $ilSetting->get(
'usr_settings_hide_'.$setting) == 1 ||
923 $ilSetting->get(
'usr_settings_disable_'.$setting) == 1 )
941 public static function getIgnorableRequiredSettings()
950 $ignorableSettings = array();
952 foreach(self::$user_field as $field => $definition)
955 if(
'username' == $field ||
956 'password' == $field )
962 if( !$ilSetting->get(
'require_'.$field) )
967 if( self::isEditableByUser($field) )
969 $ignorableSettings[] = $field;
973 return $ignorableSettings;