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";
396 if($registration_settings->registrationCodeRequired() ||
397 $registration_settings->getAllowCodes())
399 include_once
'Services/Registration/classes/class.ilRegistrationCode.php';
404 "required" => (
bool)$registration_settings->registrationCodeRequired(),
405 "group" =>
"login_data"
407 self::$user_field = array_merge(array(
"registration_code"=>$code), self::$user_field);
413 $custom_fields_done =
false;
414 foreach ($fields as
$f => $p)
417 if (($p[
"group"] != $current_group) &&
420 if (is_array($custom_fields) && !$custom_fields_done)
423 if($current_group ==
"other" || $p[
"group"] ==
"settings")
426 if($current_group !=
"other")
429 $sh->setTitle($lng->txt(
"other"));
430 $a_form->addItem($sh);
432 foreach($custom_fields as $custom_field)
434 $a_form->addItem($custom_field);
436 $custom_fields_done =
true;
441 $sh->setTitle($lng->txt($p[
"group"]));
442 $a_form->addItem($sh);
443 $current_group = $p[
"group"];
447 if (isset($p[
"method"]))
452 $lv = (isset($p[
"lang_var"]) && $p[
"lang_var"] !=
"")
464 $val->
setValue($a_user->getLogin());
466 $val->setMaxLength(32);
468 $val->setRequired(
true);
476 $val->
setValue($a_user->getLogin());
479 $a_form->addItem($val);
490 $ti->setMaxLength($p[
"maxlength"]);
491 $ti->setSize($p[
"size"]);
492 if(
$f ==
"registration_code")
494 $ti->setRequired($p[
'required']);
498 $ti->setRequired($ilSetting->get(
"require_".$f));
500 if(!$ti->getRequired())
502 $ti->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
504 $a_form->addItem($ti);
511 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
517 $ci->setRequired($ilSetting->get(
"require_".$f));
518 if(!$ci->getRequired())
520 $ci->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
522 $a_form->addItem($ci);
530 include_once
"./Services/Calendar/classes/class.ilDateTime.php";
531 if ($a_user && strlen($a_user->$m()))
536 $bi->setShowEmpty(
true);
537 $bi->setStartYear(1900);
538 $bi->setRequired($ilSetting->get(
"require_".$f));
539 if(!$bi->getRequired())
541 $bi->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
543 $a_form->addItem($bi);
555 foreach ($p[
"values"] as $k => $v)
560 $rg->setRequired($ilSetting->get(
"require_".$f));
561 if(!$rg->getRequired())
563 $rg->
setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
565 $a_form->addItem($rg);
575 $ii->setDisabled($ilSetting->get(
"usr_settings_disable_upload"));
579 $ii->setAlt($lng->txt(
"personal_picture"));
584 $ilSetting->get(
"ilinc_active"))
586 include_once (
'./Modules/ILinc/classes/class.ilObjiLincUser.php');
591 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
593 $ilincAPI->uploadPicture($ilinc_user);
594 $response = $ilincAPI->sendRequest(
"uploadPicture");
597 $url = trim($response->data[
'url'][
'cdata']);
599 $lng->txt(
"ilinc_upload_pic_text").
" ".
600 '<a href="'.$url.
'">'.$lng->txt(
"ilinc_upload_pic_linktext").
'</a>';
605 $a_form->addItem($ii);
610 if(self::$mode == self::MODE_DESKTOP)
614 $global_roles = $rbacreview->getGlobalRoles();
615 foreach($global_roles as $role_id)
617 if (in_array($role_id,$rbacreview->assignedRoles($a_user->getId())))
619 $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
620 $role_names .= $roleObj->getTitle().
", ";
625 $dr->
setValue(substr($role_names,0,-2));
626 $a_form->addItem($dr);
629 else if(self::$mode == self::MODE_REGISTRATION)
631 if($registration_settings->roleSelectionEnabled())
633 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
637 $options[$role[
"id"]] = $role[
"title"];
641 $ta->setRequired($ilSetting->get(
"require_".$f));
642 if(!$ta->getRequired())
644 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
646 $a_form->addItem($ta);
659 $em->setRequired($ilSetting->get(
"require_".$f));
660 if(!$em->getRequired())
662 $em->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
664 $a_form->addItem($em);
676 $ta->setRows($p[
"rows"]);
677 $ta->setCols($p[
"cols"]);
678 $ta->setRequired($ilSetting->get(
"require_".$f));
679 if(!$ta->getRequired())
681 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
683 $a_form->addItem($ta);
690 $im_arr = $p[
"types"];
691 foreach ($im_arr as $im_name)
693 $im =
new ilTextInputGUI($lng->txt(
"im_".$im_name),
"usr_im_".$im_name);
696 $im->
setValue($a_user->getInstantMessengerId($im_name));
698 $im->setMaxLength($p[
"maxlength"]);
699 $im->setSize($p[
"size"]);
700 $im->setRequired($ilSetting->get(
"require_".
"instant_messengers"));
701 if(!$im->getRequired())
703 $im->setDisabled($ilSetting->get(
"usr_settings_disable_".
"instant_messengers"));
705 $a_form->addItem($im);
711 if (self::$mode == self::MODE_REGISTRATION)
713 if(!$registration_settings->passwordGenerationEnabled())
722 $ta->
setValue($lng->txt(
"reg_passwd_via_mail"));
724 $a_form->addItem($ta);
737 foreach ($lng->getInstalledLanguages() as $lang_key)
739 $options[$lang_key] = $lng->txt(
"lang_".$lang_key);
741 $ta->setOptions($options);
742 $ta->setRequired($ilSetting->get(
"require_".$f));
743 if(!$ta->getRequired())
745 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
747 $a_form->addItem($ta);
754 if(is_array($custom_fields) && !$custom_fields_done)
757 if($current_group !=
"other")
760 $sh->setTitle($lng->txt(
"other"));
761 $a_form->addItem($sh);
763 foreach($custom_fields as $custom_field)
765 $a_form->addItem($custom_field);
778 if(self::$mode == self::MODE_DESKTOP)
780 return ($ilSetting->get(
"usr_settings_hide_".$a_setting) != 1);
784 if(isset(self::$user_field[$a_setting][
"visib_reg_hide"]) && self::$user_field[$a_setting][
"visib_reg_hide"] ===
true)
788 return ($ilSetting->get(
"usr_settings_visib_reg_".$a_setting,
"1") || $ilSetting->get(
"require_".$a_setting,
"0"));
796 if(in_array(
$mode, array(self::MODE_DESKTOP, self::MODE_REGISTRATION)))