31                 include_once 
'./Services/User/classes/class.ilUserDefinedFields.php';
 
   38                 $this->settings = $ilias->getAllSettings();
 
   39                 $lng->loadLanguageModule(
"jsmath");
 
   40                 $this->upload_error = 
"";
 
   41                 $this->password_error = 
"";
 
   42                 $lng->loadLanguageModule(
"user");
 
   43                 $ilCtrl->saveParameter($this, 
"user_page");
 
   53                 $next_class = $this->ctrl->getNextClass();
 
   57                         case "ilpublicuserprofilegui":
 
   58                                 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
 
   60                                 $ilCtrl->forwardCommand($pub_profile_gui);
 
   64                         case 'ilextpublicprofilepagegui':
 
   66                                 $ilTabs->clearTargets();
 
   67                                 $ilTabs->setBackTarget($lng->txt(
"back"),
 
   68                                         $ilCtrl->getLinkTarget($this, 
"showExtendedProfile"));
 
   69                                 include_once(
"./Services/User/classes/class.ilExtPublicProfilePageGUI.php");
 
   71                                 $tpl->setCurrentBlock(
"ContentStyle");
 
   72                                 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
   74                                 $tpl->parseCurrentBlock();
 
   75                                 $ret = $this->ctrl->forwardCommand($page_gui);
 
   78                                         $tpl->setContent(
$ret);
 
   87                                 $cmd = $this->ctrl->getCmd(
"showPersonalData");
 
   91                                 if( $ilUser->isPasswordChangeDemanded() && 
$cmd != 
'savePassword' )
 
   93                                         $cmd = 
'showPassword';
 
   96                                                 $this->lng->txt(
'password_change_on_first_login_demand'), true
 
   99                                 elseif( $ilUser->isPasswordExpired() && 
$cmd != 
'savePassword' )
 
  101                                         $cmd = 
'showPassword';
 
  103                                         $msg = $this->lng->txt(
'password_expired');
 
  104                                         $password_age = $ilUser->getPasswordAge();
 
  123                 if ($this->settings[
"usr_settings_hide_".$setting] == 1)
 
  127                 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
 
  141                 if (isset($this->settings[
"usr_settings_hide_".$setting]) &&
 
  142                         $this->settings[
"usr_settings_hide_".$setting] == 1)
 
  156                 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
 
  172                         $userfile_input = $this->form->getItemByPostVar(
"userfile");
 
  174                         if ($_FILES[
"userfile"][
"tmp_name"] == 
"")
 
  176                                 if ($userfile_input->getDeletionFlag())
 
  178                                         $ilUser->removeUserPicture();
 
  183                         if ($_FILES[
"userfile"][
"size"] != 0)
 
  186                                 $image_dir = $webspace_dir.
"/usr_images";
 
  187                                 $store_file = 
"usr_".$ilUser->getID().
".".
"jpg";
 
  190                                 $ilUser->setPref(
"profile_image", $store_file);
 
  194                                 $uploaded_file = $image_dir.
"/upload_".$ilUser->getId().
"pic";
 
  197                                         $uploaded_file, 
false))
 
  200                                         $this->ctrl->redirect($this, 
"showProfile");
 
  202                                 chmod($uploaded_file, 0770);
 
  206                                 $show_file  = 
"$image_dir/usr_".$ilUser->getId().
".jpg";
 
  207                                 $thumb_file = 
"$image_dir/usr_".$ilUser->getId().
"_small.jpg";
 
  208                                 $xthumb_file = 
"$image_dir/usr_".$ilUser->getId().
"_xsmall.jpg";
 
  209                                 $xxthumb_file = 
