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() || $ti->getValue())
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() || $ci->getValue())
520 $ci->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
522 $a_form->addItem($ci);
530 include_once
"./Services/Calendar/classes/class.ilDateTime.php";
532 if ($a_user && strlen($a_user->$m()))
537 $bi->setShowEmpty(
true);
538 $bi->setStartYear(1900);
539 $bi->setRequired($ilSetting->get(
"require_".$f));
540 if(!$bi->getRequired() || $date)
542 $bi->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
544 $a_form->addItem($bi);
556 foreach ($p[
"values"] as $k => $v)
561 $rg->setRequired($ilSetting->get(
"require_".$f));
562 if(!$rg->getRequired() || $rg->getValue())
564 $rg->
setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
566 $a_form->addItem($rg);
576 $ii->setDisabled($ilSetting->get(
"usr_settings_disable_upload"));
580 $ii->setAlt($lng->txt(
"personal_picture"));
585 $ilSetting->get(
"ilinc_active"))
587 include_once (
'./Modules/ILinc/classes/class.ilObjiLincUser.php');
592 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
594 $ilincAPI->uploadPicture($ilinc_user);
595 $response = $ilincAPI->sendRequest(
"uploadPicture");
598 $url = trim($response->data[
'url'][
'cdata']);
600 $lng->txt(
"ilinc_upload_pic_text").
" ".
601 '<a href="'.$url.
'">'.$lng->txt(
"ilinc_upload_pic_linktext").
'</a>';
606 $a_form->addItem($ii);
611 if(self::$mode == self::MODE_DESKTOP)
615 $global_roles = $rbacreview->getGlobalRoles();
616 foreach($global_roles as $role_id)
618 if (in_array($role_id,$rbacreview->assignedRoles($a_user->getId())))
620 $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
621 $role_names .= $roleObj->getTitle().
", ";
626 $dr->
setValue(substr($role_names,0,-2));
627 $a_form->addItem($dr);
630 else if(self::$mode == self::MODE_REGISTRATION)
632 if($registration_settings->roleSelectionEnabled())
634 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
638 $options[$role[
"id"]] = $role[
"title"];
642 $ta->setRequired($ilSetting->get(
"require_".$f));
643 if(!$ta->getRequired())
645 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
647 $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 foreach ($lng->getInstalledLanguages() as $lang_key)
740 $options[$lang_key] = $lng->txt(
"lang_".$lang_key);
742 $ta->setOptions($options);
743 $ta->setRequired($ilSetting->get(
"require_".$f));
744 if(!$ta->getRequired() || $ta->getValue())
746 $ta->setDisabled($ilSetting->get(
"usr_settings_disable_".$f));
748 $a_form->addItem($ta);
755 if(is_array($custom_fields) && !$custom_fields_done)
758 if($current_group !=
"other")
761 $sh->setTitle($lng->txt(
"other"));
762 $a_form->addItem($sh);
764 foreach($custom_fields as $custom_field)
766 $a_form->addItem($custom_field);
779 if(self::$mode == self::MODE_DESKTOP)
781 return ($ilSetting->get(
"usr_settings_hide_".$a_setting) != 1);
785 if(isset(self::$user_field[$a_setting][
"visib_reg_hide"]) && self::$user_field[$a_setting][
"visib_reg_hide"] ===
true)
789 return ($ilSetting->get(
"usr_settings_visib_reg_".$a_setting,
"1") || $ilSetting->get(
"require_".$a_setting,
"0"));
797 if(in_array(
$mode, array(self::MODE_DESKTOP, self::MODE_REGISTRATION)))