00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00033 require_once "./include/inc.header.php";
00034
00035
00036 if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
00037 {
00038 $ilias->raiseError($lng->txt("msg_not_available_for_anon"),$ilias->error_obj->MESSAGE);
00039 }
00040
00041 $strip = false;
00042
00043 if (!empty($_POST))
00044 {
00045 $strip = true;
00046 }
00047
00048 foreach($_POST as $key => $val)
00049 {
00050 $_POST[$key] = ilUtil::prepareFormOutput($val,$strip);
00051 }
00052
00053 $webspace_dir = $ilias->ini->readVariable("server","webspace_dir");
00054
00055
00056 $settings = $ilias->getAllSettings();
00057
00058
00059
00060
00061
00062 function workWithUserSetting($setting)
00063 {
00064 global $settings;
00065 $result = TRUE;
00066 if ($settings["usr_settings_hide_".$setting] == 1)
00067 {
00068 $result = FALSE;
00069 }
00070 if ($settings["usr_settings_disable_".$setting] == 1)
00071 {
00072 $result = FALSE;
00073 }
00074 return $result;
00075 }
00076
00077 function userSettingVisible($setting)
00078 {
00079 global $settings;
00080 $result = TRUE;
00081 if ($settings["usr_settings_hide_".$setting] == 1)
00082 {
00083 $result = FALSE;
00084 }
00085 return $result;
00086 }
00087
00088
00089
00090 function upload_file()
00091 {
00092 global $upload_error,$lng;
00093 global $userfile, $userfile_name, $userfile_size,
00094 $userfile_type, $archive_dir, $WINDIR,$ilias,$lng;
00095 global $target_file, $return_path;
00096
00097 if ($_FILES["userfile"]["size"] == 0)
00098 {
00099 $upload_error=$lng->txt("msg_no_file");
00100 return;
00101 }
00102
00103
00104
00105
00106
00107 $webspace_dir = ilUtil::getWebspaceDir();
00108 $image_dir = $webspace_dir."/usr_images";
00109 $target_file = $image_dir."/usr_".$ilias->account->getId()."."."jpg";
00110 $store_file = "usr_".$ilias->account->getID()."."."jpg";
00111
00112
00113 $ilias->account->setPref("profile_image", $store_file);
00114 $ilias->account->update();
00115
00116
00117
00118
00119
00120 $uploaded_file = $image_dir."/upload_".$ilias->account->getId();
00121
00122 if (!ilUtil::moveUploadedFile($_FILES["userfile"]["tmp_name"], $_FILES["userfile"]["name"],
00123 $uploaded_file, false))
00124 {
00125 ilUtil::redirect("usr_profile.php");
00126 }
00127
00128
00129 chmod($uploaded_file, 0770);
00130
00131
00132
00133 $show_file = "$image_dir/usr_".$ilias->account->getId().".jpg";
00134 $thumb_file = "$image_dir/usr_".$ilias->account->getId()."_small.jpg";
00135 $xthumb_file = "$image_dir/usr_".$ilias->account->getId()."_xsmall.jpg";
00136 $xxthumb_file = "$image_dir/usr_".$ilias->account->getId()."_xxsmall.jpg";
00137
00138 system(ilUtil::getConvertCmd()." $uploaded_file" . "[0] -geometry 200x200 -quality 100 JPEG:$show_file");
00139 system(ilUtil::getConvertCmd()." $uploaded_file" . "[0] -geometry 100x100 -quality 100 JPEG:$thumb_file");
00140 system(ilUtil::getConvertCmd()." $uploaded_file" . "[0] -geometry 75x75 -quality 100 JPEG:$xthumb_file");
00141 system(ilUtil::getConvertCmd()." $uploaded_file" . "[0] -geometry 30x30 -quality 100 JPEG:$xxthumb_file");
00142
00143 if ($error)
00144 {
00145
00146 sendInfo($lng->txt("image_gen_unsucc"), true);
00147 ilUtil::redirect("usr_profile.php");
00148 }
00149
00150 return $target_file;
00151 }
00152
00153 function removePicture()
00154 {
00155 global $ilias;
00156
00157 $webspace_dir = ilUtil::getWebspaceDir();
00158 $image_dir = $webspace_dir."/usr_images";
00159 $file = $image_dir."/usr_".$ilias->account->getID()."."."jpg";
00160 $thumb_file = $image_dir."/usr_".$ilias->account->getID()."_small.jpg";
00161 $xthumb_file = $image_dir."/usr_".$ilias->account->getID()."_xsmall.jpg";
00162 $xxthumb_file = $image_dir."/usr_".$ilias->account->getID()."_xxsmall.jpg";
00163 $upload_file = $image_dir."/upload_".$ilias->account->getID();
00164
00165
00166 $ilias->account->setPref("profile_image", "");
00167 $ilias->account->update();
00168
00169 if (@is_file($file))
00170 {
00171 unlink($file);
00172 }
00173 if (@is_file($thumb_file))
00174 {
00175 unlink($thumb_file);
00176 }
00177 if (@is_file($xthumb_file))
00178 {
00179 unlink($xthumb_file);
00180 }
00181 if (@is_file($xxthumb_file))
00182 {
00183 unlink($xxthumb_file);
00184 }
00185 if (@is_file($upload_file))
00186 {
00187 unlink($upload_file);
00188 }
00189
00190 }
00191
00192
00193
00194
00195 function change_password()
00196 {
00197 global $ilias, $lng, $tpl, $password_error;
00198
00199
00200 if (AUTH_CURRENT != AUTH_LOCAL)
00201 {
00202 return;
00203 }
00204
00205
00206 if ($ilias->getSetting("passwd_auto_generate") == 1)
00207 {
00208
00209 if (md5($_POST["current_password"]) != $ilias->account->getPasswd())
00210 {
00211 $password_error=$lng->txt("passwd_wrong");
00212
00213 }
00214
00215
00216 if (!ilUtil::isPassword($_POST["new_passwd"]))
00217 {
00218 $password_error=$lng->txt("passwd_not_selected");
00219
00220 }
00221
00222 if (empty($password_error))
00223 {
00224 $ilias->account->updatePassword($_POST["current_password"], $_POST["new_passwd"], $_POST["new_passwd"]);
00225 }
00226 }
00227 else
00228 {
00229
00230
00231 if (md5($_POST["current_password"]) != $ilias->account->getPasswd())
00232 {
00233 $password_error=$lng->txt("passwd_wrong");
00234
00235 }
00236
00237
00238 else if ($_POST["desired_password"] != $_POST["retype_password"])
00239 {
00240 $password_error=$lng->txt("passwd_not_match");
00241
00242 }
00243
00244
00245 else if (!ilUtil::isPassword($_POST["desired_password"]))
00246 {
00247 $password_error=$lng->txt("passwd_invalid");
00248
00249 }
00250
00251 else if ($_POST["current_password"] != "" and empty($password_error))
00252 {
00253 $ilias->account->updatePassword($_POST["current_password"], $_POST["desired_password"], $_POST["retype_password"]);
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265 }
00266 }
00267 }
00268
00269
00270 $tpl->addBlockFile("CONTENT", "content", "tpl.usr_profile.html");
00271 $tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
00272 $tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
00273
00274
00275
00276 $tpl->setVariable("TXT_LOCATOR",$lng->txt("locator"));
00277 $tpl->touchBlock("locator_separator");
00278 $tpl->setCurrentBlock("locator_item");
00279 $tpl->setVariable("ITEM", $lng->txt("personal_desktop"));
00280 $tpl->setVariable("LINK_ITEM", "usr_personaldesktop.php");
00281 $tpl->parseCurrentBlock();
00282
00283 $tpl->setCurrentBlock("locator_item");
00284 $tpl->setVariable("ITEM", $lng->txt("personal_profile"));
00285 $tpl->setVariable("LINK_ITEM", "usr_profile.php");
00286 $tpl->parseCurrentBlock();
00287
00288
00289 sendInfo();
00290
00291 infoPanel();
00292
00293
00294 include "./include/inc.personaldesktop_buttons.php";
00295
00296
00297
00298
00299
00300
00301 if ($_GET["cmd"] == "save" and empty($_POST["usr_reload"]))
00302 {
00303 $upload_error;
00304 if (workWithUserSetting("upload"))
00305 {
00306
00307 if (!empty($_POST["usr_upload"]))
00308 {
00309 upload_file();
00310 }
00311
00312
00313 if (!empty($_POST["removePicture"]))
00314 {
00315 removePicture();
00316 }
00317 }
00318
00319
00320 $password_error;
00321
00322
00323 if (!empty($_POST["usr_change_password"]))
00324 {
00325 change_password();
00326 }
00327
00328
00329 $form_valid = true;
00330
00331
00332
00333
00334
00335 if (($_POST["chk_pub"])=="on")
00336 {
00337 $ilias->account->setPref("public_profile","y");
00338 }
00339 else
00340 {
00341 $ilias->account->setPref("public_profile","n");
00342 }
00343
00344
00345 $val_array = array("institution", "department", "upload", "street",
00346 "zip", "city", "country", "phone_office", "phone_home", "phone_mobile",
00347 "fax", "email", "hobby", "matriculation");
00348
00349 foreach($val_array as $key => $value)
00350 {
00351 if (($_POST["chk_".$value]) == "on")
00352 {
00353 $ilias->account->setPref("public_".$value,"y");
00354 }
00355 else
00356 {
00357 $ilias->account->setPref("public_".$value,"n");
00358 }
00359 }
00360
00361
00362 foreach($settings as $key => $val)
00363 {
00364 if (substr($key,0,8) == "require_")
00365 {
00366 $require_keys[] = substr($key,8);
00367 }
00368 }
00369
00370 foreach($require_keys as $key => $val)
00371 {
00372
00373 $system_fields = array("login", "default_role", "passwd", "passwd2");
00374 if (!in_array($val, $system_fields))
00375 {
00376 if (workWithUserSetting($val))
00377 {
00378 if (isset($settings["require_" . $val]) && $settings["require_" . $val])
00379 {
00380 if (empty($_POST["usr_" . $val]))
00381 {
00382 sendInfo($lng->txt("fill_out_all_required_fields") . ": " . $lng->txt($val));
00383 $form_valid = false;
00384 }
00385 }
00386 }
00387 }
00388 }
00389
00390 if (workWithUserSetting("email"))
00391 {
00392
00393 if (!ilUtil::is_email($_POST["usr_email"]) and !empty($_POST["usr_email"]) and $form_valid)
00394 {
00395 sendInfo($lng->txt("email_not_valid"));
00396 $form_valid = false;
00397 }
00398 }
00399
00400
00401 if (workWithUserSetting("firstname"))
00402 {
00403 $ilias->account->setFirstName(ilUtil::stripSlashes($_POST["usr_firstname"]));
00404 }
00405 if (workWithUserSetting("lastname"))
00406 {
00407 $ilias->account->setLastName(ilUtil::stripSlashes($_POST["usr_lastname"]));
00408 }
00409 if (workWithUserSetting("gender"))
00410 {
00411 $ilias->account->setGender($_POST["usr_gender"]);
00412 }
00413 if (workWithUserSetting("title"))
00414 {
00415 $ilias->account->setUTitle(ilUtil::stripSlashes($_POST["usr_title"]));
00416 }
00417 $ilias->account->setFullname();
00418
00419
00420 if (workWithUserSetting("institution"))
00421 {
00422 $ilias->account->setInstitution(ilUtil::stripSlashes($_POST["usr_institution"]));
00423 }
00424 if (workWithUserSetting("department"))
00425 {
00426 $ilias->account->setDepartment(ilUtil::stripSlashes($_POST["usr_department"]));
00427 }
00428 if (workWithUserSetting("street"))
00429 {
00430 $ilias->account->setStreet(ilUtil::stripSlashes($_POST["usr_street"]));
00431 }
00432 if (workWithUserSetting("zipcode"))
00433 {
00434 $ilias->account->setZipcode(ilUtil::stripSlashes($_POST["usr_zipcode"]));
00435 }
00436 if (workWithUserSetting("city"))
00437 {
00438 $ilias->account->setCity(ilUtil::stripSlashes($_POST["usr_city"]));
00439 }
00440 if (workWithUserSetting("country"))
00441 {
00442 $ilias->account->setCountry(ilUtil::stripSlashes($_POST["usr_country"]));
00443 }
00444 if (workWithUserSetting("phone_office"))
00445 {
00446 $ilias->account->setPhoneOffice(ilUtil::stripSlashes($_POST["usr_phone_office"]));
00447 }
00448 if (workWithUserSetting("phone_home"))
00449 {
00450 $ilias->account->setPhoneHome(ilUtil::stripSlashes($_POST["usr_phone_home"]));
00451 }
00452 if (workWithUserSetting("phone_mobile"))
00453 {
00454 $ilias->account->setPhoneMobile(ilUtil::stripSlashes($_POST["usr_phone_mobile"]));
00455 }
00456 if (workWithUserSetting("fax"))
00457 {
00458 $ilias->account->setFax(ilUtil::stripSlashes($_POST["usr_fax"]));
00459 }
00460 if (workWithUserSetting("email"))
00461 {
00462 $ilias->account->setEmail(ilUtil::stripSlashes($_POST["usr_email"]));
00463 }
00464 if (workWithUserSetting("hobby"))
00465 {
00466 $ilias->account->setHobby(ilUtil::stripSlashes($_POST["usr_hobby"]));
00467 }
00468 if (workWithUserSetting("referral_comment"))
00469 {
00470 $ilias->account->setComment(ilUtil::stripSlashes($_POST["usr_referral_comment"]));
00471 }
00472 if (workWithUserSetting("matriculation"))
00473 {
00474 $ilias->account->setMatriculation(ilUtil::stripSlashes($_POST["usr_matriculation"]));
00475 }
00476
00477
00478 if ($form_valid)
00479 {
00480
00481 $reload = false;
00482
00483 if (workWithUserSetting("skin_style"))
00484 {
00485
00486 if ($_POST["usr_skin_style"] != "")
00487 {
00488 $sknst = explode(":", $_POST["usr_skin_style"]);
00489
00490 if ($ilias->account->getPref("style") != $sknst[1] ||
00491 $ilias->account->getPref("skin") != $sknst[0])
00492 {
00493 $ilias->account->setPref("skin", $sknst[0]);
00494 $ilias->account->setPref("style", $sknst[1]);
00495 $reload = true;
00496 }
00497 }
00498 }
00499
00500 if (workWithUserSetting("language"))
00501 {
00502
00503 if ($_POST["usr_language"] != "" and $_POST["usr_language"] != $ilias->account->getLanguage())
00504 {
00505 $ilias->account->setPref("language",$_POST["usr_language"]);
00506 $reload = true;
00507 }
00508 }
00509
00510
00511 if ($_POST["usr_hits_per_page"] != "")
00512 {
00513 $ilias->account->setPref("hits_per_page",$_POST["usr_hits_per_page"]);
00514 }
00515
00516
00517 if ($_POST["show_users_online"] == "y")
00518 {
00519 $ilias->account->setPref("show_users_online", "y");
00520 }
00521 else
00522 {
00523 $ilias->account->setPref("show_users_online", "n");
00524 }
00525
00526
00527 $ilias->account->setTitle($ilias->account->getFullname());
00528 $ilias->account->setDescription($ilias->account->getEmail());
00529 $ilias->account->update();
00530
00531
00532 if ($reload)
00533 {
00534
00535 sendInfo($lng->txt("saved_successfully"));
00536 $tpl->setVariable("RELOAD","<script language=\"Javascript\">\ntop.location.href = \"./start.php\";\n</script>\n");
00537 }
00538 else
00539 {
00540
00541 if (!empty($password_error))
00542 {
00543 sendInfo($password_error,true);
00544 }
00545 elseif (!empty($upload_error))
00546 {
00547 sendInfo($upload_error,true);
00548 }
00549 else
00550 {
00551 sendInfo($lng->txt("saved_successfully"),true);
00552 }
00553
00554 ilUtil::redirect("usr_profile.php");
00555 }
00556
00557 }
00558 }
00559
00560 if (userSettingVisible("language"))
00561 {
00562
00563 $languages = $lng->getInstalledLanguages();
00564
00565
00566 $selected_lang = (isset($_POST["usr_language"])) ? $_POST["usr_language"] : $ilias->account->getLanguage();
00567
00568
00569 foreach($languages as $lang_key)
00570 {
00571 $tpl->setCurrentBlock("sel_lang");
00572 $tpl->setVariable("LANG", $lng->txt("lang_".$lang_key));
00573 $tpl->setVariable("LANGSHORT", $lang_key);
00574
00575 if ($selected_lang == $lang_key)
00576 {
00577 $tpl->setVariable("SELECTED_LANG", "selected=\"selected\"");
00578 }
00579
00580 $tpl->parseCurrentBlock();
00581 }
00582 }
00583
00584
00585 $templates = $styleDefinition->getAllTemplates();
00586
00587 if (userSettingVisible("skin_style"))
00588 {
00589 foreach($templates as $template)
00590 {
00591
00592 $styleDef =& new ilStyleDefinition($template["id"]);
00593 $styleDef->startParsing();
00594 $styles = $styleDef->getStyles();
00595
00596 foreach($styles as $style)
00597 {
00598 $tpl->setCurrentBlock("selectskin");
00599
00600 if ($ilias->account->skin == $template["id"] &&
00601 $ilias->account->prefs["style"] == $style["id"])
00602 {
00603 $tpl->setVariable("SKINSELECTED", "selected=\"selected\"");
00604 }
00605
00606 $tpl->setVariable("SKINVALUE", $template["id"].":".$style["id"]);
00607 $tpl->setVariable("SKINOPTION", $styleDef->getTemplateName()." / ".$style["name"]);
00608 $tpl->parseCurrentBlock();
00609 }
00610 }
00611 }
00612
00613
00614 $hits_options = array(2,10,15,20,30,40,50,100,9999);
00615
00616 foreach($hits_options as $hits_option)
00617 {
00618 $tpl->setCurrentBlock("selecthits");
00619
00620 if ($ilias->account->prefs["hits_per_page"] == $hits_option)
00621 {
00622 $tpl->setVariable("HITSSELECTED", "selected=\"selected\"");
00623 }
00624
00625 $tpl->setVariable("HITSVALUE", $hits_option);
00626
00627 if ($hits_option == 9999)
00628 {
00629 $hits_option = $lng->txt("no_limit");
00630 }
00631
00632 $tpl->setVariable("HITSOPTION", $hits_option);
00633 $tpl->parseCurrentBlock();
00634 }
00635
00636 if (AUTH_CURRENT == AUTH_LOCAL and userSettingVisible('password'))
00637 {
00638 if($ilias->getSetting('usr_settings_disable_password'))
00639 {
00640 $tpl->setCurrentBlock("disabled_password");
00641 $tpl->setVariable("TXT_DISABLED_PASSWORD", $lng->txt("chg_password"));
00642 $tpl->setVariable("TXT_DISABLED_CURRENT_PASSWORD", $lng->txt("current_password"));
00643 $tpl->parseCurrentBlock();
00644 }
00645 elseif ($settings["passwd_auto_generate"] == 1)
00646 {
00647 $passwd_list = ilUtil::generatePasswords(5);
00648
00649 foreach ($passwd_list as $passwd)
00650 {
00651 $passwd_choice .= ilUtil::formRadioButton(0,"new_passwd",$passwd)." ".$passwd."<br/>";
00652 }
00653
00654 $tpl->setCurrentBlock("select_password");
00655 $tpl->setVariable("TXT_CHANGE_PASSWORD", $lng->txt("chg_password"));
00656 $tpl->setVariable("TXT_CURRENT_PASSWORD", $lng->txt("current_password"));
00657 $tpl->setVariable("TXT_SELECT_PASSWORD", $lng->txt("select_password"));
00658 $tpl->setVariable("PASSWORD_CHOICE", $passwd_choice);
00659 $tpl->setVariable("TXT_NEW_LIST_PASSWORD", $lng->txt("new_list_password"));
00660 $tpl->parseCurrentBlock();
00661 }
00662 else
00663 {
00664 $tpl->setCurrentBlock("change_password");
00665 $tpl->setVariable("TXT_CHANGE_PASSWORD", $lng->txt("chg_password"));
00666 $tpl->setVariable("TXT_CURRENT_PW", $lng->txt("current_password"));
00667 $tpl->setVariable("TXT_DESIRED_PW", $lng->txt("desired_password"));
00668 $tpl->setVariable("TXT_RETYPE_PW", $lng->txt("retype_password"));
00669 $tpl->setVariable("CHANGE_PASSWORD",$lng->txt("chg_password"));
00670 $tpl->parseCurrentBlock();
00671 }
00672 }
00673
00674 $tpl->setCurrentBlock("content");
00675 $tpl->setVariable("FORMACTION", "usr_profile.php?cmd=save");
00676
00677 $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("personal_desktop"));
00678 $tpl->setVariable("TXT_OF",strtolower($lng->txt("of")));
00679 $tpl->setVariable("USR_FULLNAME",$ilias->account->getFullname());
00680
00681 $tpl->setVariable("TXT_USR_DATA", $lng->txt("userdata"));
00682 $tpl->setVariable("TXT_NICKNAME", $lng->txt("username"));
00683 $tpl->setVariable("TXT_PUBLIC_PROFILE", $lng->txt("public_profile"));
00684
00685 $data = array();
00686 $data["fields"] = array();
00687 $data["fields"]["gender"] = "";
00688 $data["fields"]["firstname"] = "";
00689 $data["fields"]["lastname"] = "";
00690 $data["fields"]["institution"] = "";
00691 $data["fields"]["department"] = "";
00692 $data["fields"]["street"] = "";
00693 $data["fields"]["city"] = "";
00694 $data["fields"]["zipcode"] = "";
00695 $data["fields"]["country"] = "";
00696 $data["fields"]["phone_office"] = "";
00697 $data["fields"]["phone_home"] = "";
00698 $data["fields"]["phone_mobile"] = "";
00699 $data["fields"]["fax"] = "";
00700 $data["fields"]["email"] = "";
00701 $data["fields"]["hobby"] = "";
00702 $data["fields"]["referral_comment"] = "";
00703 $data["fields"]["matriculation"] = "";
00704 $data["fields"]["create_date"] = "";
00705 $data["fields"]["approve_date"] = "";
00706 $data["fields"]["active"] = "";
00707
00708 $data["fields"]["default_role"] = $role;
00709
00710 foreach($data["fields"] as $key => $val)
00711 {
00712 $str = $lng->txt($key);
00713
00714
00715 if (isset($settings["require_" . $key]) && $settings["require_" . $key])
00716 {
00717 $str = $str . '<span class="asterisk">*</span>';
00718 }
00719
00720 if (userSettingVisible("$key"))
00721 {
00722 $tpl->setVariable("TXT_".strtoupper($key), $str);
00723 }
00724 }
00725
00726 if (userSettingVisible("gender"))
00727 {
00728 $tpl->setVariable("TXT_GENDER_F",$lng->txt("gender_f"));
00729 $tpl->setVariable("TXT_GENDER_M",$lng->txt("gender_m"));
00730 }
00731
00732
00733
00734
00735
00736
00737 if (userSettingVisible("upload"))
00738 {
00739 $tpl->setVariable("TXT_UPLOAD",$lng->txt("personal_picture"));
00740 $webspace_dir = ilUtil::getWebspaceDir("output");
00741 $full_img = $ilias->account->getPref("profile_image");
00742 $last_dot = strrpos($full_img, ".");
00743 $small_img = substr($full_img, 0, $last_dot).
00744 "_small".substr($full_img, $last_dot, strlen($full_img) - $last_dot);
00745 $image_file = $webspace_dir."/usr_images/".$small_img;
00746
00747 if (@is_file($image_file))
00748 {
00749 $tpl->setCurrentBlock("pers_image");
00750 $tpl->setVariable("IMG_PERSONAL", $image_file."?dummy=".rand(1,99999));
00751 $tpl->parseCurrentBlock();
00752 $tpl->setCurrentBlock("remove_pic");
00753 $tpl->setVariable("TXT_REMOVE_PIC",$lng->txt("remove_personal_picture"));
00754 $tpl->parseCurrentBlock();
00755 $tpl->setCurrentBlock("content");
00756 }
00757
00758 $tpl->setVariable("UPLOAD",$lng->txt("upload"));
00759 $tpl->setVariable("TXT_FILE", $lng->txt("userfile"));
00760 $tpl->setVariable("USER_FILE", $lng->txt("user_file"));
00761 }
00762
00763 if (userSettingVisible("language"))
00764 {
00765 $tpl->setVariable("TXT_LANGUAGE",$lng->txt("language"));
00766 }
00767 if (userSettingVisible("skin_style"))
00768 {
00769 $tpl->setVariable("TXT_USR_SKIN_STYLE",$lng->txt("usr_skin_style"));
00770 }
00771 $tpl->setVariable("TXT_USR_HITS_PER_PAGE",$lng->txt("usr_hits_per_page"));
00772 $tpl->setVariable("TXT_SHOW_USERS_ONLINE",$lng->txt("show_users_online"));
00773 $tpl->setVariable("TXT_PERSONAL_DATA", $lng->txt("personal_data"));
00774 $tpl->setVariable("TXT_SYSTEM_INFO", $lng->txt("system_information"));
00775 $tpl->setVariable("TXT_CONTACT_DATA", $lng->txt("contact_data"));
00776 if (userSettingVisible("matriculation"))
00777 {
00778 $tpl->setVariable("TXT_OTHER", $lng->txt("user_profile_other"));
00779 }
00780 $tpl->setVariable("TXT_SETTINGS", $lng->txt("settings"));
00781
00782
00783 $tpl->setVariable("NICKNAME", ilUtil::prepareFormOutput($ilias->account->getLogin()));
00784 if (userSettingVisible("firstname"))
00785 {
00786 $tpl->setVariable("FIRSTNAME", ilUtil::prepareFormOutput($ilias->account->getFirstname()));
00787 }
00788 if (userSettingVisible("lastname"))
00789 {
00790 $tpl->setVariable("LASTNAME", ilUtil::prepareFormOutput($ilias->account->getLastname()));
00791 }
00792
00793 if (userSettingVisible("gender"))
00794 {
00795
00796 $gender = strtoupper($ilias->account->getGender());
00797
00798 if (!empty($gender))
00799 {
00800 $tpl->setVariable("BTN_GENDER_".$gender,"checked=\"checked\"");
00801 }
00802 }
00803
00804 $tpl->setVariable("CREATE_DATE", $ilias->account->getCreateDate());
00805 $tpl->setVariable("APPROVE_DATE", $ilias->account->getApproveDate());
00806
00807 if ($ilias->account->getActive())
00808 {
00809 $tpl->setVariable("ACTIVE", "checked=\"checked\"");
00810 }
00811
00812 if (userSettingVisible("title"))
00813 {
00814 $tpl->setVariable("TITLE", ilUtil::prepareFormOutput($ilias->account->getUTitle()));
00815 }
00816 if (userSettingVisible("institution"))
00817 {
00818 $tpl->setVariable("INSTITUTION", ilUtil::prepareFormOutput($ilias->account->getInstitution()));
00819 }
00820 if (userSettingVisible("department"))
00821 {
00822 $tpl->setVariable("DEPARTMENT", ilUtil::prepareFormOutput($ilias->account->getDepartment()));
00823 }
00824 if (userSettingVisible("street"))
00825 {
00826 $tpl->setVariable("STREET", ilUtil::prepareFormOutput($ilias->account->getStreet()));
00827 }
00828 if (userSettingVisible("zipcode"))
00829 {
00830 $tpl->setVariable("ZIPCODE", $ilias->account->getZipcode());
00831 }
00832 if (userSettingVisible("city"))
00833 {
00834 $tpl->setVariable("CITY", ilUtil::prepareFormOutput($ilias->account->getCity()));
00835 }
00836 if (userSettingVisible("country"))
00837 {
00838 $tpl->setVariable("COUNTRY", ilUtil::prepareFormOutput($ilias->account->getCountry()));
00839 }
00840 if (userSettingVisible("phone_office"))
00841 {
00842 $tpl->setVariable("PHONE_OFFICE", $ilias->account->getPhoneOffice());
00843 }
00844 if (userSettingVisible("phone_home"))
00845 {
00846 $tpl->setVariable("PHONE_HOME", $ilias->account->getPhoneHome());
00847 }
00848 if (userSettingVisible("phone_mobile"))
00849 {
00850 $tpl->setVariable("PHONE_MOBILE", $ilias->account->getPhoneMobile());
00851 }
00852 if (userSettingVisible("fax"))
00853 {
00854 $tpl->setVariable("FAX", $ilias->account->getFax());
00855 }
00856 if (userSettingVisible("email"))
00857 {
00858 $tpl->setVariable("EMAIL", $ilias->account->getEmail());
00859 }
00860 if (userSettingVisible("hobby"))
00861 {
00862 $tpl->setVariable("HOBBY", ilUtil::stripSlashes($ilias->account->getHobby()));
00863 }
00864 if (userSettingVisible("referral_comment"))
00865 {
00866 $tpl->setVariable("REFERRAL_COMMENT", ilUtil::stripSlashes($ilias->account->getComment()));
00867 }
00868 if (userSettingVisible("matriculation"))
00869 {
00870 $tpl->setVariable("MATRICULATION", $ilias->account->getMatriculation());
00871 }
00872
00873
00874 $global_roles = $rbacreview->getGlobalRoles();
00875
00876 foreach($global_roles as $role_id)
00877 {
00878 if (in_array($role_id,$_SESSION["RoleId"]))
00879 {
00880 $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
00881 $role_names .= $roleObj->getTitle().", ";
00882 unset($roleObj);
00883 }
00884 }
00885
00886 $tpl->setVariable("TXT_DEFAULT_ROLES",$lng->txt("default_roles"));
00887 $tpl->setVariable("DEFAULT_ROLES",substr($role_names,0,-2));
00888
00889 $tpl->setVariable("TXT_REQUIRED_FIELDS",$lng->txt("required_field"));
00890
00891 $tpl->setVariable("TXT_SAVE",$lng->txt("save"));
00892
00893 if (userSettingVisible("upload"))
00894 {
00895 $tpl->setVariable("UPLOAD", $lng->txt("upload"));
00896 }
00897
00898
00899
00900
00901 if ($ilias->account->prefs["public_profile"]=="y")
00902 {
00903 $tpl->setVariable("CHK_PUB","checked");
00904 }
00905
00906 $val_array = array("institution", "department", "upload", "street",
00907 "zip", "city", "country", "phone_office", "phone_home", "phone_mobile",
00908 "fax", "email", "hobby", "matriculation");
00909
00910 foreach($val_array as $key => $value)
00911 {
00912 if (userSettingVisible("$value"))
00913 {
00914 if ($ilias->account->prefs["public_".$value] == "y")
00915 {
00916 $tpl->setVariable("CHK_".strtoupper($value), "checked");
00917 }
00918 }
00919 }
00920
00921
00922
00923 if ($ilias->account->prefs["show_users_online"] == "y")
00924 {
00925 $tpl->setVariable("CHK_SHOW_USERS_ONLINE", "checked");
00926 }
00927
00928 $profile_fields = array(
00929 "gender",
00930 "firstname",
00931 "lastname",
00932 "title",
00933 "upload",
00934 "institution",
00935 "department",
00936 "street",
00937 "city",
00938 "zipcode",
00939 "country",
00940 "phone_office",
00941 "phone_home",
00942 "phone_mobile",
00943 "fax",
00944 "email",
00945 "hobby",
00946 "matriculation",
00947 "referral_comment",
00948 "language",
00949 "skin_style"
00950 );
00951 foreach ($profile_fields as $field)
00952 {
00953 if (!$ilias->getSetting("usr_settings_hide_" . $field))
00954 {
00955 if ($ilias->getSetting("usr_settings_disable_" . $field))
00956 {
00957 $tpl->setVariable("DISABLED_" . strtoupper($field), " disabled=\"disabled\"");
00958 }
00959 }
00960 }
00961
00962 $tpl->parseCurrentBlock();
00963 $tpl->show();
00964 ?>