"$image_dir/usr_".$ilUser->getId().
"_xxsmall.jpg";
 
  215                                 ilUtil::execConvert($uploaded_file . 
"[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
 
  216                                 ilUtil::execConvert($uploaded_file . 
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
 
  217                                 ilUtil::execConvert($uploaded_file . 
"[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
 
  218                                 ilUtil::execConvert($uploaded_file . 
"[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
 
  232                 $ilUser->removeUserPicture();
 
  263                 if ($ilUser->getAuthMode(
true) != 
AUTH_LOCAL &&
 
  264                         ($ilUser->getAuthMode(
true) != 
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
 
  265                         ($ilUser->getAuthMode(
true) != 
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
 
  266                         ($ilUser->getAuthMode(
true) != 
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local"))
 
  269                         $this->password_error = $this->lng->txt(
"not_changeable_for_non_local_auth");
 
  273                 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1)
 
  278                         if ($ilUser->getAuthMode(
true) != 
AUTH_SHIBBOLETH || ! $ilSetting->get(
"shib_auth_allow_local"))
 
  281                                 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
 
  283                                         $this->password_error = $this->lng->txt(
"passwd_wrong");
 
  289                                 $this->password_error = $this->lng->txt(
"passwd_not_selected");
 
  292                         if (empty($this->password_error))
 
  295                                 $ilUser->updatePassword(
$_POST[
"current_password"], 
$_POST[
"new_passwd"], 
$_POST[
"new_passwd"]);
 
  301                         if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
 
  303                                 $this->password_error = $this->lng->txt(
"passwd_wrong");
 
  306                         else if (
$_POST[
"desired_password"] != 
$_POST[
"retype_password"])
 
  308                                 $this->password_error = $this->lng->txt(
"passwd_not_match");
 
  313                                 if( $custom_error != 
'' )
 
  314                                                 $this->password_error = $custom_error;
 
  315                                 else    $this->password_error = $this->lng->txt(
"passwd_invalid");
 
  317                         else if (
$_POST[
"current_password"] != 
"" and empty($this->password_error))
 
  319                                 if( $ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded() )
 
  321                                         if( 
$_POST[
"current_password"] != 
$_POST[
"desired_password"] )
 
  323                                                 if( $ilUser->updatePassword(
$_POST[
"current_password"], 
$_POST[
"desired_password"], 
$_POST[
"retype_password"]) )
 
  326                                                         $ilUser->setLastPasswordChangeToNow();
 
  331                                                 $this->password_error = $this->lng->txt(
"new_pass_equals_old_pass");
 
  337                                         $ilUser->updatePassword(
$_POST[
"current_password"], 
$_POST[
"desired_password"], 
$_POST[
"retype_password"]);
 
  338                                         $ilUser->setLastPasswordChangeToNow();
 
  362                 if ((
$_POST[
"chk_pub"])==
"on")
 
  364                         $ilUser->setPref(
"public_profile",
"y");
 
  368                         $ilUser->setPref(
"public_profile",
"n");
 
  372                 $val_array = array(
"institution", 
"department", 
"upload", 
"street",
 
  373                         "zip", 
"city", 
"country", 
"phone_office", 
"phone_home", 
"phone_mobile",
 
  374                         "fax", 
"email", 
"hobby", 
"matriculation");
 
  377                 foreach($val_array as $key => $value)
 
  379                         if ((
$_POST[
"chk_".$value]) == 
"on")
 
  381                                 $ilUser->setPref(
"public_".$value,
"y");
 
  385                                 $ilUser->setPref(
"public_".$value,
"n");
 
  390                 if ($d_set->get(
"user_profile"))
 
  392                         if ((
$_POST[
"chk_delicious"]) == 
"on")
 
  394                                 $ilUser->setPref(
"public_delicious",
"y");
 
  398                                 $ilUser->setPref(
"public_delicious",
"n");
 
  404                 foreach($this->settings as $key => $val)
 
  406                         if (substr($key,0,8) == 
"require_")
 
  408                                 $require_keys[] = substr($key,8);
 
  412                 foreach($require_keys as $key => $val)
 
  415                         $system_fields = array(
"login", 
"default_role", 
"passwd", 
"passwd2");
 
  416                         if (!in_array($val, $system_fields))
 
  420                                         if (isset($this->settings[
"require_" . $val]) && $this->settings[
"require_" . $val])
 
  422                                                 if (empty(
$_POST[
"usr_" . $val]))
 
  424                                                         ilUtil::sendFailure($this->lng->txt(
"fill_out_all_required_fields") . 
": " . $this->lng->txt($val));
 
  460                         $ilUser->setGender(
$_POST[
"usr_gender"]);
 
  466                 $ilUser->setFullname();
 
  526                 if ($d_set->get(
"user_profile"))
 
  544                 $ilUser->setUserDefinedData(
$_POST[
'udf']);
 
  555                                 if (
$_POST[
"usr_skin_style"] != 
"")
 
  557                                         $sknst = explode(
":", 
$_POST[
"usr_skin_style"]);
 
  559                                         if ($ilUser->getPref(
"style") != $sknst[1] ||
 
  560                                                 $ilUser->getPref(
"skin") != $sknst[0])
 
  562                                                 $ilUser->setPref(
"skin", $sknst[0]);
 
  563                                                 $ilUser->setPref(
"style", $sknst[1]);
 
  574                                 if (
$_POST[
"usr_language"] != $ilUser->getLanguage())
 
  580                                 $ilUser->setLanguage(
$_POST[
"usr_language"]);
 
  586                                 if (
$_POST[
"hits_per_page"] != 
"")
 
  588                                         $ilUser->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
 
  595                                 $ilUser->setPref(
"show_users_online", 
$_POST[
"show_users_online"]);
 
  601                                 if (
$_POST[
"chk_hide_own_online_status"] != 
"")
 
  603                                         $ilUser->setPref(
"hide_own_online_status",
"y");
 
  607                                         $ilUser->setPref(
"hide_own_online_status",
"n");
 
  624                         $ilUser->setProfileIncomplete(
false);
 
  627                         $ilUser->setTitle($ilUser->getFullname());
 
  628                         $ilUser->setDescription($ilUser->getEmail());
 
  634                         if (!empty($this->password_error))
 
  638                         elseif (!empty($this->upload_error))
 
  646                                 $this->ctrl->redirect($this, 
"");
 
  679                 $lng->loadLanguageModule(
'mail');
 
  682                 $ilTabs->setSubTabActive(
'mail_settings');
 
  688                 $this->tpl->setTitle($lng->txt(
'personal_desktop'));
 
  690                 require_once 
'Services/Mail/classes/class.ilMailOptions.php';
 
  692                 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') != 
'1' && 
 
  693                    $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') != 
'1')
 
  695                         $incoming_type = (int)
$_POST[
'incoming_type'];
 
  699                         $incoming_type = $mailOptions->getIncomingType();
 
  703                 if($this->form->checkInput())
 
  705                         $mailOptions->updateOptions(
 
  709                                 (
int)$_POST[
'cronjob_notification']
 
  715                 if(!isset(
$_POST[
'incoming_type']))
 
  717                         $_POST[
'incoming_type'] = $mailOptions->getIncomingType();
 
  720                 $this->form->setValuesByPost();
 
  722                 $this->tpl->setContent($this->form->getHTML());
 
  736                 include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  739                 $this->form->setFormAction($ilCtrl->getFormAction($this, 
'saveMailOptions'));
 
  740                 $this->form->setTitle($lng->txt(
'mail_settings'));
 
  743                 include_once 
'Services/Mail/classes/class.ilMailOptions.php';
 
  744                 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') != 
'1')
 
  754                            $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') == 
'1')
 
  756                                 $si->setDisabled(
true); 
 
  758                         $this->form->addItem($si);
 
  763                 for($i = 50; $i <= 80; $i++)
 
  769                 $this->form->addItem($si);
 
  775                 $this->form->addItem($ta);
 
  778                 if($ilSetting->get(
'mail_notification'))
 
  780                         $cb = 
new ilCheckboxInputGUI($lng->txt(
'cron_mail_notification'), 
'cronjob_notification');                      
 
  781                         $cb->
setInfo($lng->txt(
'mail_cronjob_notification_info'));
 
  783                         $this->form->addItem($cb);
 
  786                 $this->form->addCommandButton(
'saveMailOptions', $lng->txt(
'save'));
 
  799                 require_once 
'Services/Mail/classes/class.ilMailOptions.php';
 
  803                         'linebreak' => $mailOptions->getLinebreak(),
 
  804                         'signature' => $mailOptions->getSignature(),
 
  805                         'cronjob_notification' => $mailOptions->getCronjobNotification()
 
  808                 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') != 
'1')
 
  813                 $this->form->setValuesByArray($data);
 
  824                 global $ilTabs, 
$lng;
 
  826                 $lng->loadLanguageModule(
'mail');
 
  829                 $ilTabs->setSubTabActive(
'mail_settings');
 
  835                 $this->tpl->setTitle($lng->txt(
'personal_desktop'));
 
  840                 $this->tpl->setContent($this->form->getHTML());
 
  851                 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"personal_desktop"));
 
  853                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  855                 $form->setFormAction($ilCtrl->getFormAction($this));
 
  856                 $form->setTitle($lng->txt(
"jsmath_settings"));
 
  859                 include_once 
"./Services/Administration/classes/class.ilSetting.php";
 
  860                 $jsMathSetting = 
new ilSetting(
"jsMath");
 
  862                 $checked = ($ilUser->getPref(
"js_math") === FALSE) ? $jsMathSetting->get(
"makedefault") : $ilUser->getPref(
"js_math");
 
  864                 $enable->setInfo($lng->txt(
"jsmath_enable_user_desc"));
 
  865                 $form->addItem($enable);
 
  867                 $form->addCommandButton(
"savejsMath", $lng->txt(
"save"));
 
  868                 $form->addCommandButton(
"showjsMath", $lng->txt(
"cancel"));
 
  870                 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
 
  878                 include_once 
"./Services/Administration/classes/class.ilSetting.php";
 
  879                 $jsMathSetting = 
new ilSetting(
"jsMath");
 
  880                 if ($jsMathSetting->get(
"enable"))
 
  884                                 $ilUser->writePref(
"js_math", 
"1");
 
  888                                 $ilUser->writePref(
"js_math", 
"0");
 
  891                 $ilCtrl->redirect($this, 
"showjsMath");
 
  898                 $lng->loadLanguageModule(
"gmaps");
 
  901                 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
 
  909                 $latitude = $ilUser->getLatitude();
 
  910                 $longitude = $ilUser->getLongitude();
 
  911                 $zoom = $ilUser->getLocationZoom();
 
  914                 if ($latitude == 0 && $longitude == 0 && $zoom == 0)
 
  917                         $latitude = $def[
"latitude"];
 
  918                         $longitude = $def[
"longitude"];
 
  919                         $zoom =  $def[
"zoom"];
 
  924                 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"personal_desktop"));
 
  926                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  928                 $form->setFormAction($ilCtrl->getFormAction($this));
 
  930                 $form->setTitle($this->lng->txt(
"location").
" ".
 
  931                         strtolower($this->lng->txt(
"of")).
" ".$ilUser->getFullname());
 
  937                 $public->setInfo($this->lng->txt(
"gmaps_public_profile_info"));
 
  938                 $public->setChecked($ilUser->getPref(
"public_location"));
 
  939                 $form->addItem($public);
 
  945                 $loc_prop->setLongitude($longitude);
 
  946                 $loc_prop->setZoom($zoom);
 
  948                 $street = $ilUser->getStreet();
 
  951                         $street = $this->lng->txt(
"street");
 
  954                 $city = $ilUser->getCity();
 
  957                         $city = $this->lng->txt(
"city");
 
  960                 $country = $ilUser->getCountry();
 
  963                         $country = $this->lng->txt(
"country");
 
  966                 $loc_prop->setAddress($street.
",".$city.
",".$country);
 
  968                 $form->addItem($loc_prop);
 
  970                 $form->addCommandButton(
"saveLocation", $this->lng->txt(
"save"));
 
  972                 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
 
  980                 $ilUser->writePref(
"public_location", 
$_POST[
"public_location"]);
 
  988                 $ilCtrl->redirect($this, 
"showLocation");
 
  996                 $showProfile = ($a_cmd == 
'showProfile') ? 
true : 
false;
 
  997                 $showPersonalData = ($a_cmd == 
'showPersonalData') ? 
true : 
false;
 
  998                 $showPublicProfile = ($a_cmd == 
'showPublicProfile') ? 
true : 
false;
 
  999                 $showPassword = ($a_cmd == 
'showPassword') ? 
true : 
false;
 
 1000                 $showGeneralSettings = ($a_cmd == 
'showGeneralSettings') ? 
true : 
false;
 
 1001                 $showMailOptions = ($a_cmd == 
'showMailOptions') ? 
true : 
false;
 
 1002                 $showLocation = ($a_cmd == 
'showLocation') ? 
true : 
false;
 
 1003                 $showjsMath = ($a_cmd == 
'showjsMath') ? 
true : 
false;
 
 1004                 $showChatOptions = ($a_cmd == 
'showChatOptions') ? 
true : 
false;
 
 1013                 $ilTabs->addSubTabTarget(
"personal_data", $this->ctrl->getLinkTarget($this, 
"showPersonalData"));
 
 1016                 $ilTabs->addSubTabTarget(
"public_profile", $this->ctrl->getLinkTarget($this, 
"showPublicProfile"));
 
 1018                 if ($ilSetting->get(
'user_ext_profiles'))
 
 1020                         $ilTabs->addSubTabTarget(
"user_ext_profile",
 
 1021                                 $this->ctrl->getLinkTarget($this, 
"showExtendedProfile"));
 
 1027                         $ilTabs->addSubTabTarget(
"password", $this->ctrl->getLinkTarget($this, 
"showPassword"),
 
 1028                                 "", 
"", 
"", $showPassword);
 
 1032                 $ilTabs->addSubTabTarget(
"general_settings", $this->ctrl->getLinkTarget($this, 
"showGeneralSettings"),
 
 1033                         "", 
"", 
"", $showGeneralSettings);
 
 1037                 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
 
 1040                         $ilTabs->addSubTabTarget(
"location", $this->ctrl->getLinkTarget($this, 
"showLocation"),
 
 1041                                                                  "", 
"", 
"", $showLocation);
 
 1044                 $ilTabs->addSubTabTarget(
"mail_settings", $this->ctrl->getLinkTarget($this, 
"showMailOptions"),
 
 1045                                                                  "", 
"", 
"", $showMailOptions);         
 
 1047                 if(((
int)$ilSetting->get(
'chat_sound_status') &&
 
 1048                     ((int)$ilSetting->get(
'chat_new_invitation_sound_status') || 
 
 1049                      (int)$ilSetting->get(
'chat_new_message_sound_status'))) ||
 
 1050                    (int)$ilSetting->get(
'chat_message_notify_status') == 1)
 
 1052                         $ilTabs->addSubTabTarget(
"chat_settings", $this->ctrl->getLinkTarget($this, 
"showChatOptions"),
 
 1053                                                                                  "", 
"", 
"", $showChatOptions);
 
 1056                 include_once 
"./Services/Administration/classes/class.ilSetting.php";
 
 1057                 $jsMathSetting = 
new ilSetting(
"jsMath");
 
 1058                 if ($jsMathSetting->get(
"enable"))
 
 1060                         $ilTabs->addSubTabTarget(
"jsmath_extt_jsmath", $this->ctrl->getLinkTarget($this, 
"showjsMath"),
 
 1061                                                                          "", 
"", 
"", $showjsMath);
 
 1069                 if($this->
userSettingVisible(
"matriculation") or count($this->user_defined_fields->getVisibleDefinitions())
 
 1070                         or $d_set->get(
"user_profile") == 
"1")
 
 1081                 $user_defined_data = $ilUser->getUserDefinedData();
 
 1082                 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
 
 1086                                 $this->tpl->setCurrentBlock(
"field_text");
 
 1088                                 if(!$definition[
'changeable'])
 
 1090                                         $this->tpl->setVariable(
"DISABLED_FIELD",
'disabled=\"disabled\"');
 
 1091                                         $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
 
 1095                                         $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
 
 1097                                 $this->tpl->parseCurrentBlock();
 
 1101                                 if($definition[
'changeable'])
 
 1103                                         $name = 
'udf['.$definition[
'field_id'].
']';
 
 1111                                 $this->tpl->setCurrentBlock(
"field_select");
 
 1112                                 $this->tpl->setVariable(
"SELECT_BOX",
ilUtil::formSelect($user_defined_data[$field_id],
 
 1114                                                                                                                                                 $this->user_defined_fields->fieldValuesToSelectArray(
 
 1115                                                                                                                                                         $definition[
'field_values']),
 
 1117                                                                                                                                                 true,0,
'',
'',$disabled));
 
 1118                                 $this->tpl->parseCurrentBlock();
 
 1120                         $this->tpl->setCurrentBlock(
"user_defined");
 
 1122                         if($definition[
'required'])
 
 1124                                 $name = $definition[
'field_name'].
"<span class=\"asterisk\">*</span>";
 
 1128                                 $name = $definition[
'field_name'];
 
 1130                         $this->tpl->setVariable(
"TXT_FIELD_NAME",$name);
 
 1131                         $this->tpl->parseCurrentBlock();
 
 1138                 foreach($this->user_defined_fields->getVisibleDefinitions() as $definition)
 
 1140                         $field_id = $definition[
'field_id'];
 
 1141                         if($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id]))
 
 1154                 $lng->loadLanguageModule(
'chat');
 
 1156                 include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1159                 $form->setFormAction($this->ctrl->getFormAction($this, 
'saveChatOptions'));
 
 1160                 $form->setTitle($lng->txt(
"chat_settings"));
 
 1162                 if((
int)$ilSetting->get(
'chat_message_notify_status'))
 
 1168                         $ro_parent = 
new ilCheckboxInputGUI($this->lng->txt(
'chat_message_notify_activate'), 
'chat_message_notify_activate');
 
 1170                         #$ro_parent->setValue(0); 
 1172                         if((
int)$ilSetting->get(
'chat_sound_status') &&
 
 1173                            ((int)$ilSetting->get(
'chat_new_invitation_sound_status') ||
 
 1174                             (int)$ilSetting->get(
'chat_new_message_sound_status')))
 
 1177                                 #$rg = new ilRadioGroupInputGUI($this->lng->txt('chat_sounds'), 'chat_sound_status'); 
 1179                                 #$ro = new ilCheckboxInputGUI($this->lng->txt('chat_sound_status_activate'), 1); 
 1180                                 if((
int)$ilSetting->get(
'chat_new_invitation_sound_status'))
 
 1183                                         $chb->setOptionTitle($this->lng->txt(
'chat_new_invitation_sound_status'));
 
 1184                                         $chb->setChecked(
false);
 
 1185                                         $ro_parent->addSubItem($chb);
 
 1188                                 if((
int)$ilSetting->get(
'chat_new_message_sound_status'))
 
 1190                                         $chb = 
new ilCheckBoxInputGUI(
'',
'chat_new_message_sound_status');
 
 1191                                         $chb->setOptionTitle($this->lng->txt(
'chat_new_message_sound_status'));
 
 1192                                         $chb->setChecked(
false);
 
 1193                                         $ro_parent->addSubItem($chb);
 
 1195                                 #$rg->addOption($ro); 
 1200                                 #$ro_parent->addSubItem($rg); 
 1205                         #$ro_parent = new ilRadioOption($this->lng->txt('chat_message_notify_deactivate'), 0); 
 1206                         #$rg_parent->addOption($ro_parent); 
 1207                         $form->addItem($ro_parent);
 
 1210                 $form->addCommandButton(
"saveChatOptions", $lng->txt(
"save"));
 
 1218                 if((
int)$ilSetting->get(
'chat_message_notify_status'))
 
 1220                         $ilUser->setPref(
'chat_message_notify_status', (
int)
$_POST[
'chat_message_notify_activate']);
 
 1223                 if((
int)$ilSetting->get(
'chat_sound_status') &&
 
 1224                    ((int)$ilSetting->get(
'chat_new_invitation_sound_status') || 
 
 1225                     (int)$ilSetting->get(
'chat_new_message_sound_status')))
 
 1227                         $ilUser->setPref(
'chat_sound_status', (
int)
$_POST[
'chat_sound_status']);
 
 1228                         if((
int)$ilSetting->get(
'chat_new_invitation_sound_status'))
 
 1230                                 $ilUser->setPref(
'chat_new_invitation_sound_status', (
int)$_POST[
'chat_new_invitation_sound_status']);
 
 1232                         if((
int)$ilSetting->get(
'chat_new_message_sound_status'))
 
 1234                                 $ilUser->setPref(
'chat_new_message_sound_status', (
int)$_POST[
'chat_new_message_sound_status']);
 
 1238                 $ilUser->writePrefs();          
 
 1256                 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'personal_desktop'));
 
 1262                         $form->setValuesByPost();
 
 1267                         $values[
'chat_message_notify_status'] = $ilUser->getPref(
'chat_message_notify_status');
 
 1268                         $values[
'chat_message_notify_activate'] = $ilUser->getPref(
'chat_message_notify_status');
 
 1270                         $values[
'chat_sound_status'] = $ilUser->getPref(
'chat_sound_status');
 
 1271                         $values[
'chat_new_invitation_sound_status'] = $ilUser->getPref(
'chat_new_invitation_sound_status');
 
 1272                         $values[
'chat_new_message_sound_status'] = $ilUser->getPref(
'chat_new_message_sound_status');
 
 1275                         $form->setValuesByArray($values);
 
 1278                 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
 
 1295                 $ilTabs->setSubTabActive(
"personal_data");
 
 1297                 $settings = $ilias->getAllSettings();
 
 1306                 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
 
 1312                         if ($ilUser->getProfileIncomplete())
 
 1317                 $this->tpl->setContent($this->form->getHTML());
 
 1329                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1331                 $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1334                 $user_defined_data = $ilUser->getUserDefinedData();
 
 1336                 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
 
 1340                                 $this->input[
"udf_".$definition[
'field_id']] =
 
 1341                                         new ilTextInputGUI($definition[
'field_name'], 
"udf_".$definition[
'field_id']);
 
 1342                                 $this->input[
"udf_".$definition[
'field_id']]->setMaxLength(255);
 
 1343                                 $this->input[
"udf_".$definition[
'field_id']]->setSize(40);
 
 1347                                 $this->input[
"udf_".$definition[
'field_id']] =
 
 1349                                 $this->input[
"udf_".$definition[
'field_id']]->setUseRte(
true);
 
 1353                                 $this->input[
"udf_".$definition[
'field_id']] =
 
 1354                                         new ilSelectInputGUI($definition[
'field_name'], 
"udf_".$definition[
'field_id']);                                
 
 1355                                 $this->input[
"udf_".$definition[
'field_id']]->setOptions(
 
 1356                                         $this->user_defined_fields->fieldValuesToSelectArray($definition[
'field_values']));
 
 1359                         $value = $user_defined_data[
"f_".$field_id];
 
 1360                         $this->input[
"udf_".$definition[
'field_id']]->setValue($value);
 
 1362                         if($definition[
'required'])
 
 1364                                 $this->input[
"udf_".$definition[
'field_id']]->setRequired(
true);
 
 1366                         if(!$definition[
'changeable'] && (!$definition[
'required'] || $value))
 
 1368                                 $this->input[
"udf_".$definition[
'field_id']]->setDisabled(
true);
 
 1373                 include_once(
"./Services/User/classes/class.ilUserProfile.php");
 
 1375                 $up->skipField(
"password");
 
 1376                 $up->skipGroup(
"settings");
 
 1377                 $up->skipGroup(
"preferences");
 
 1380                 $up->addStandardFieldsToForm($this->form, $ilUser, $this->input);
 
 1382                 $this->form->addCommandButton(
"savePersonalData", $lng->txt(
"save"));
 
 1395                 if ($this->form->checkInput())
 
 1401                                 "firstname" => 
"FirstName",
 
 1402                                 "lastname" => 
"LastName",
 
 1403                                 "title" => 
"UTitle",
 
 1404                                 "sel_country" => 
"SelectedCountry",
 
 1405                                 "phone_office" => 
"PhoneOffice",
 
 1406                                 "phone_home" => 
"PhoneHome",
 
 1407                                 "phone_mobile" => 
"PhoneMobile",
 
 1408                                 "referral_comment" => 
"Comment" 
 1410                         include_once(
"./Services/User/classes/class.ilUserProfile.php");
 
 1412                         foreach($up->getStandardFields() as $f => $p)
 
 1415                                 $item = $this->form->getItemByPostVar(
"usr_".$f);
 
 1416                                 if($item && !$item->getDisabled())
 
 1418                                         $value = $this->form->getInput(
"usr_".$f);                                      
 
 1422                                                         if (is_array($value))
 
 1424                                                                 if (is_array($value[
'date']))
 
 1426                                                                         if (($value[
'd'] > 0) && ($value[
'm'] > 0) && ($value[
'y'] > 0))
 
 1428                                                                                 $ilUser->setBirthday(sprintf(
"%04d-%02d-%02d", $value[
'y'], $value[
'm'], $value[
'd']));
 
 1432                                                                                 $ilUser->setBirthday(
"");
 
 1437                                                                         $ilUser->setBirthday($value[
'date']);
 
 1448                                                         $ilUser->{
"set".$m}($value);
 
 1453                         $ilUser->setFullname();
 
 1458                                 $ilUser->setInstantMessengerId(
'icq', $this->form->getInput(
"usr_im_icq"));
 
 1459                                 $ilUser->setInstantMessengerId(
'yahoo', $this->form->getInput(
"usr_im_yahoo"));
 
 1460                                 $ilUser->setInstantMessengerId(
'msn', $this->form->getInput(
"usr_im_msn"));
 
 1461                                 $ilUser->setInstantMessengerId(
'aim', $this->form->getInput(
"usr_im_aim"));
 
 1462                                 $ilUser->setInstantMessengerId(
'skype', $this->form->getInput(
"usr_im_skype"));
 
 1463                                 $ilUser->setInstantMessengerId(
'jabber', $this->form->getInput(
"usr_im_jabber"));
 
 1464                                 $ilUser->setInstantMessengerId(
'voip', $this->form->getInput(
"usr_im_voip"));
 
 1468                         $defs = $this->user_defined_fields->getVisibleDefinitions();
 
 1470                         foreach ($defs as $definition)
 
 1472                                 $f = 
"udf_".$definition[
'field_id'];
 
 1473                                 $item = $this->form->getItemByPostVar($f);
 
 1474                                 if ($item && !$item->getDisabled())
 
 1476                                         $udf[$definition[
'field_id']] = $this->form->getInput($f);
 
 1479                         $ilUser->setUserDefinedData($udf);
 
 1482                         $un = $this->form->getInput(
'username');
 
 1483                         if((
int)$ilSetting->get(
'allow_change_loginname') && 
 
 1484                            $un != $ilUser->getLogin())
 
 1489                                         $this->form->getItemByPostVar(
'username')->setAlert($this->lng->txt(
'login_invalid'));
 
 1490                                         $form_valid = 
false;    
 
 1495                                         $this->form->getItemByPostVar(
'username')->setAlert($this->lng->txt(
'loginname_already_exists'));
 
 1496                                         $form_valid = 
false;
 
 1500                                         $ilUser->setLogin($un);
 
 1504                                                 $ilUser->updateLogin($ilUser->getLogin());
 
 1505                                                 $ilAuth->setAuth($ilUser->getLogin());
 
 1511                                                 $this->form->getItemByPostVar(
'username')->setAlert($e->getMessage());
 
 1512                                                 $form_valid = 
false;                                                    
 
 1523                                 $ilUser->setProfileIncomplete(
false);
 
 1526                                 $ilUser->setTitle($ilUser->getFullname());
 
 1527                                 $ilUser->setDescription($ilUser->getEmail());
 
 1534                                         unset(
$_SESSION[
'profile_complete_redirect']);
 
 1539                     $ilCtrl->redirect($this, 
"showPersonalData");
 
 1544                 $this->form->setValuesByPost();
 
 1557         function showPublicProfile($a_no_init = 
false)
 
 1561                 $this->__initSubTabs(
"showPersonalData");
 
 1562                 $ilTabs->setSubTabActive(
"public_profile");
 
 1568                 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
 
 1572                         $this->initPublicProfileForm();
 
 1575                 $ptpl = 
new ilTemplate(
"tpl.edit_personal_profile.html", 
true, 
true, 
"Services/User");
 
 1576                 $ptpl->setVariable(
"FORM", $this->form->getHTML());
 
 1577                 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
 
 1579                 $ptpl->setVariable(
"PREVIEW", $pub_profile->getHTML(
true));
 
 1580                 $this->tpl->setContent($ptpl->get());
 
 1589         public function initPublicProfileForm()
 
 1593                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1598                 $radg->
setInfo($this->lng->txt(
"user_activate_public_profile_info"));
 
 1599                 $pub_prof = in_array($ilUser->prefs[
"public_profile"], array(
"y", 
"n", 
"g"))
 
 1600                         ? $ilUser->prefs[
"public_profile"]
 
 1602                 if (!$ilSetting->get(
'enable_global_profiles') && $pub_prof == 
"g")
 
 1606                 $radg->setValue($pub_prof);
 
 1607                         $op1 = 
new ilRadioOption($lng->txt(
"usr_public_profile_disabled"), 
"n",$lng->txt(
"usr_public_profile_disabled_info"));
 
 1608                         $radg->addOption($op1);
 
 1609                         $op2 = 
new ilRadioOption($lng->txt(
"usr_public_profile_logged_in"), 
"y",$lng->txt(
"usr_public_profile_logged_in_info"));
 
 1610                         $radg->addOption($op2);
 
 1611                 if ($ilSetting->get(
'enable_global_profiles'))
 
 1613                         $op3 = 
new ilRadioOption($lng->txt(
"usr_public_profile_global"), 
"g",$lng->txt(
"usr_public_profile_global_info"));
 
 1614                         $radg->addOption($op3);
 
 1616                 $this->form->addItem($radg);
 
 1625                 $birthday = $ilUser->getBirthday();
 
 1630                 $gender = $ilUser->getGender();
 
 1633                         $gender = $lng->txt(
"gender_".$gender);
 
 1636                 if ($ilUser->getSelectedCountry() != 
"")
 
 1638                         $lng->loadLanguageModule(
"meta");
 
 1639                         $txt_sel_country = $lng->txt(
"meta_c_".$ilUser->getSelectedCountry());
 
 1644                         "title" => $ilUser->getUTitle(),
 
 1645                         "birthday" => $birthday,
 
 1646                         "gender" => $gender,
 
 1647                         "institution" => $ilUser->getInstitution(),
 
 1648                         "department" => $ilUser->getDepartment(),
 
 1650                         "street" => $ilUser->getStreet(),
 
 1651                         "zipcode" => $ilUser->getZipcode(),
 
 1652                         "city" => $ilUser->getCity(),
 
 1653                         "country" => $ilUser->getCountry(),
 
 1654                         "sel_country" => $txt_sel_country,
 
 1655                         "phone_office" => $ilUser->getPhoneOffice(),
 
 1656                         "phone_home" => $ilUser->getPhoneHome(),
 
 1657                         "phone_mobile" => $ilUser->getPhoneMobile(),
 
 1658                         "fax" => $ilUser->getFax(),
 
 1659                         "email" => $ilUser->getEmail(),
 
 1660                         "hobby" => $ilUser->getHobby(),
 
 1661                         "matriculation" => $ilUser->getMatriculation(),
 
 1662                         "delicious" => $ilUser->getDelicious()
 
 1664                 foreach($val_array as $key => $value)
 
 1666                         if ($this->userSettingVisible($key))
 
 1669                                 if ($key == 
"upload")
 
 1677                                 if ($ilUser->prefs[
"public_".$key] == 
"y")
 
 1682                                 $cb->setOptionTitle($value);
 
 1683                                 $this->form->addItem($cb);
 
 1687                 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
 
 1688                 if ($this->userSettingVisible(
"instant_messengers"))
 
 1690                         foreach ($im_arr as $im)
 
 1696                                 if ($ilUser->prefs[
"public_im_".$im] != 
"n")
 
 1698                                         $cb->setChecked(
true);
 
 1700                                 $this->form->addItem($cb);
 
 1705                 $user_defined_data = $ilUser->getUserDefinedData();
 
 1706                 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
 
 1709                         $cb = 
