101        $this->tabs = 
$DIC->tabs();
 
  102        $this->
user = $DIC->user();
 
  103        $this->lng = 
$DIC->language();
 
  104        $this->setting = 
$DIC->settings();
 
  105        $this->tpl = 
$DIC->ui()->mainTemplate();
 
  106        $this->ctrl = 
$DIC->ctrl();
 
  107        $this->errorHandler = 
$DIC[
'ilErr'];
 
  108        $this->eventHandler = 
$DIC[
'ilAppEventHandler'];
 
  119        include_once 
'./Services/User/classes/class.ilUserDefinedFields.php';
 
  122        $this->lng->loadLanguageModule(
"jsmath");
 
  123        $this->lng->loadLanguageModule(
"pd");
 
  124        $this->upload_error = 
"";
 
  125        $this->password_error = 
"";
 
  126        $this->lng->loadLanguageModule(
"user");
 
  127        $this->ctrl->saveParameter($this, 
"prompted");
 
  134        $this->ui_factory = 
$DIC[
'ui.factory'];
 
  135        $this->ui_renderer = 
$DIC[
'ui.renderer'];
 
  136        $this->auth_session = 
$DIC[
'ilAuthSession'];
 
  148        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  150        $ilTabs = 
$DIC[
'ilTabs'];
 
  152        $next_class = $this->ctrl->getNextClass();
 
  154        switch ($next_class) {
 
  155            case "ilpublicuserprofilegui":
 
  156                include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
 
  159                $pub_profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, 
"showPersonalData"));
 
  160                $ilCtrl->forwardCommand($pub_profile_gui);
 
  161                $tpl->printToStdout();
 
  164            case "iluserprivacysettingsgui":
 
  167                $ilTabs->activateTab(
"visibility_settings");
 
  170                $ilCtrl->forwardCommand($gui);
 
  175                $cmd = $this->ctrl->getCmd(
"showPersonalData");
 
  189        return $this->user_settings_config->isVisibleAndChangeable($setting);
 
  198        return $this->user_settings_config->isVisible($setting);
 
  207        return $this->user_settings_config->isChangeable($setting);
 
  220            if (!$this->form->hasFileUpload(
"userfile")) {
 
  221                if ($this->form->getItemByPostVar(
"userfile")->getDeletionFlag()) {
 
  227                $image_dir = $webspace_dir . 
"/usr_images";
 
  228                $store_file = 
"usr_" . 
$ilUser->getID() . 
"." . 
"jpg";
 
  231                $ilUser->setPref(
"profile_image", $store_file);
 
  236                $pi = pathinfo($_FILES[
"userfile"][
"name"]);
 
  237                $uploaded_file = $this->form->moveFileUpload(
 
  240                    "upload_" . 
$ilUser->getId() . 
"." . $pi[
"extension"]
 
  242                if (!$uploaded_file) {
 
  244                    $this->ctrl->redirect($this, 
"showProfile");
 
  246                chmod($uploaded_file, 0770);
 
  250                $show_file = 
"$image_dir/usr_" . 
$ilUser->getId() . 
".jpg";
 
  251                $thumb_file = 
"$image_dir/usr_" . 
$ilUser->getId() . 
"_small.jpg";
 
  252                $xthumb_file = 
"$image_dir/usr_" . 
$ilUser->getId() . 
"_xsmall.jpg";
 
  253                $xxthumb_file = 
"$image_dir/usr_" . 
$ilUser->getId() . 
"_xxsmall.jpg";
 
  261                    ilUtil::execConvert($uploaded_file . 
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:" . $show_file);
 
  262                    ilUtil::execConvert($uploaded_file . 
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:" . $thumb_file);
 
  263                    ilUtil::execConvert($uploaded_file . 
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:" . $xthumb_file);
 
  264                    ilUtil::execConvert($uploaded_file . 
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:" . $xxthumb_file);
 
  266                    ilUtil::execConvert($uploaded_file . 
"[0] -geometry 200x200 -quality 100 JPEG:" . $show_file);
 
  267                    ilUtil::execConvert($uploaded_file . 
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
 
  268                    ilUtil::execConvert($uploaded_file . 
"[0] -geometry 75x75 -quality 100 JPEG:" . $xthumb_file);
 
  269                    ilUtil::execConvert($uploaded_file . 
"[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
 
  309        if ((
$_POST[
"chk_pub"]) == 
"on") {
 
  310            $ilUser->setPref(
"public_profile", 
"y");
 
  312            $ilUser->setPref(
"public_profile", 
"n");
 
  316        $val_array = array(
"institution", 
"department", 
"upload", 
"street",
 
  317            "zip", 
"city", 
"country", 
"phone_office", 
"phone_home", 
"phone_mobile",
 
  318            "fax", 
"email", 
"second_email", 
"hobby", 
"matriculation");
 
  321        foreach ($val_array as $key => $value) {
 
  322            if ((
$_POST[
"chk_" . $value]) == 
"on") {
 
  323                $ilUser->setPref(
"public_" . $value, 
"y");
 
  325                $ilUser->setPref(
"public_" . $value, 
"n");
 
  330        foreach ($this->
settings as $key => $val) {
 
  331            if (substr($key, 0, 8) == 
"require_") {
 
  332                $require_keys[] = substr($key, 8);
 
  336        foreach ($require_keys as $key => $val) {
 
  338            $system_fields = array(
"login", 
"default_role", 
"passwd", 
"passwd2");
 
  339            if (!in_array($val, $system_fields)) {
 
  341                    if (isset($this->
settings[
"require_" . $val]) && $this->
settings[
"require_" . $val]) {
 
  342                        if (empty(
$_POST[
"usr_" . $val])) {
 
  343                            ilUtil::sendFailure($this->lng->txt(
"fill_out_all_required_fields") . 
": " . $this->lng->txt($val));
 
  442                if (
$_POST[
"usr_skin_style"] != 
"") {
 
  443                    $sknst = explode(
":", 
$_POST[
"usr_skin_style"]);
 
  445                    if (
$ilUser->getPref(
"style") != $sknst[1] ||
 
  446                        $ilUser->getPref(
"skin") != $sknst[0]) {
 
  447                        $ilUser->setPref(
"skin", $sknst[0]);
 
  448                        $ilUser->setPref(
"style", $sknst[1]);
 
  467                if (
$_POST[
"hits_per_page"] != 
"") {
 
  480                if (
$_POST[
"chk_hide_own_online_status"] != 
"") {
 
  481                    $ilUser->setPref(
"hide_own_online_status", 
"y");
 
  483                    $ilUser->setPref(
"hide_own_online_status", 
"n");
 
  500            $ilUser->setProfileIncomplete(
false);
 
  509            include_once 
'./Services/Search/classes/Lucene/class.ilLuceneIndexer.php';
 
  515            if (!empty($this->password_error)) {
 
  517            } elseif (!empty($this->upload_error)) {
 
  521                ilUtil::sendSuccess($this->lng->txt(
"saved_successfully"), 
true);
 
  522                $this->ctrl->redirect($this, 
"");
 
  524                ilUtil::sendSuccess($this->lng->txt(
"saved_successfully"), 
true);
 
  543        $this->tabs->clearTargets();
 
  544        $this->tabs->clearSubTabs();
 
  546        $tpl = new \ilTemplate(
'tpl.view_terms_of_service.html', 
true, 
true, 
'Services/Init');
 
  548        $this->tpl->setTitle($this->lng->txt(
'usr_agreement'));
 
  551        if (!$this->
user->isAnonymous() && (
int) $this->user->getId() > 0 && $this->user->getAgreeDate()) {
 
  552            $helper = new \ilTermsOfServiceHelper();
 
  554            $entity = $helper->getCurrentAcceptanceForUser($this->
user);
 
  555            if ($entity->getId()) {
 
  556                $noAgreement = 
false;
 
  557                $tpl->setVariable(
'TERMS_OF_SERVICE_CONTENT', $entity->getText());
 
  561            if ($handleDocument) {
 
  562                $noAgreement = 
false;
 
  563                $document = $this->termsOfServiceEvaluation->document();
 
  564                $tpl->setVariable(
'TERMS_OF_SERVICE_CONTENT', $document->content());
 
  570                'TERMS_OF_SERVICE_CONTENT',
 
  572                    $this->lng->txt(
'no_agreement_description'),
 
  578        $this->tpl->setContent(
$tpl->get());
 
  579        $this->tpl->setPermanentLink(
'usr', 
null, 
'agreement');
 
  580        $this->tpl->printToStdout();
 
  586            !$this->
user->getPref(
'consent_withdrawal_requested') ||
 
  587            !$this->termsOfServiceHelper->isIncludedUser($this->user)
 
  589            $this->errorHandler->raiseError($this->lng->txt(
'permission_denied'), $this->errorHandler->MESSAGE);
 
  592        $this->tabs->clearTargets();
 
  593        $this->tabs->clearSubTabs();
 
  594        $this->tpl->setTitle($this->lng->txt(
'refuse_tos_acceptance'));
 
  597        $content = $tosWithdrawalGui->getConsentWithdrawalConfirmation($this);
 
  599        $this->tpl->setContent($content);
 
  600        $this->tpl->setPermanentLink(
'usr', 
null, 
'agreement');
 
  601        $this->tpl->printToStdout();
 
  606        if (!$this->termsOfServiceHelper->isIncludedUser($this->user)) {
 
  607            $this->errorHandler->raiseError($this->lng->txt(
'permission_denied'), $this->errorHandler->MESSAGE);
 
  610        $this->
user->deletePref(
'consent_withdrawal_requested');
 
  615            $this->ctrl->redirectToUrl($target);
 
  617            ilInitialisation::redirectToStartingPage();
 
  624            !$this->
user->getPref(
'consent_withdrawal_requested') ||
 
  625            !$this->termsOfServiceHelper->isIncludedUser($this->user)
 
  627            $this->errorHandler->raiseError($this->lng->txt(
'permission_denied'), $this->errorHandler->MESSAGE);
 
  629        $this->termsOfServiceHelper->resetAcceptance($this->
user);
 
  632        if ($this->setting->get(
'auth_mode')) {
 
  633            $defaultAuth = $this->setting->get(
'auth_mode');
 
  639            ($this->user->getAuthMode() === 
'default' && $defaultAuth == 
AUTH_LDAP)
 
  642        } elseif ((
bool) $this->setting->get(
'tos_withdrawal_usr_deletion', 
false)) {
 
  647        $this->eventHandler->raise(
 
  648            'Services/TermsOfService',
 
  649            'ilTermsOfServiceEventWithdrawn',
 
  650            [
'event' => $domainEvent]
 
  654        $this->auth_session->logout();
 
  656        $this->ctrl->redirectToUrl(
'login.php?tos_withdrawal_type=' . $withdrawalType . 
'&cmd=force_login');
 
  669        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  672        include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
 
  678        $this->lng->loadLanguageModule(
"maps");
 
  686        if ($latitude == 0 && $longitude == 0 && $zoom == 0) {
 
  688            $latitude = $def[
"latitude"];
 
  689            $longitude = $def[
"longitude"];
 
  690            $zoom = $def[
"zoom"];
 
  695            $street = $this->lng->txt(
"street");
 
  699            $city = $this->lng->txt(
"city");
 
  703            $country = $this->lng->txt(
"country");
 
  708            $this->lng->txt(
"location"),
 
  711        $loc_prop->setLatitude($latitude);
 
  712        $loc_prop->setLongitude($longitude);
 
  713        $loc_prop->setZoom($zoom);
 
  714        $loc_prop->setAddress($street . 
"," . $city . 
"," . $country);
 
  724        $ilTabs = 
$DIC[
'ilTabs'];
 
  725        $ilHelp = 
$DIC[
'ilHelp'];
 
  727        $ilHelp->setScreenIdComponent(
"user");
 
  732            $this->lng->txt(
"user_profile_data"),
 
  733            $this->ctrl->getLinkTarget($this, 
"showPersonalData")
 
  739            $this->lng->txt(
"user_publish_options"),
 
  740            $this->ctrl->getLinkTarget($this, 
"showPublicProfile")
 
  744        $txt_visibility = $this->checklist_status->anyVisibilitySettings()
 
  745            ? $this->lng->txt(
"user_visibility_settings")
 
  746            : $this->lng->txt(
"preview");
 
  748            "visibility_settings",
 
  750            $this->ctrl->getLinkTargetByClass(
"ilUserPrivacySettingsGUI", 
"")
 
  756            $this->lng->txt(
"export") . 
"/" . $this->lng->txt(
"import"),
 
  757            $this->ctrl->getLinkTarget($this, 
"showExportImport")
 
  765        if ($this->
userSettingVisible(
"matriculation") or count($this->user_defined_fields->getVisibleDefinitions())
 
  766            or $d_set->get(
"user_profile") == 
"1") {
 
  778        $user_defined_data = 
$ilUser->getUserDefinedData();
 
  779        foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
 
  781                $this->tpl->setCurrentBlock(
"field_text");
 
  783                if (!$definition[
'changeable']) {
 
  784                    $this->tpl->setVariable(
"DISABLED_FIELD", 
'disabled=\"disabled\"');
 
  785                    $this->tpl->setVariable(
"FIELD_NAME", 
'udf[' . $definition[
'field_id'] . 
']');
 
  787                    $this->tpl->setVariable(
"FIELD_NAME", 
'udf[' . $definition[
'field_id'] . 
']');
 
  789                $this->tpl->parseCurrentBlock();
 
  791                if ($definition[
'changeable']) {
 
  792                    $name = 
'udf[' . $definition[
'field_id'] . 
']';
 
  798                $this->tpl->setCurrentBlock(
"field_select");
 
  800                    $user_defined_data[$field_id],
 
  802                    $this->user_defined_fields->fieldValuesToSelectArray(
 
  803                        $definition[
'field_values']
 
  812                $this->tpl->parseCurrentBlock();
 
  814            $this->tpl->setCurrentBlock(
"user_defined");
 
  816            if ($definition[
'required']) {
 
  817                $name = $definition[
'field_name'] . 
"<span class=\"asterisk\">*</span>";
 
  819                $name = $definition[
'field_name'];
 
  821            $this->tpl->setVariable(
"TXT_FIELD_NAME", 
$name);
 
  822            $this->tpl->parseCurrentBlock();
 
  829        foreach ($this->user_defined_fields->getVisibleDefinitions() as $definition) {
 
  830            $field_id = $definition[
'field_id'];
 
  831            if ($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id])) {
 
  843        $this->tpl->setTitle($this->lng->txt(
'personal_profile'));
 
  861        $ilTabs = 
$DIC[
'ilTabs'];
 
  864        $ilTabs->activateTab(
"personal_data");
 
  868        if (
$_GET[
"prompted"] == 1) {
 
  869            $it = $prompt_service->data()->getSettings()->getPromptText(
$ilUser->getLanguage());
 
  872            $it = $prompt_service->data()->getSettings()->getInfoText(
$ilUser->getLanguage());
 
  874        if (trim($it) !== 
"") {
 
  875            $pub_prof = in_array(
$ilUser->prefs[
"public_profile"], array(
"y", 
"n", 
"g"))
 
  876                ? 
$ilUser->prefs[
"public_profile"]
 
  878            $box = 
$DIC->ui()->factory()->messageBox()->info($it);
 
  879            if ($pub_prof === 
"n") {
 
  880                $box = $box->withLinks(
 
  881                    [
$DIC->ui()->factory()->link()->standard(
 
  882                        $lng->txt(
"user_make_profile_public"),
 
  883                        $ctrl->getLinkTarget($this, 
"showPublicProfile")
 
  887            $it = 
$DIC->ui()->renderer()->render($box);
 
  896            if (
$ilUser->getProfileIncomplete()) {
 
  902        if ($this->email_change_confirmation_modal !== 
null) {
 
  903            $modal = $this->ui_renderer->render($this->email_change_confirmation_modal);
 
  906        $this->tpl->setContent($it . $this->form->getHTML() . $modal);
 
  907        $this->tpl->printToStdout();
 
  920        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  921        $this->form->setId(self::PERSONAL_DATA_FORM_ID);
 
  924        $user_defined_data = 
$ilUser->getUserDefinedData();
 
  927        foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
 
  928            $value = $user_defined_data[
"f_" . $field_id];
 
  930            include_once 
'./Services/User/classes/class.ilCustomUserFieldsHelper.php';
 
  933                $definition[
'changeable'],
 
  937                $this->input[
'udf_' . $definition[
'field_id']] = $fprop;
 
  942        include_once(
"./Services/User/classes/class.ilUserProfile.php");
 
  944        $up->skipField(
"password");
 
  945        $up->skipGroup(
"settings");
 
  946        $up->skipGroup(
"preferences");
 
  948        $up->setAjaxCallback(
 
  949            $this->ctrl->getLinkTargetByClass(
'ilPublicUserProfileGUI', 
'doProfileAutoComplete', 
'', 
true)
 
  953        $up->addStandardFieldsToForm($this->form, 
$ilUser, $this->input);
 
  957        $this->form->addCommandButton(
"savePersonalData", 
$lng->txt(
"user_save_continue"));
 
  968        if (!$this->form->checkInput()
 
  969            || !$this->emailCompletionForced()
 
  970                && $this->emailChanged()
 
  971                && $this->addEmailChangeModal()
 
  972            || $this->loginChanged() && !$this->updateLoginOrSetErrorMessages()) {
 
  973            $this->form->setValuesByPost();
 
  980        $this->tpl->setOnScreenMessage(
'success', $this->lng->txt(
"msg_obj_modified"), 
true);
 
  982        $this->ctrl->redirect($this, 
"showPublicProfile");
 
  987        $email_input = $this->form->getItemByPostVar(
'usr_email');
 
  988        if ($email_input !== 
null 
  989            && $email_input !== 
false 
  990            && !$email_input->getDisabled()
 
  991            && $this->form->getInput(
'usr_email') !== $this->user->getEmail()) {
 
 1000        $current_email = $this->
user->getEmail();
 
 1002            $this->
user->getProfileIncomplete()
 
 1003            && $this->setting->get(
'require_email') === 
'1' 
 1004            && ($current_email === 
null || $current_email === 
'')
 
 1015        $modal = $this->ui_factory->modal()->interruptive(
 
 1016            $this->lng->txt(
'confirm'),
 
 1017            $this->lng->txt(
'confirm_logout_for_email_change'),
 
 1019        )->withActionButtonLabel(
'change');
 
 1020        $this->email_change_confirmation_modal = $modal->withOnLoad($modal->getShowSignal())
 
 1021            ->withAdditionalOnLoadCode(
 
 1022                static function ($id) use ($form_id) {
 
 1023                    return "var button = {$id}.querySelector('input[type=\"submit\"]'); " 
 1024                    . 
"button.addEventListener('click', (e) => {e.preventDefault();" 
 1025                    . 
"document.getElementById('{$form_id}').submit();});";
 
 1029        $this->form->setFormAction($this->ctrl->getFormActionByClass(self::class, 
'goToEmailConfirmation'));
 
 1035        $login = $this->form->getInput(
'username');
 
 1036        if ((
int) $this->setting->get(
'allow_change_loginname')
 
 1037           && 
$login !== $this->user->getLogin()) {
 
 1046        $login = $this->form->getInput(
'username');
 
 1048            $this->tpl->setOnScreenMessage(
'failure', $this->lng->txt(
'form_input_not_valid'));
 
 1049            $this->form->getItemByPostVar(
'username')->setAlert($this->lng->txt(
'login_invalid'));
 
 1054            $this->tpl->setOnScreenMessage(
'failure', $this->lng->txt(
'form_input_not_valid'));
 
 1055            $this->form->getItemByPostVar(
'username')->setAlert($this->lng->txt(
'loginname_already_exists'));
 
 1062            $this->
user->updateLogin($this->
user->getLogin());
 
 1065            $this->tpl->setOnScreenMessage(
'failure', $this->lng->txt(
'form_input_not_valid'));
 
 1066            $this->form->getItemByPostVar(
'username')->setAlert(
$e->getMessage());
 
 1074        if (!$this->form->checkInput()
 
 1075            || $this->loginChanged() && !$this->updateLoginOrSetErrorMessages()) {
 
 1076            $this->form->setValuesByPost();
 
 1083        $this->auth_session->logout();
 
 1085        $token = $this->change_mail_token_repo->getNewTokenForUser($this->
user, $this->form->getInput(
'usr_email'));
 
 1086        $this->ctrl->redirectToURL(
'login.php?cmd=force_login&target=usr_' . self::CHANGE_EMAIL_CMD . 
$token);
 
 1093            "firstname" => 
"FirstName",
 
 1094            "lastname" => 
"LastName",
 
 1095            "title" => 
"UTitle",
 
 1096            "sel_country" => 
"SelectedCountry",
 
 1097            "phone_office" => 
"PhoneOffice",
 
 1098            "phone_home" => 
"PhoneHome",
 
 1099            "phone_mobile" => 
"PhoneMobile",
 
 1100            "referral_comment" => 
"Comment",
 
 1101            "interests_general" => 
"GeneralInterests",
 
 1102            "interests_help_offered" => 
"OfferingHelp",
 
 1103            "interests_help_looking" => 
"LookingForHelp" 
 1106        foreach (array_keys($up->getStandardFields()) as 
$f) {
 
 1108            $item = $this->form->getItemByPostVar(
"usr_" . 
$f);
 
 1109            if (!$item || $item->getDisabled()) {
 
 1113            $value = $this->form->getInput(
"usr_" . 
$f);
 
 1117                        $this->
user->setEmail($value);
 
 1122                    $value = $item->getDate();
 
 1123                    $this->
user->setBirthday($value
 
 1127                case "second_email":
 
 1128                    $this->
user->setSecondEmail($value);
 
 1131                    $m = $map[
$f] ?? ucfirst(
$f);
 
 1132                    $this->
user->{
"set" . $m}($value);
 
 1136        $this->
user->setFullname();
 
 1141            $location = $this->form->getInput(
"location");
 
 1145            $this->
user->setLatitude(is_numeric($lat) ? $lat : 
null);
 
 1146            $this->
user->setLongitude(is_numeric($long) ? $long : 
null);
 
 1147            $this->
user->setLocationZoom(is_numeric($zoom) ? $zoom : 
null);
 
 1151        $defs = $this->user_defined_fields->getVisibleDefinitions();
 
 1153        foreach ($defs as $definition) {
 
 1154            $f = 
"udf_" . $definition[
'field_id'];
 
 1155            $item = $this->form->getItemByPostVar(
$f);
 
 1156            if ($item && !$item->getDisabled()) {
 
 1157                $udf[$definition[
'field_id']] = $this->form->getInput(
$f);
 
 1160        $this->
user->setUserDefinedData($udf);
 
 1165        $this->
user->setProfileIncomplete(
false);
 
 1168        $this->
user->setTitle($this->
user->getFullname());
 
 1169        $this->
user->setDescription($this->
user->getEmail());
 
 1171        $this->
user->update();
 
 1177        $new_email = $this->change_mail_token_repo->getNewEmailForUser($this->
user, 
$token);
 
 1179        if ($new_email !== 
'') {
 
 1180            $this->
user->setEmail($new_email);
 
 1181            $this->
user->update();
 
 1182            $this->change_mail_token_repo->deleteEntryByToken(
$token);
 
 1183            $this->tpl->setOnScreenMessage(
 
 1185                $this->lng->txt(
'saved_successfully')
 
 1187            $this->showPublicProfile();
 
 1191        $this->tpl->setOnScreenMessage(
'failure', $this->lng->txt(
'email_could_not_be_changed'));
 
 1192        $this->showPublicProfile();
 
 1206        $ilTabs = $this->tabs;
 
 1208        $ilTabs->activateTab(
"public_profile");
 
 1214            $this->initPublicProfileForm();
 
 1217        $this->tpl->setContent($this->form->getHTML());
 
 1218        $this->tpl->printToStdout();
 
 1234            include_once 
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
 
 1252        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1255        $this->form->setTitle(
$lng->txt(
"user_publish_options"));
 
 1256        $this->form->setDescription(
$lng->txt(
"user_public_profile_info"));
 
 1257        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1259        $portfolio_id = $this->getProfilePortfolio();
 
 1261        if (!$portfolio_id) {
 
 1264            $info = $this->lng->txt(
"user_activate_public_profile_info");
 
 1266            $pub_prof = $profile_mode->getMode();
 
 1267            $radg->setValue($pub_prof);
 
 1268            $op1 = 
new ilRadioOption(
$lng->txt(
"usr_public_profile_disabled"), 
"n", 
$lng->txt(
"usr_public_profile_disabled_info"));
 
 1269            $radg->addOption($op1);
 
 1271            $radg->addOption($op2);
 
 1272            if (
$ilSetting->get(
'enable_global_profiles')) {
 
 1274                $radg->addOption($op3);
 
 1276            $this->form->addItem($radg);
 
 1281                $prtf = 
"<br />" . 
$lng->txt(
"user_profile_portfolio");
 
 1282                $prtf .= 
"<br /><a href=\"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToPortfolio\">» " .
 
 1283                    $lng->txt(
"user_portfolios") . 
"</a>";
 
 1287            $radg->setInfo($info);
 
 1289            $prtf = 
$lng->txt(
"user_profile_portfolio_selected");
 
 1290            $prtf .= 
"<br /><a href=\"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToPortfolio&prt_id=" . $portfolio_id . 
"\">» " .
 
 1291                $lng->txt(
"portfolio") . 
"</a>";
 
 1294            $info->setHTML($prtf);
 
 1295            $this->form->addItem($info);
 
 1296            $this->showPublicProfileFields($this->form, 
$ilUser->prefs);
 
 1299        if (is_object($op2)) {
 
 1300            $this->showPublicProfileFields($this->form, 
$ilUser->prefs, $op2, 
false, 
"-1");
 
 1302        if (is_object($op3)) {
 
 1303            $this->showPublicProfileFields($this->form, 
$ilUser->prefs, $op3, 
false, 
"-2");
 
 1305        $this->form->setForceTopButtons(
true);
 
 1306        $this->form->addCommandButton(
"savePublicProfile", 
$lng->txt(
"user_save_continue"));
 
 1318        ilPropertyformGUI $form,
 
 1321        $anonymized = 
false,
 
 1328        $birthday = 
$ilUser->getBirthday();
 
 1332        $gender = 
$ilUser->getGender();
 
 1334            $gender = $this->lng->txt(
"gender_" . $gender);
 
 1337        if (
$ilUser->getSelectedCountry() != 
"") {
 
 1338            $this->lng->loadLanguageModule(
"meta");
 
 1339            $txt_sel_country = $this->lng->txt(
"meta_c_" . 
$ilUser->getSelectedCountry());
 
 1345            $pic = 
"<img src=\"" . $pic . 
"\" />";
 
 1350            "title" => 
$ilUser->getUTitle(),
 
 1351            "birthday" => $birthday,
 
 1352            "gender" => $gender,
 
 1354            "interests_general" => 
$ilUser->getGeneralInterestsAsText(),
 
 1355            "interests_help_offered" => 
$ilUser->getOfferingHelpAsText(),
 
 1356            "interests_help_looking" => 
$ilUser->getLookingForHelpAsText(),
 
 1357            "org_units" => 
$ilUser->getOrgUnitsRepresentation(),
 
 1358            "institution" => 
$ilUser->getInstitution(),
 
 1359            "department" => 
$ilUser->getDepartment(),
 
 1360            "street" => 
$ilUser->getStreet(),
 
 1361            "zipcode" => 
$ilUser->getZipcode(),
 
 1363            "country" => 
$ilUser->getCountry(),
 
 1364            "sel_country" => $txt_sel_country,
 
 1365            "phone_office" => 
$ilUser->getPhoneOffice(),
 
 1366            "phone_home" => 
$ilUser->getPhoneHome(),
 
 1367            "phone_mobile" => 
$ilUser->getPhoneMobile(),
 
 1369            "email" => 
$ilUser->getEmail(),
 
 1370            "second_email" => 
$ilUser->getSecondEmail(),
 
 1371            "hobby" => 
$ilUser->getHobby(),
 
 1372            "matriculation" => 
$ilUser->getMatriculation()
 
 1376        include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
 
 1378            $val_array[
"location"] = ((int) 
$ilUser->getLatitude() + (int) 
$ilUser->getLongitude() + (int) 
$ilUser->getLocationZoom() > 0)
 
 1382        foreach ($val_array as $key => $value) {
 
 1383            if (in_array($value, [
"", 
"-"]) && !$anonymized) {
 
 1390            if ($this->userSettingVisible($key)) {
 
 1394                        $caption = 
"personal_picture";
 
 1398                        $caption = 
"person_title";
 
 1404                $cb = 
new ilCheckboxInputGUI($this->lng->txt($caption), 
"chk_" . $key . $key_suffix);
 
 1405                if ($prefs[
"public_" . $key] == 
"y") {
 
 1406                    $cb->setChecked(
true);
 
 1409                $cb->setOptionTitle($value);
 
 1412                    $form->addItem($cb);
 
 1414                    $parent->addSubItem($cb);
 
 1420        $user_defined_data = array();
 
 1422            $user_defined_data = 
$ilUser->getUserDefinedData();
 
 1424        foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
 
 1426            $cb = 
new ilCheckboxInputGUI($definition[
"field_name"], 
"chk_udf_" . $definition[
"field_id"]);
 
 1427            $cb->setOptionTitle($user_defined_data[
"f_" . $definition[
"field_id"]]);
 
 1428            if ($prefs[
"public_udf_" . $definition[
"field_id"]] == 
"y") {
 
 1429                $cb->setChecked(
true);
 
 1433                $form->addItem($cb);
 
 1435                $parent->addSubItem($cb);
 
 1440            include_once 
"Services/Badge/classes/class.ilBadgeHandler.php";
 
 1442            if ($handler->isActive()) {
 
 1443                $badge_options = array();
 
 1445                include_once 
"Services/Badge/classes/class.ilBadgeAssignment.php";
 
 1446                include_once 
"Services/Badge/classes/class.ilBadge.php";
 
 1449                    if ($ass->getPosition()) {
 
 1450                        $badge = 
new ilBadge($ass->getBadgeId());
 
 1451                        $badge_options[] = $badge->getTitle();
 
 1455                if (
sizeof($badge_options) > 1) {
 
 1457                    $badge_order->setMultiValues($badge_options);
 
 1458                    $badge_order->setValue(array_shift($badge_options));
 
 1459                    $badge_order->setMulti(
true, 
true, 
false);
 
 1462                        $form->addItem($badge_order);
 
 1464                        $parent->addSubItem($badge_order);
 
 1474            $form->addItem($ne);
 
 1476            $parent->addSubItem($ne);
 
 1490        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1493        $this->initPublicProfileForm();
 
 1494        if ($this->form->checkInput()) {
 
 1496            if (isset(
$_POST[
"public_profile"])) {
 
 1497                $ilUser->setPref(
"public_profile", 
$_POST[
"public_profile"]);
 
 1501            $val_array = array(
"title", 
"birthday", 
"gender", 
"org_units", 
"institution", 
"department", 
"upload",
 
 1502                "street", 
"zipcode", 
"city", 
"country", 
"sel_country", 
"phone_office", 
"phone_home", 
"phone_mobile",
 
 1503                "fax", 
"email", 
"second_email", 
"hobby", 
"matriculation", 
"location",
 
 1504                "interests_general", 
"interests_help_offered", 
"interests_help_looking");
 
 1507            $checked_values = $this->getCheckedValues();
 
 1508            foreach ($val_array as $key => $value) {
 
 1509                if (($checked_values[
"chk_" . $value])) {
 
 1510                    $ilUser->setPref(
"public_" . $value, 
"y");
 
 1512                    $ilUser->setPref(
"public_" . $value, 
"n");
 
 1517            foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
 
 1518                if (($checked_values[
"chk_udf_" . $definition[
"field_id"]])) {
 
 1519                    $ilUser->setPref(
"public_udf_" . $definition[
"field_id"], 
"y");
 
 1521                    $ilUser->setPref(
"public_udf_" . $definition[
"field_id"], 
"n");
 
 1527            switch (
$_POST[
"public_profile"]) {
 
 1536            include_once 
"Services/Badge/classes/class.ilBadgeHandler.php";
 
 1538            if ($handler->isActive()) {
 
 1539                $badgePositions = [];
 
 1540                if (isset(
$_POST[
"bpos" . $key_suffix]) && is_array(
$_POST[
"bpos" . $key_suffix])) {
 
 1541                    $badgePositions = 
$_POST[
"bpos" . $key_suffix];
 
 1544                if (count($badgePositions) > 0) {
 
 1545                    include_once 
"Services/Badge/classes/class.ilBadgeAssignment.php";
 
 1551            include_once 
'./Services/Search/classes/Lucene/class.ilLuceneIndexer.php';
 
 1554            ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
 1562            } elseif ($redirect = 
$_SESSION[
'profile_complete_redirect']) {
 
 1563                unset(
$_SESSION[
'profile_complete_redirect']);
 
 1566                $ilCtrl->redirectByClass(
"iluserprivacysettingsgui", 
"");
 
 1569        $this->form->setValuesByPost();
 
 1570        $tpl->showPublicProfile(
true);
 
 1580        $checked_values = [];
 
 1581        foreach (
$_POST as $k => $v) {
 
 1582            if (substr($k, 0, 4) == 
"chk_") {
 
 1583                $k = str_replace(
"-1", 
"", $k);
 
 1584                $k = str_replace(
"-2", 
"", $k);
 
 1585                $checked_values[$k] = $v;
 
 1588        return $checked_values;
 
 1602        $ilToolbar = 
$DIC[
'ilToolbar'];
 
 1603        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1605        $ilTabs = 
$DIC[
'ilTabs'];
 
 1608        $ilTabs->activateTab(
"export");
 
 1611        include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
 1613        $button->setCaption(
"pd_export_profile");
 
 1614        $button->setUrl($ilCtrl->getLinkTarget($this, 
"exportPersonalData"));
 
 1615        $ilToolbar->addStickyItem($button);
 
 1617        $exp_file = 
$ilUser->getPersonalDataExportFile();
 
 1618        if ($exp_file != 
"") {
 
 1619            $ilToolbar->addSeparator();
 
 1620            $ilToolbar->addButton(
 
 1621                $this->lng->txt(
"pd_download_last_export_file"),
 
 1622                $ilCtrl->getLinkTarget($this, 
"downloadPersonalData")
 
 1626        $ilToolbar->addSeparator();
 
 1627        $ilToolbar->addButton(
 
 1628            $this->lng->txt(
"pd_import_personal_data"),
 
 1629            $ilCtrl->getLinkTarget($this, 
"importPersonalDataSelection")
 
 1632        $tpl->printToStdout();
 
 1643        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1646        $ilUser->exportPersonalData();
 
 1647        $ilUser->sendPersonalDataFile();
 
 1648        $ilCtrl->redirect($this, 
"showExportImport");
 
 1663        $ilUser->sendPersonalDataFile();
 
 1677        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1679        $ilTabs = 
$DIC[
'ilTabs'];
 
 1681        $ilTabs->activateTab(
"export");
 
 1684        $this->initPersonalDataImportForm();
 
 1686        $tpl->setContent($this->form->getHTML());
 
 1687        $tpl->printToStdout();
 
 1701        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1703        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1708        $fi->setRequired(
true);
 
 1709        $fi->setSuffixes(array(
"zip"));
 
 1710        $this->form->addItem($fi);
 
 1714        $this->form->addItem($cb);
 
 1718        $this->form->addItem($cb);
 
 1722        $this->form->addItem($cb);
 
 1726        $this->form->addItem($cb);
 
 1728        $this->form->addCommandButton(
"importPersonalData", 
$lng->txt(
"import"));
 
 1729        $this->form->addCommandButton(
"showExportImport", 
$lng->txt(
"cancel"));
 
 1731        $this->form->setTitle(
$lng->txt(
"pd_import_personal_data"));
 
 1732        $this->form->setFormAction($ilCtrl->getFormAction($this));
 
 1747        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1749        $ilTabs = 
$DIC[
'ilTabs'];
 
 1751        $this->initPersonalDataImportForm();
 
 1752        if ($this->form->checkInput()) {
 
 1755                (
int) 
$_POST[
"profile_data"],
 
 1756                (
int) 
$_POST[
"settings"],
 
 1760            ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"), 
true);
 
 1761            $ilCtrl->redirect($this, 
"");
 
 1763            $ilTabs->activateTab(
"export");
 
 1765            $this->form->setValuesByPost();
 
 1766            $tpl->setContent($this->form->getHtml());
 
 1767            $tpl->printToStdout();
 
 1780        $main_tpl->setRightContent($this->checklist->render($active_step));
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
static getInstancesByUserId($a_user_id)
static updatePositions($a_user_id, array $a_positions)
static getInstance()
Constructor.
static getInstance()
Get instance.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static updateLuceneIndex($a_obj_ids)
Update lucene index.
static isActivated()
Checks whether Map feature is activated.
static getDefaultSettings()
Get default longitude, latitude and zoom.
This class represents a non editable value in a property form.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
getLatitude()
Get Latitude.
getCountry()
Get country (free text)
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false, $html_export=false)
Get path to personal picture.
getLongitude()
Get Longitude.
getLocationZoom()
Get Location Zoom.
getStreet()
get street @access public
getCity()
get city @access public
static _loginExists($a_login, $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
GUI class for personal profile.
saveProfile()
save user profile data
initPersonalDataImportForm()
Init personal data import form.
showPersonalData($a_no_init=false, $a_migration_started=false)
Personal data form.
getCheckedValues()
Get checked values.
importPersonalData()
Import personal data.
showPublicProfile($a_no_init=false)
Public profile form.
showConsentWithdrawalConfirmation()
executeCommand()
execute command
userSettingEnabled(string $setting)
$termsOfServiceEvaluation
initPersonalDataForm()
Init personal form.
savePersonalData()
Save personal data form.
savePublicProfile()
Save public profile form.
exportPersonalData()
Export personal data.
userSettingVisible(string $setting)
removeUserPicture()
remove user image
__checkUserDefinedRequiredFields()
getProfilePortfolio()
has profile set to a portfolio?
showExportImport()
Show export/import.
__showUserDefinedFields()
updateLoginOrSetErrorMessages()
workWithUserSetting(string $setting)
uploadUserPicture()
Upload user image.
$email_change_confirmation_modal
downloadPersonalData()
Download personal data export file.
const PERSONAL_DATA_FORM_ID
showPublicProfileFields(ilPropertyformGUI $form, array $prefs, $parent=null, $anonymized=false, $key_suffix="")
Add fields to form.
__showOtherInformations()
importPersonalDataSelection()
Import personal data selection.
initPublicProfileForm()
Init public profile form.
__construct(\ilTermsOfServiceDocumentEvaluation $termsOfServiceEvaluation=null, \ilTermsOfServiceHelper $termsOfServiceHelper=null)
constructor
showProfile()
show profile form
showChecklist($active_step)
Show checklist.
addLocationToForm(ilPropertyFormGUI $a_form, ilObjUser $a_user)
Add location fields to form if activated.
Personal profile publishing mode of a iser.
const STEP_VISIBILITY_OPTIONS
const STEP_PUBLISH_OPTIONS
GUI class for public user profile presentation.
This class represents an option in a radio group.
static set($a_var, $a_val)
Set a value.
static setClosingContext($a_context)
set closing context (for statistics)
static get($a_var)
Get a value.
Class ilTermsOfServiceEventWithdrawn.
Class ilTermsOfServiceHelper.
Class ilTermsOfServiceWithdrawalGUIHelper.
static _getInstance()
Get instance.
Class for user related exception handling in ILIAS.
User privacy settings (currently located under "Profile and Privacy")
User profile prompt subservice.
User settings configuration (what preferences can be visible/changed/...)
static isConvertVersionAtLeast($a_version)
Compare convert version numbers.
static escapeShellArg($a_arg)
static getWebspaceDir($mode="filesystem")
get webspace directory
static execConvert($args)
execute convert command
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
This is how the factory for UI elements looks.
An entity that renders components to a string output.
Interface ilTermsOfServiceDocumentEvaluation.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl