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 "group_export_hide" =>
true,
65 "group" =>
"personal_data"),
70 "method" =>
"getFirstname",
71 "required_fix_value" => 1,
72 "visib_reg_fix_value" => 1,
73 'visib_lua_fix_value' => 1,
74 "course_export_fix_value" => 1,
75 "group_export_fix_value" => 1,
76 "group" =>
"personal_data"),
81 "method" =>
"getLastname",
82 "required_fix_value" => 1,
83 "visib_reg_fix_value" => 1,
84 'visib_lua_fix_value' => 1,
85 "course_export_fix_value" => 1,
86 "group_export_fix_value" => 1,
87 "group" =>
"personal_data"),
90 "lang_var" =>
"person_title",
93 "method" =>
"getUTitle",
94 "group" =>
"personal_data"),
96 "input" =>
"birthday",
97 "lang_var" =>
"birthday",
100 "method" =>
"getBirthday",
101 "group" =>
"personal_data"),
104 "values" => array(
"f" =>
"gender_f",
"m" =>
"gender_m"),
105 "method" =>
"getGender",
106 "group" =>
"personal_data"),
108 "input" =>
"picture",
109 "required_hide" =>
true,
110 "visib_reg_hide" =>
true,
111 "course_export_hide" =>
true,
112 "group_export_hide" =>
true,
113 "lists_hide" =>
true,
114 "lang_var" =>
"personal_picture",
115 "group" =>
"personal_data"),
118 "changeable_hide" =>
true,
119 "required_hide" =>
true,
120 "visib_reg_hide" =>
true,
121 "export_hide" =>
true,
122 "course_export_hide" =>
true,
123 "lists_hide" =>
true,
124 "group" =>
"personal_data"),
125 "institution" => array(
129 "method" =>
"getInstitution",
130 "group" =>
"contact_data"),
131 "department" => array(
135 "method" =>
"getDepartment",
136 "group" =>
"contact_data"),
141 "method" =>
"getStreet",
142 "group" =>
"contact_data"),
147 "method" =>
"getZipcode",
148 "group" =>
"contact_data"),
153 "method" =>
"getCity",
154 "group" =>
"contact_data"),
159 "method" =>
"getCountry",
160 "group" =>
"contact_data"),
161 "sel_country" => array(
162 "input" =>
"sel_country",
163 "method" =>
"getSelectedCountry",
164 "group" =>
"contact_data"),
165 "phone_office" => array(
169 "method" =>
"getPhoneOffice",
170 "group" =>
"contact_data"),
171 "phone_home" => array(
175 "method" =>
"getPhoneHome",
176 "group" =>
"contact_data"),
177 "phone_mobile" => array(
181 "method" =>
"getPhoneMobile",
182 "group" =>
"contact_data"),
187 "method" =>
"getFax",
188 "group" =>
"contact_data"),
193 "method" =>
"getEmail",
194 "group" =>
"contact_data"),
196 "input" =>
"textarea",
199 "method" =>
"getHobby",
200 "lists_hide" =>
true,
201 "group" =>
"contact_data"),
202 "referral_comment" => array(
203 "input" =>
"textarea",
206 "method" =>
"getComment",
207 "course_export_hide" =>
true,
208 "group_export_hide" =>
true,
209 "lists_hide" =>
true,
210 "group" =>
"contact_data"),
211 "instant_messengers" => array(
212 "input" =>
"messenger",
213 "types" => array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip"),
216 "course_export_hide" =>
true,
217 "group_export_hide" =>
true,
218 "lists_hide" =>
true,
219 "group" =>
"instant_messengers"),
220 "matriculation" => array(
224 "method" =>
"getMatriculation",
226 "delicious" => array(
230 "method" =>
"getDelicious",
233 "input" =>
"language",
234 "method" =>
"getLanguage",
235 "required_hide" =>
true,
236 "visib_reg_hide" =>
true,
237 "course_export_hide" =>
true,
238 "group_export_hide" =>
true,
239 "group" =>
"settings"),
240 "skin_style" => array(
241 "input" =>
"skinstyle",
242 "required_hide" =>
true,
243 "visib_reg_hide" =>
true,
244 "course_export_hide" =>
true,
245 "group_export_hide" =>
true,
246 "group" =>
"settings"),
247 "hits_per_page" => array(
248 "input" =>
"hitsperpage",
251 10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
252 50 => 50, 100 => 100, 9999 => 9999),
253 "required_hide" =>
true,
254 "visib_reg_hide" =>
true,
255 "course_export_hide" =>
true,
256 "group_export_hide" =>
true,
257 "group" =>
"settings"),
258 "show_users_online" => array(
259 "input" =>
"selection",
262 "y" =>
"users_online_show_short_y",
263 "associated" =>
"users_online_show_short_associated",
264 "n" =>
"users_online_show_short_n"),
265 "required_hide" =>
true,
266 "visib_reg_hide" =>
true,
267 "course_export_hide" =>
true,
268 "group_export_hide" =>
true,
269 "group" =>
"settings"),
270 "hide_own_online_status" => array(
271 "input" =>
"selection",
272 "required_hide" =>
true,
273 "visib_reg_hide" =>
true,
274 "course_export_hide" =>
true,
275 "group_export_hide" =>
true,
276 "group" =>
"settings"),
277 "preferences" => array(
278 "visible_fix_value" => 1,
279 "changeable_fix_value" => 1,
280 "required_hide" =>
true,
281 "visib_reg_hide" =>
true,
282 "course_export_hide" =>
true,
283 "group_export_hide" =>
true,
284 "group" =>
"preferences"),
285 "mail_incoming_mail" => array(
286 "input" =>
"selection",
292 "required_hide" =>
true,
293 "visib_reg_hide" =>
true,
294 "course_export_hide" =>
true,
295 "group_export_hide" =>
true,
296 "export_hide" =>
true,
297 "search_hide" =>
true,
298 "group" =>
"settings")
307 $this->skip_groups = array();
308 $this->skip_fields = array();
317 foreach (self::$user_field as $f => $p)
320 if (in_array($p[
"group"], $this->skip_groups) ||
321 in_array($f, $this->skip_fields))
338 $settings = $ilSetting->getAll();
343 if($ilSetting->get(
'usr_settings_visib_lua_'.$field,1))
345 $fields[$field] = $info;
347 elseif($info[
'visib_lua_fix_value'])
349 $fields[$field] = $info;
361 $this->skip_groups[] = $a_group;
369 $this->skip_fields[] = $a_field;
380 if(self::$mode == self::MODE_REGISTRATION)
382 include_once
'Services/Registration/classes/class.ilRegistrationSettings.php';
385 self::$user_field[
"username"][
"group"] =
"login_data";
386 self::$user_field[
"password"][
"group"] =
"login_data";
387 self::$user_field[
"language"][
"default"] = $lng->lang_key;
390 $roles = self::$user_field[
"roles"];
391 unset(self::$user_field[
"roles"]);
392 self::$user_field[
"roles"] = $roles;
393 self::$user_field[
"roles"][
"group"] =
"settings";
398 $custom_fields_done =
false;
399 foreach ($fields as $f => $p)
402 if (($p[
"group"] != $current_group) &&
405 if (is_array($custom_fields) && !$custom_fields_done)
408 if($current_group ==
"other" || $p[
"group"] ==
"settings")
411 if($current_group !=
"other")
414 $sh->setTitle($lng->txt(
"other"));
415 $a_form->addItem($sh);
417 foreach($custom_fields as $custom_field)
419 $a_form->addItem($custom_field);
421 $custom_fields_done =
true;
426 $sh->setTitle($lng->txt($p[
"group"]));
427 $a_form->addItem($sh);
428 $current_group = $p[
"group"];
432 if (isset($p[
"method"]))
437 $lv = (isset($p[
"lang_var"]) && $p[
"lang_var"] !=
"")
449 $val->
setValue($a_user->getLogin());
451 $val->setMaxLength(32);
453 $val->setRequired(
true);
461 $val->
setValue($a_user->getLogin());
464 $a_form->addItem($val);
475 $ti->setMaxLength($p[
"maxlength"]);
476 $ti->setSize($p[
"size"]);
477 $ti->setRequired($ilSetting->get(
"require_".$f));
478 if(!$ti->getRequired() || $ti->getValue())
480 $ti->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
482 $a_form->addItem($ti);
489 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
495 $ci->setRequired($ilSetting->get(
"require_".$f));
496 if(!$ci->getRequired() || $ci->getValue())
498 $ci->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
500 $a_form->addItem($ci);
508 include_once
"./Services/Calendar/classes/class.ilDateTime.php";
510 if ($a_user && strlen($a_user->$m()))
515 $bi->setShowEmpty(
true);
516 $bi->setStartYear(1900);
517 $bi->setRequired($ilSetting->get(
"require_".$f));
518 if(!$bi->getRequired() || $date)
520 $bi->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
522 $a_form->addItem($bi);
534 foreach ($p[
"values"] as $k => $v)
539 $rg->setRequired($ilSetting->get(
"require_".$f));
540 if(!$rg->getRequired() || $rg->getValue())
542 $rg->
setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
544 $a_form->addItem($rg);
552 $ii->
setDisabled($ilSetting->get(
"usr_settings_disable_upload"));
554 $upload = $a_form->getFileUpload(
"userfile");
557 $ii->setPending($upload[
"name"]);
566 $ii->setAlt($lng->txt(
"personal_picture"));
572 $ilSetting->get(
"ilinc_active"))
574 include_once (
'./Modules/ILinc/classes/class.ilObjiLincUser.php');
579 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
581 $ilincAPI->uploadPicture($ilinc_user);
582 $response = $ilincAPI->sendRequest(
"uploadPicture");
585 $url = trim($response->data[
'url'][
'cdata']);
587 $lng->txt(
"ilinc_upload_pic_text").
" ".
588 '<a href="'.$url.
'">'.$lng->txt(
"ilinc_upload_pic_linktext").
'</a>';
593 $a_form->addItem($ii);
598 if(self::$mode == self::MODE_DESKTOP)
602 $global_roles = $rbacreview->getGlobalRoles();
603 foreach($global_roles as $role_id)
605 if (in_array($role_id,$rbacreview->assignedRoles($a_user->getId())))
607 $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
608 $role_names .= $roleObj->getTitle().
", ";
613 $dr->
setValue(substr($role_names,0,-2));
614 $a_form->addItem($dr);
617 else if(self::$mode == self::MODE_REGISTRATION)
619 if($registration_settings->roleSelectionEnabled())
621 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
625 $options[$role[
"id"]] = $role[
"title"];
630 if(
sizeof($options) > 1)
634 $ta->setRequired($ilSetting->get(
"require_".$f));
635 if(!$ta->getRequired())
637 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
644 $ta->setValue(array_shift(array_keys($options)));
646 $a_form->addItem($ta);
660 $em->setRequired($ilSetting->get(
"require_".$f));
661 if(!$em->getRequired() || $em->getValue())
663 $em->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
665 $a_form->addItem($em);
677 $ta->setRows($p[
"rows"]);
678 $ta->setCols($p[
"cols"]);
679 $ta->setRequired($ilSetting->get(
"require_".$f));
680 if(!$ta->getRequired() || $ta->getValue())
682 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
684 $a_form->addItem($ta);
691 $im_arr = $p[
"types"];
692 foreach ($im_arr as $im_name)
694 $im =
new ilTextInputGUI($lng->txt(
"im_".$im_name),
"usr_im_".$im_name);
697 $im->
setValue($a_user->getInstantMessengerId($im_name));
699 $im->setMaxLength($p[
"maxlength"]);
700 $im->setSize($p[
"size"]);
701 $im->setRequired($ilSetting->get(
"require_".
"instant_messengers"));
702 if(!$im->getRequired() || $im->getValue())
704 $im->setDisabled($ilSetting->get(
"usr_settings_disable_".
"instant_messengers"));
706 $a_form->addItem($im);
712 if (self::$mode == self::MODE_REGISTRATION)
714 if(!$registration_settings->passwordGenerationEnabled())
723 $ta->
setValue($lng->txt(
"reg_passwd_via_mail"));
725 $a_form->addItem($ta);
738 $lng->loadLanguageModule(
"meta");
739 foreach ($lng->getInstalledLanguages() as $lang_key)
741 $options[$lang_key] = $lng->txt(
"meta_l_".$lang_key);
743 $ta->setOptions($options);
745 $ta->setRequired($ilSetting->get(
"require_".$f));
746 if(!$ta->getRequired() || $ta->getValue())
748 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
750 $a_form->addItem($ta);
757 if(is_array($custom_fields) && !$custom_fields_done)
760 if($current_group !=
"other")
763 $sh->setTitle($lng->txt(
"other"));
764 $a_form->addItem($sh);
766 foreach($custom_fields as $custom_field)
768 $a_form->addItem($custom_field);
781 if(self::$mode == self::MODE_DESKTOP)
783 return ($ilSetting->get(
"usr_settings_hide_".$a_setting) != 1);
787 if(isset(self::$user_field[$a_setting][
"visib_reg_hide"]) && self::$user_field[$a_setting][
"visib_reg_hide"] ===
true)
791 return ($ilSetting->get(
"usr_settings_visib_reg_".$a_setting,
"1") || $ilSetting->get(
"require_".$a_setting,
"0"));
799 if(in_array(
$mode, array(self::MODE_DESKTOP, self::MODE_REGISTRATION)))
820 foreach(self::$user_field as $field => $definition)
823 if($a_personal_data_only && $ilSetting->get(
"usr_settings_hide_".$field))
828 if($ilSetting->get(
"require_".$field) && $definition[
"method"])
830 $value = $a_user->{$definition[
"method"]}();
841 $user_defined_data = $a_user->getUserDefinedData();
843 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
845 foreach($user_defined_fields->getRequiredDefinitions() as $field => $definition)
848 if($a_personal_data_only && !$definition[
"visible"])
853 if(!$user_defined_data[
"f_".$field])
873 protected static function isEditableByUser($setting)
883 if( $ilSetting->get(
'usr_settings_hide_'.$setting) == 1 ||
884 $ilSetting->get(
'usr_settings_disable_'.$setting) == 1 )
902 public static function getIgnorableRequiredSettings()
911 $ignorableSettings = array();
913 foreach(self::$user_field as $field => $definition)
916 if(
'username' == $field ||
917 'password' == $field )
923 if( !$ilSetting->get(
'require_'.$field) )
928 if( self::isEditableByUser($field) )
930 $ignorableSettings[] = $field;
934 return $ignorableSettings;