new ilCheckboxInputGUI($definition[
"field_name"], 
"chk_udf_".$definition[
"field_id"]);
 
 1710                         $cb->setOptionTitle($user_defined_data[
"f_".$definition[
"field_id"]]);
 
 1711                         if ($ilUser->prefs[
"public_udf_".$definition[
"field_id"]] == 
"y")
 
 1713                                 $cb->setChecked(
true);
 
 1715                         $this->form->addItem($cb);
 
 1720                 $this->form->addCommandButton(
"savePublicProfile", $lng->txt(
"save"));
 
 1722                 $this->form->setTitle($lng->txt(
"public_profile"));
 
 1723                 $this->form->setDescription($lng->txt(
"user_public_profile_info"));
 
 1724                 $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1731         public function savePublicProfile()
 
 1735                 $this->initPublicProfileForm();
 
 1736                 if ($this->form->checkInput())
 
 1746                         $ilUser->setPref(
"public_profile", 
$_POST[
"public_profile"]);
 
 1749                         $val_array = array(
"title", 
"birthday", 
"gender", 
"institution", 
"department", 
"upload", 
"street",
 
 1750                                 "zipcode", 
"city", 
"country", 
"sel_country", 
"phone_office", 
"phone_home", 
"phone_mobile",
 
 1751                                 "fax", 
"email", 
"hobby", 
"matriculation");
 
 1754                         foreach($val_array as $key => $value)
 
 1756                                 if ((
$_POST[
"chk_".$value]))
 
 1758                                         $ilUser->setPref(
"public_".$value,
"y");
 
 1762                                         $ilUser->setPref(
"public_".$value,
"n");
 
 1766                         $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
 
 1767                         if ($this->userSettingVisible(
"instant_messengers"))
 
 1769                                 foreach ($im_arr as $im)
 
 1771                                         if ((
$_POST[
"chk_im_".$im]))
 
 1773                                                 $ilUser->setPref(
"public_im_".$im,
"y");
 
 1777                                                 $ilUser->setPref(
"public_im_".$im,
"n");
 
 1785                                 if ((
$_POST[
"chk_delicious"]))
 
 1787                                         $ilUser->setPref(
"public_delicious",
"y");
 
 1791                                         $ilUser->setPref(
"public_delicious",
"n");
 
 1796                         foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
 
 1798                                 if ((
$_POST[
"chk_udf_".$definition[
"field_id"]]))
 
 1800                                         $ilUser->setPref(
"public_udf_".$definition[
"field_id"], 
"y");
 
 1804                                         $ilUser->setPref(
"public_udf_".$definition[
"field_id"], 
"n");
 
 1810                         $ilCtrl->redirect($this, 
"showPublicProfile");
 
 1812                 $this->form->setValuesByPost();
 
 1813                 $tpl->showPublicProfile(
true);
 
 1826         function showPassword($a_no_init = 
false)
 
 1830                 $this->__initSubTabs(
"showPersonalData");
 
 1831                 $ilTabs->setSubTabActive(
"password");
 
 1837                 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
 
 1841                         $this->initPasswordForm();
 
 1843                 $this->tpl->setContent($this->form->getHTML());
 
 1852         public function initPasswordForm()
 
 1856                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1860                 if ($this->allowPasswordChange())
 
 1873                                 $cpass->setSkipSyntaxCheck(
true);
 
 1875                                 if($ilUser->getPasswd())
 
 1877                                         $cpass->setRequired(
true);
 
 1879                                 $this->form->addItem($cpass);
 
 1887                         if ($ilSetting->get(
"passwd_auto_generate") == 1)       
 
 1889                                 $ipass->setPreSelection(
true);
 
 1891                                 $this->form->addItem($ipass);
 
 1892                                 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
 
 1893                                 $this->form->addCommandButton(
"showPassword", $lng->txt(
"new_list_password"));
 
 1897                                 $this->form->addItem($ipass);
 
 1898                                 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
 
 1901                         switch ($ilUser->getAuthMode(
true))
 
 1904                                         $this->form->setTitle($lng->txt(
"chg_password"));
 
 1909                                         require_once 
'Services/WebDAV/classes/class.ilDAVServer.php';
 
 1912                                                 $this->form->setTitle($lng->txt(
"chg_ilias_and_webfolder_password"));
 
 1916                                                 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
 
 1920                                         $this->form->setTitle($lng->txt(
"chg_ilias_password"));
 
 1923                         $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1930         function allowPasswordChange()
 
 1940                 if ($ilUser->getAuthMode(
true) != 
AUTH_LOCAL &&
 
 1941                         ($ilUser->getAuthMode(
true) != 
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
 
 1942                         ($ilUser->getAuthMode(
true) != 
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
 
 1943                         ($ilUser->getAuthMode(
true) != 
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local")) &&
 
 1949                 if (!$this->userSettingVisible(
'password') ||
 
 1950                         $this->ilias->getSetting(
'usr_settings_disable_password'))
 
 1961         public function savePassword()
 
 1966                 if (!$this->allowPasswordChange())
 
 1968                         $ilCtrl->redirect($this, 
"showPersonalData");
 
 1972                 $this->initPasswordForm();
 
 1973                 if ($this->form->checkInput())
 
 1975                         $cp = $this->form->getItemByPostVar(
"current_password");
 
 1976                         $np = $this->form->getItemByPostVar(
"new_password");
 
 1982                         #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local")) 
 1986                                 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd() and
 
 1987                                         $ilUser->getPasswd())
 
 1990                                         $cp->setAlert($this->lng->txt(
"passwd_wrong"));
 
 1995                         if ($this->ilias->getSetting(
"passwd_auto_generate") == 1 &&
 
 1999                                 $np->setAlert($this->lng->txt(
"passwd_not_selected"));
 
 2003                         if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
 
 2007                                 if ($custom_error != 
'')
 
 2009                                         $np->setAlert($custom_error);
 
 2013                                         $np->setAlert($this->lng->txt(
"passwd_invalid"));
 
 2016                         if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
 
 2017                                 ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
 
 2018                                 (
$_POST[
"current_password"] == 
$_POST[
"new_password"]))
 
 2021                                 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
 
 2027                                 $ilUser->resetPassword(
$_POST[
"new_password"], 
$_POST[
"new_password"]);
 
 2028                                 if (
$_POST[
"current_password"] != 
$_POST[
"new_password"])
 
 2030                                         $ilUser->setLastPasswordChangeToNow();
 
 2032                                 $ilCtrl->redirect($this, 
"showPassword");
 
 2035                 $this->form->setValuesByPost();
 
 2036                 $this->showPassword(
true);
 
 2048         function showGeneralSettings($a_no_init = 
false)
 
 2052                 $this->__initSubTabs(
"showPersonalData");
 
 2053                 $ilTabs->setSubTabActive(
"general_settings");
 
 2059                 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
 
 2063                         $this->initGeneralSettingsForm();
 
 2065                 $this->tpl->setContent($this->form->getHTML());
 
 2073         public function initGeneralSettingsForm()
 
 2078                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2082                 if ($this->userSettingVisible(
"language"))
 
 2084                         $languages = $this->lng->getInstalledLanguages();
 
 2086                         foreach($languages as $lang_key)
 
 2093                         $si->setValue($ilUser->getLanguage());
 
 2094                         $si->setDisabled($ilSetting->get(
"usr_settings_disable_language"));
 
 2095                         $this->form->addItem($si);
 
 2099                 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
 
 2100                 if ($this->userSettingVisible(
"skin_style"))
 
 2102                         $templates = $styleDefinition->getAllTemplates();
 
 2103                         if (is_array($templates))
 
 2108                                 foreach($templates as $template)
 
 2112                                         $styleDef->startParsing();
 
 2113                                         $styles = $styleDef->getStyles();
 
 2115                                         foreach($styles as $style)
 
 2122                                                 $options[$template[
"id"].
":".$style[
"id"]] =
 
 2123                                                         $styleDef->getTemplateName().
" / ".$style[
"name"];
 
 2127                                 $si->setValue($ilUser->skin.
":".$ilUser->prefs[
"style"]);
 
 2128                                 $si->setDisabled($ilSetting->get(
"usr_settings_disable_skin_style"));
 
 2129                                 $this->form->addItem($si);
 
 2134                 if ($this->userSettingVisible(
"screen_reader_optimization"))
 
 2136                         $cb = 
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"), 
"screen_reader_optimization");
 
 2137                         $cb->
setChecked($ilUser->prefs[
"screen_reader_optimization"]);
 
 2138                         $cb->setDisabled($ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
 
 2139                         $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
 
 2140                         $this->form->addItem($cb);
 
 2144                 if ($this->userSettingVisible(
"hits_per_page"))
 
 2146                         $si = 
new ilSelectInputGUI($this->lng->txt(
"hits_per_page"), 
"hits_per_page");
 
 2148                         $hits_options = array(10,15,20,30,40,50,100,9999);
 
 2151                         foreach($hits_options as $hits_option)
 
 2153                                 $hstr = ($hits_option == 9999)
 
 2154                                         ? $this->lng->txt(
"no_limit")
 
 2156                                 $options[$hits_option] = $hstr;
 
 2158                         $si->setOptions($options);
 
 2159                         $si->setValue($ilUser->prefs[
"hits_per_page"]);
 
 2160                         $si->setDisabled($ilSetting->get(
"usr_settings_disable_hits_per_page"));
 
 2161                         $this->form->addItem($si);
 
 2165                 if ($this->userSettingVisible(
"show_users_online"))
 
 2167                         $si = 
new ilSelectInputGUI($this->lng->txt(
"show_users_online"), 
"show_users_online");
 
 2170                                 "y" => $this->lng->txt(
"users_online_show_y"),
 
 2171                                 "associated" => $this->lng->txt(
"users_online_show_associated"),
 
 2172                                 "n" => $this->lng->txt(
"users_online_show_n"));
 
 2174                         $si->setValue($ilUser->prefs[
"show_users_online"]);
 
 2175                         $si->setDisabled($ilSetting->get(
"usr_settings_disable_show_users_online"));
 
 2176                         $this->form->addItem($si);
 
 2180                 if ($this->userSettingVisible(
"hide_own_online_status"))
 
 2182                         $cb = 
new ilCheckboxInputGUI($this->lng->txt(
"hide_own_online_status"), 
"hide_own_online_status");
 
 2183                         $cb->
setChecked($ilUser->prefs[
"hide_own_online_status"] == 
"y");
 
 2184                         $cb->setDisabled($ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
 
 2185                         $this->form->addItem($cb);
 
 2189                 if((
int)$ilSetting->get(
'session_handling_type') == 0 &&
 
 2190                    (int)$ilSetting->get(
'session_reminder_enabled'))
 
 2192                         $cb = 
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'), 
'session_reminder_enabled');
 
 2193                         $cb->
setInfo($this->lng->txt(
'session_reminder_info'));
 
 2195                         $cb->setChecked((
int)$ilUser->getPref(
'session_reminder_enabled'));
 
 2197                         global $ilClientIniFile;
 
 2199                         $lead_time_gui = 
new ilTextInputGUI($this->lng->txt(
'session_reminder_lead_time'), 
'session_reminder_lead_time');
 
 2200                         $lead_time_gui->
setInfo(sprintf($this->lng->txt(
'session_reminder_lead_time_info'), 
ilFormat::_secondsToString($ilClientIniFile->readVariable(
'session', 
'expire'))));
 
 2201                         $lead_time_gui->setValue($ilUser->getPref(
'session_reminder_lead_time'));
 
 2202                         $lead_time_gui->setMaxLength(10);
 
 2203                         $lead_time_gui->setSize(10);
 
 2204                         $cb->addSubItem($lead_time_gui);
 
 2206                         $this->form->addItem($cb);
 
 2213                 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
 
 2214                 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
 
 2215                 $lng->loadLanguageModule(
"dateplaner");
 
 2220                 $select->setInfo($lng->txt(
'cal_timezone_info'));
 
 2221                 $select->setValue($user_settings->getTimeZone());
 
 2222                 $this->form->addItem($select);
 
 2225                 $select = 
new ilSelectInputGUI($lng->txt(
'cal_user_date_format'),
'date_format');
 
 2230                 $select->setInfo($lng->txt(
'cal_date_format_info'));
 
 2231                 $select->setValue($user_settings->getDateFormat());
 
 2232                 $this->form->addItem($select);
 
 2234                 $select = 
new ilSelectInputGUI($lng->txt(
'cal_user_time_format'),
'time_format');
 
 2238                 $select->setInfo($lng->txt(
'cal_time_format_info'));
 
 2239             $select->setValue($user_settings->getTimeFormat());
 
 2240                 $this->form->addItem($select);
 
 2243                 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
 
 2244                 $this->form->setTitle($lng->txt(
"general_settings"));
 
 2245                 $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 2253         public function saveGeneralSettings()
 
 2257                 $this->initGeneralSettingsForm();
 
 2258                 if ($this->form->checkInput())
 
 2260                         if ($this->workWithUserSetting(
"skin_style"))
 
 2263                                 if (
$_POST[
"skin_style"] != 
"")
 
 2265                                         $sknst = explode(
":", 
$_POST[
"skin_style"]);
 
 2267                                         if ($ilUser->getPref(
"style") != $sknst[1] ||
 
 2268                                                 $ilUser->getPref(
"skin") != $sknst[0])
 
 2270                                                 $ilUser->setPref(
"skin", $sknst[0]);
 
 2271                                                 $ilUser->setPref(
"style", $sknst[1]);
 
 2277                         if ($this->workWithUserSetting(
"language"))
 
 2279                                 $ilUser->setLanguage(
$_POST[
"language"]);
 
 2283                         if ($this->workWithUserSetting(
"hits_per_page"))
 
 2285                                 if (
$_POST[
"hits_per_page"] != 
"")
 
 2287                                         $ilUser->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
 
 2292                         if ($this->workWithUserSetting(
"show_users_online"))
 
 2294                                 $ilUser->setPref(
"show_users_online", 
$_POST[
"show_users_online"]);
 
 2298                         if ($this->workWithUserSetting(
"hide_own_online_status"))
 
 2300                                 if (
$_POST[
"hide_own_online_status"] == 1)
 
 2302                                         $ilUser->setPref(
"hide_own_online_status",
"y");
 
 2306                                         $ilUser->setPref(
"hide_own_online_status",
"n");
 
 2311                         if ($this->workWithUserSetting(
"screen_reader_optimization"))
 
 2313                                 $ilUser->setPref(
"screen_reader_optimization", 
$_POST[
"screen_reader_optimization"]);
 
 2318                         if((
int)$ilSetting->get(
'session_handling_type') == 0 &&
 
 2319                            (int)$ilSetting->get(
'session_reminder_enabled'))
 
 2321                                 $ilUser->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
 
 2323                                 if(!preg_match(
'/^([0]|([1-9][0-9]*))([\.][0-9][0-9]*)?$/', $_POST[
'session_reminder_lead_time']))
 
 2324                                         $_POST[
'session_reminder_lead_time'] = 0;
 
 2325                                 $ilUser->setPref(
'session_reminder_lead_time', $_POST[
'session_reminder_lead_time']);
 
 2331                         include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
 
 2333                         $user_settings->setTimeZone($this->form->getInput(
"timezone"));
 
 2334                         $user_settings->setDateFormat((
int)$this->form->getInput(
"date_format"));
 
 2335                         $user_settings->setTimeFormat((
int)$this->form->getInput(
"time_format"));
 
 2336                         $user_settings->save();
 
 2339                         $ilCtrl->redirect($this, 
"showGeneralSettings");
 
 2342                 $this->form->setValuesByPost();
 
 2343                 $tpl->showGeneralSettings(
true);
 
 2358         function showExtendedProfile()
 
 2362                 $this->initExtProfile();
 
 2363                 $ilToolbar->addButton($lng->txt(
"user_add_page"),
 
 2364                         $ilCtrl->getLinkTarget($this, 
"addProfilePage"));
 
 2366                 include_once(
"./Services/User/classes/class.ilExtendedProfileTableGUI.php");
 
 2368                 $tpl->setContent(
$tab->getHTML());
 
 2379         function addProfilePage()
 
 2381                 global 
$tpl, $ilTabs;
 
 2383                 $this->initExtProfile();
 
 2384                 $this->initProfilePageForm(
"create");
 
 2385                 $tpl->setContent($this->form->getHTML());
 
 2396         public function initProfilePageForm($a_mode = 
"edit")
 
 2400                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2405                 if ($a_mode == 
"create")
 
 2410                         $ti->setRequired(
true);
 
 2411                         $this->form->addItem($ti);
 
 2413                         $this->form->addCommandButton(
"saveProfilePage", $lng->txt(
"save"));
 
 2414                         $this->form->addCommandButton(
"showExtendedProfile", $lng->txt(
"cancel"));
 
 2415                         $this->form->setTitle($lng->txt(
"user_new_profile_page"));
 
 2419                         $this->form->addCommandButton(
"updateProfilePage", $lng->txt(
"save"));
 
 2420                         $this->form->addCommandButton(
"showExtendedProfile", $lng->txt(
"cancel"));
 
 2421                         $this->form->setTitle($lng->txt(
"user_add_profile_page"));
 
 2424                 $this->form->setFormAction($ilCtrl->getFormAction($this));
 
 2430         public function saveProfilePage()
 
 2434                 $this->initProfilePageForm(
"create");
 
 2435                 if ($this->form->checkInput())
 
 2437                         include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
 
 2439                         $page->setUserId($ilUser->getId());
 
 2440                         $page->setTitle(
$_POST[
"title"]);
 
 2443                         $ilCtrl->redirect($this, 
"showExtendedProfile");
 
 2446                 $this->initExtProfile();
 
 2447                 $this->form->setValuesByPost();
 
 2448                 $tpl->setContent($this->form->getHtml());
 
 2455         public function getProfilePageValues()
 
 2459                 $values[
"title"] = 
"";
 
 2461                 $this->form->setValuesByArray($values);
 
 2467         function initExtProfile()
 
 2471                 $this->__initSubTabs(
"showPersonalData");
 
 2472                 $ilTabs->setSubTabActive(
"user_ext_profile");
 
 2475                 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
 
 2481         function confirmProfilePageDeletion()
 
 2485                 if (!is_array(
$_POST[
"user_page"]) || count(
$_POST[
"user_page"]) == 0)
 
 2488                         $ilCtrl->redirect($this, 
"showExtendedProfile");
 
 2492                         include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2494                         $cgui->setFormAction($ilCtrl->getFormAction($this));
 
 2495                         $cgui->setHeaderText($lng->txt(
"user_sure_delete_pages"));
 
 2496                         $cgui->setCancel($lng->txt(
"cancel"), 
"showExtendedProfile");
 
 2497                         $cgui->setConfirm($lng->txt(
"delete"), 
"deleteProfilePages");
 
 2499                         include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
 
 2500                         foreach (
$_POST[
"user_page"] as $i => $v)
 
 2505                         $this->initExtProfile();
 
 2506                         $tpl->setContent($cgui->getHTML());
 
 2518         function deleteProfilePages()
 
 2522                 include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
 
 2523                 if (is_array(
$_POST[
"user_page"]))
 
 2525                         foreach (
$_POST[
"user_page"] as $i => $v)
 
 2528                                 if ($page->getUserId() == $ilUser->getId())
 
 2536                 $ilCtrl->redirect($this, 
"showExtendedProfile");
 
 2545         function saveExtProfilePagesOrdering()
 
 2549                 include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
 
 2551                 if (is_array(
$_POST[
"title"]))
 
 2553                         foreach (
$_POST[
"title"] as $k => $v)
 
 2556                                 if ($page->getUserId() == $ilUser->getId())
 
 2566                 $ilCtrl->redirect($this, 
"showExtendedProfile");