ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPersonalProfileGUI Class Reference

GUI class for personal profile. More...

+ Collaboration diagram for ilPersonalProfileGUI:

Public Member Functions

 executeCommand ()
 
 workWithUserSetting (string $setting)
 
 userSettingVisible (string $setting)
 
 userSettingEnabled (string $setting)
 
 uploadUserPicture ()
 
 removeUserPicture ()
 
 showProfile ()
 show profile form More...
 
 addLocationToForm (ilPropertyFormGUI $a_form, ilObjUser $a_user)
 Add location fields to form if activated. More...
 
 setTabs ()
 
 __showOtherInformations ()
 
 __showUserDefinedFields ()
 
 setHeader ()
 
 showPersonalData (bool $a_no_init=false, bool $a_migration_started=false)
 
 initPersonalDataForm ()
 
 savePersonalData ()
 
 goToEmailConfirmation ()
 
 changeEmail ()
 
 showPublicProfile (bool $a_no_init=false)
 
 initPublicProfileForm ()
 
 showPublicProfileFields (ilPropertyFormGUI $form, array $prefs, ?object $parent=null, bool $anonymized=false, string $key_suffix="")
 
 savePublicProfile ()
 
 showExportImport ()
 
 exportPersonalData ()
 
 downloadPersonalData ()
 Download personal data export file. More...
 
 importPersonalDataSelection ()
 
 initPersonalDataImportForm ()
 
 importPersonalData ()
 

Data Fields

const CHANGE_EMAIL_CMD = 'changeEmail'
 
ilGlobalTemplateInterface $tpl
 
ilUserDefinedFields $user_defined_fields = null
 

Protected Member Functions

 showUserAgreement ()
 
 showConsentWithdrawalConfirmation ()
 
 cancelWithdrawal ()
 
 withdrawAcceptance ()
 
 getProfilePortfolio ()
 has profile set to a portfolio? More...
 
 getCheckedValues ()
 
 showChecklist (int $active_step)
 

Protected Attributes

ilPropertyFormGUI $form
 
string $password_error
 
string $upload_error
 
ilSetting $setting
 
ilObjUser $user
 
ILIAS User ProfileGUIRequest $profile_request
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilAuthSession $auth_session
 
ilTabsGUI $tabs
 
ilTermsOfServiceDocumentEvaluation $termsOfServiceEvaluation
 
ilTermsOfServiceHelper $termsOfServiceHelper
 
ilErrorHandling $errorHandler
 
ilProfileChecklistGUI $checklist
 
ilUserSettingsConfig $user_settings_config
 
ilProfileChecklistStatus $checklist_status
 
Interruptive $email_change_confirmation_modal = null
 

Private Member Functions

 convertUserPicture (string $uploaded_file, string $image_dir)
 
 emailChanged ()
 
 emailCompletionForced ()
 
 addEmailChangeModal ()
 
 loginChanged ()
 
 updateLoginOrSetErrorMessages ()
 
 savePersonalDataForm ()
 
 tempStorePicture ()
 

Private Attributes

const PERSONAL_DATA_FORM_ID = 'pd'
 
ilAppEventHandler $eventHandler
 
RequestInterface $request
 
ProfileChangeMailTokenRepository $change_mail_token_repo
 

Detailed Description

Member Function Documentation

◆ __showOtherInformations()

ilPersonalProfileGUI::__showOtherInformations ( )

Definition at line 503 of file class.ilPersonalProfileGUI.php.

References userSettingVisible().

503  : bool
504  {
505  $d_set = new ilSetting("delicous");
506  if ($this->userSettingVisible("matriculation") or count($this->user_defined_fields->getVisibleDefinitions())
507  or $d_set->get("user_profile") == "1") {
508  return true;
509  }
510  return false;
511  }
+ Here is the call graph for this function:

◆ __showUserDefinedFields()

ilPersonalProfileGUI::__showUserDefinedFields ( )

Definition at line 513 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilUser, $name, ilLegacyFormElementsUtil\formSelect(), ilLegacyFormElementsUtil\prepareFormOutput(), and UDF_TYPE_TEXT.

513  : bool
514  {
515  global $DIC;
516 
517  $ilUser = $DIC['ilUser'];
518 
519  $user_defined_data = $ilUser->getUserDefinedData();
520  foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
521  if ($definition['field_type'] == UDF_TYPE_TEXT) {
522  $this->tpl->setCurrentBlock("field_text");
523  $this->tpl->setVariable(
524  "FIELD_VALUE",
525  ilLegacyFormElementsUtil::prepareFormOutput($user_defined_data[$field_id])
526  );
527  if (!$definition['changeable']) {
528  $this->tpl->setVariable("DISABLED_FIELD", 'disabled=\"disabled\"');
529  }
530  $this->tpl->setVariable("FIELD_NAME", 'udf[' . $definition['field_id'] . ']');
531  } else {
532  if ($definition['changeable']) {
533  $name = 'udf[' . $definition['field_id'] . ']';
534  $disabled = false;
535  } else {
536  $name = '';
537  $disabled = true;
538  }
539  $this->tpl->setCurrentBlock("field_select");
540  $this->tpl->setVariable(
541  "SELECT_BOX",
543  $user_defined_data[$field_id],
544  $name,
545  $this->user_defined_fields->fieldValuesToSelectArray(
546  $definition['field_values']
547  ),
548  false,
549  true,
550  0,
551  '',
552  [],
553  $disabled
554  )
555  );
556  }
557  $this->tpl->parseCurrentBlock();
558  $this->tpl->setCurrentBlock("user_defined");
559 
560  if ($definition['required']) {
561  $name = $definition['field_name'] . "<span class=\"asterisk\">*</span>";
562  } else {
563  $name = $definition['field_name'];
564  }
565  $this->tpl->setVariable("TXT_FIELD_NAME", $name);
566  $this->tpl->parseCurrentBlock();
567  }
568  return true;
569  }
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
static prepareFormOutput($a_str, bool $a_strip=false)
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
const UDF_TYPE_TEXT
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ addEmailChangeModal()

ilPersonalProfileGUI::addEmailChangeModal ( )
private

Definition at line 733 of file class.ilPersonalProfileGUI.php.

References $id, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().

Referenced by savePersonalData().

733  : bool
734  {
735  $form_id = 'form_' . self::PERSONAL_DATA_FORM_ID;
736  $modal = $this->ui_factory->modal()->interruptive(
737  $this->lng->txt('confirm'),
738  $this->lng->txt('confirm_logout_for_email_change'),
739  '#'
740  )->withActionButtonLabel('change');
741  $this->email_change_confirmation_modal = $modal->withOnLoad($modal->getShowSignal())
743  static function ($id) use ($form_id) {
744  return "var button = {$id}.querySelector('input[name=\"cmd[change]\"]'); "
745  . "button.addEventListener('click', (e) => {e.preventDefault();"
746  . "document.getElementById('{$form_id}').submit();});";
747  }
748  );
749 
750  $this->form->setFormAction($this->ctrl->getFormActionByClass(self::class, 'goToEmailConfirmation'));
751  return true;
752  }
form( $class_path, string $cmd)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocationToForm()

ilPersonalProfileGUI::addLocationToForm ( ilPropertyFormGUI  $a_form,
ilObjUser  $a_user 
)

Add location fields to form if activated.

Definition at line 403 of file class.ilPersonalProfileGUI.php.

References $DIC, ilPropertyFormGUI\addItem(), ilObjUser\getCity(), ilObjUser\getCountry(), ilMapUtil\getDefaultSettings(), ilObjUser\getLatitude(), ilObjUser\getLocationZoom(), ilObjUser\getLongitude(), ilObjUser\getStreet(), ILIAS\Repository\int(), ilMapUtil\isActivated(), ILIAS\Repository\lng(), and ilLocationInputGUI\setLatitude().

Referenced by initPersonalDataForm().

403  : void
404  {
405  global $DIC;
406 
407  $ilCtrl = $DIC['ilCtrl'];
408 
409  // check map activation
410  if (!ilMapUtil::isActivated()) {
411  return;
412  }
413 
414  // Don't really know if this is still necessary...
415  $this->lng->loadLanguageModule("maps");
416 
417  // Get user settings
418  $latitude = ($a_user->getLatitude() != "")
419  ? (float) $a_user->getLatitude()
420  : null;
421  $longitude = ($a_user->getLongitude() != "")
422  ? (float) $a_user->getLongitude()
423  : null;
424  $zoom = $a_user->getLocationZoom();
425 
426  // Get Default settings, when nothing is set
427  if ($latitude == null && $longitude == null && $zoom == 0) {
429  $latitude = (float) $def["latitude"];
430  $longitude = (float) $def["longitude"];
431  $zoom = (int) $def["zoom"];
432  }
433 
434  $street = $a_user->getStreet();
435  if (!$street) {
436  $street = $this->lng->txt("street");
437  }
438  $city = $a_user->getCity();
439  if (!$city) {
440  $city = $this->lng->txt("city");
441  }
442  $country = $a_user->getCountry();
443  if (!$country) {
444  $country = $this->lng->txt("country");
445  }
446 
447  // location property
448  $loc_prop = new ilLocationInputGUI(
449  $this->lng->txt("location"),
450  "location"
451  );
452  $loc_prop->setLatitude($latitude);
453  $loc_prop->setLongitude($longitude);
454  $loc_prop->setZoom($zoom);
455  $loc_prop->setAddress($street . "," . $city . "," . $country);
456 
457  $a_form->addItem($loc_prop);
458  }
global $DIC
Definition: feed.php:28
static getDefaultSettings()
Get default longitude, latitude and zoom.
This class represents a location property in a property form.
static isActivated()
Checks whether Map feature is activated.
setLatitude(?float $a_latitude)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelWithdrawal()

ilPersonalProfileGUI::cancelWithdrawal ( )
protected

Definition at line 345 of file class.ilPersonalProfileGUI.php.

References ILIAS\Repository\ctrl(), ilSession\get(), ILIAS\Repository\lng(), ilInitialisation\redirectToStartingPage(), ilSession\set(), and ILIAS\Repository\user().

345  : void
346  {
347  if (!$this->termsOfServiceHelper->isIncludedUser($this->user)) {
348  $this->errorHandler->raiseError($this->lng->txt('permission_denied'), $this->errorHandler->MESSAGE);
349  }
350 
351  $this->user->deletePref('consent_withdrawal_requested');
352 
353  if (ilSession::get('orig_request_target')) {
354  $target = ilSession::get('orig_request_target');
355  ilSession::set('orig_request_target', '');
356  $this->ctrl->redirectToURL($target);
357  } else {
359  }
360  }
static get(string $a_var)
static redirectToStartingPage(string $target='')
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ changeEmail()

ilPersonalProfileGUI::changeEmail ( )

Definition at line 895 of file class.ilPersonalProfileGUI.php.

References $token, ILIAS\Repository\lng(), showPublicProfile(), and ILIAS\Repository\user().

895  : void
896  {
897  $token = $this->profile_request->getToken();
898  $new_email = $this->change_mail_token_repo->getNewEmailForUser($this->user, $token);
899 
900  if ($new_email !== '') {
901  $this->user->setEmail($new_email);
902  $this->user->update();
903  $this->change_mail_token_repo->deleteEntryByToken($token);
904  $this->tpl->setOnScreenMessage(
905  'success',
906  $this->lng->txt('saved_successfully')
907  );
908  $this->showPublicProfile();
909  return;
910  }
911 
912  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('email_could_not_be_changed'));
913  $this->showPublicProfile();
914  }
showPublicProfile(bool $a_no_init=false)
$token
Definition: xapitoken.php:70
+ Here is the call graph for this function:

◆ convertUserPicture()

ilPersonalProfileGUI::convertUserPicture ( string  $uploaded_file,
string  $image_dir 
)
private

Definition at line 224 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilUser, ilShellUtil\escapeShellArg(), ilShellUtil\execConvert(), and ilShellUtil\isConvertVersionAtLeast().

Referenced by uploadUserPicture().

224  : void
225  {
226  global $DIC;
227  $ilUser = $DIC['ilUser'];
228 
229  // take quality 100 to avoid jpeg artefacts when uploading jpeg files
230  // taking only frame [0] to avoid problems with animated gifs
231  $show_file = "$image_dir/usr_" . $ilUser->getId() . ".jpg";
232  $thumb_file = "$image_dir/usr_" . $ilUser->getId() . "_small.jpg";
233  $xthumb_file = "$image_dir/usr_" . $ilUser->getId() . "_xsmall.jpg";
234  $xxthumb_file = "$image_dir/usr_" . $ilUser->getId() . "_xxsmall.jpg";
235  $uploaded_file = ilShellUtil::escapeShellArg($uploaded_file);
236  $show_file = ilShellUtil::escapeShellArg($show_file);
237  $thumb_file = ilShellUtil::escapeShellArg($thumb_file);
238  $xthumb_file = ilShellUtil::escapeShellArg($xthumb_file);
239  $xxthumb_file = ilShellUtil::escapeShellArg($xxthumb_file);
240 
241  if (ilShellUtil::isConvertVersionAtLeast("6.3.8-3")) {
243  $uploaded_file . "[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:" . $show_file
244  );
246  $uploaded_file . "[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:" . $thumb_file
247  );
249  $uploaded_file . "[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:" . $xthumb_file
250  );
252  $uploaded_file . "[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:" . $xxthumb_file
253  );
254  } else {
255  ilShellUtil::execConvert($uploaded_file . "[0] -geometry 200x200 -quality 100 JPEG:" . $show_file);
256  ilShellUtil::execConvert($uploaded_file . "[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
257  ilShellUtil::execConvert($uploaded_file . "[0] -geometry 75x75 -quality 100 JPEG:" . $xthumb_file);
258  ilShellUtil::execConvert($uploaded_file . "[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
259  }
260  }
static isConvertVersionAtLeast(string $a_version)
Compare convert version numbers.
static escapeShellArg(string $a_arg)
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
static execConvert(string $args)
execute convert command
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downloadPersonalData()

ilPersonalProfileGUI::downloadPersonalData ( )

Download personal data export file.

Definition at line 1340 of file class.ilPersonalProfileGUI.php.

References $DIC, and $ilUser.

1340  : void
1341  {
1342  global $DIC;
1343 
1344  $ilUser = $DIC['ilUser'];
1345 
1346  $ilUser->sendPersonalDataFile();
1347  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34

◆ emailChanged()

ilPersonalProfileGUI::emailChanged ( )
private

Definition at line 708 of file class.ilPersonalProfileGUI.php.

References ILIAS\Repository\form(), and ILIAS\Repository\user().

Referenced by savePersonalData().

708  : bool
709  {
710  $email_input = $this->form->getItemByPostVar('usr_email');
711  if ($email_input !== null && !$email_input->getDisabled()
712  && $this->form->getInput('usr_email') !== $this->user->getEmail()) {
713  return true;
714  }
715 
716  return false;
717  }
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emailCompletionForced()

ilPersonalProfileGUI::emailCompletionForced ( )
private

Definition at line 719 of file class.ilPersonalProfileGUI.php.

References ILIAS\Repository\user().

Referenced by savePersonalData(), and savePersonalDataForm().

719  : bool
720  {
721  $current_email = $this->user->getEmail();
722  if (
723  $this->user->getProfileIncomplete()
724  && $this->setting->get('require_email') === '1'
725  && ($current_email === null || $current_email === '')
726  ) {
727  return true;
728  }
729 
730  return false;
731  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPersonalProfileGUI::executeCommand ( )

Definition at line 112 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilUser, ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\printToStdout(), ilPublicUserProfileGUI\setBackUrl(), setHeader(), setTabs(), showChecklist(), and ilProfileChecklistStatus\STEP_VISIBILITY_OPTIONS.

112  : void
113  {
114  global $DIC;
115 
116  $ilUser = $DIC['ilUser'];
117  $ilCtrl = $DIC['ilCtrl'];
118  $tpl = $DIC['tpl'];
119  $ilTabs = $DIC['ilTabs'];
120 
121  $next_class = $this->ctrl->getNextClass();
122 
123  switch ($next_class) {
124  case "ilpublicuserprofilegui":
125  $pub_profile_gui = new ilPublicUserProfileGUI($ilUser->getId());
126  $pub_profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, "showPersonalData"));
127  $ilCtrl->forwardCommand($pub_profile_gui);
128  $tpl->printToStdout();
129  break;
130 
131  case "iluserprivacysettingsgui":
132  $this->setHeader();
133  $this->setTabs();
134  $ilTabs->activateTab("visibility_settings");
136  $gui = new ilUserPrivacySettingsGUI();
137  $ilCtrl->forwardCommand($gui);
138  break;
139 
140  default:
141  $this->setTabs();
142  $cmd = $this->ctrl->getCmd("showPersonalData");
143  $this->$cmd();
144  break;
145  }
146  }
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setBackUrl(string $a_backurl)
Set Back Link URL.
ilGlobalTemplateInterface $tpl
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ exportPersonalData()

ilPersonalProfileGUI::exportPersonalData ( )

Definition at line 1325 of file class.ilPersonalProfileGUI.php.

References $DIC, and $ilUser.

1325  : void
1326  {
1327  global $DIC;
1328 
1329  $ilCtrl = $DIC['ilCtrl'];
1330  $ilUser = $DIC['ilUser'];
1331 
1332  $ilUser->exportPersonalData();
1333  $ilUser->sendPersonalDataFile();
1334  $ilCtrl->redirect($this, "showExportImport");
1335  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34

◆ getCheckedValues()

ilPersonalProfileGUI::getCheckedValues ( )
protected

Definition at line 1258 of file class.ilPersonalProfileGUI.php.

References $post, and ILIAS\Repository\form().

Referenced by savePublicProfile().

1258  : array // Missing array type.
1259  {
1260  $key_suffix = "";
1261  switch ($this->form->getInput("public_profile")) {
1262  case "y":
1263  $key_suffix = "-1";
1264  break;
1265  case "g":
1266  $key_suffix = "-2";
1267  break;
1268  }
1269 
1270  $checked_values = [];
1271  $post = $this->request->getParsedBody();
1272  foreach ($post as $k => $v) {
1273  if (strpos($k, "chk_") !== 0) {
1274  continue;
1275  }
1276  if (substr($k, -2) === $key_suffix) {
1277  $k = str_replace(["-1", "-2"], "", $k);
1278  }
1279  $checked_values[$k] = $v;
1280  }
1281  foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
1282  if (isset($post["chk_udf_" . $definition["field_id"] . $key_suffix])) {
1283  $checked_values["chk_udf_" . $definition["field_id"]] = "1";
1284  }
1285  }
1286  return $checked_values;
1287  }
form( $class_path, string $cmd)
$post
Definition: ltitoken.php:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProfilePortfolio()

ilPersonalProfileGUI::getProfilePortfolio ( )
protected

has profile set to a portfolio?

Definition at line 936 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilSetting, $ilUser, and ilObjPortfolio\getDefaultPortfolio().

Referenced by initPublicProfileForm().

936  : ?int
937  {
938  global $DIC;
939 
940  $ilUser = $DIC['ilUser'];
941  $ilSetting = $DIC['ilSetting'];
942 
943  if ($ilSetting->get('user_portfolios')) {
945  }
946  return null;
947  }
static getDefaultPortfolio(int $a_user_id)
Get default portfolio of user.
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ goToEmailConfirmation()

ilPersonalProfileGUI::goToEmailConfirmation ( )

Definition at line 792 of file class.ilPersonalProfileGUI.php.

References $token, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), initPersonalDataForm(), loginChanged(), savePersonalDataForm(), ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), showPersonalData(), updateLoginOrSetErrorMessages(), and ILIAS\Repository\user().

792  : void
793  {
794  $this->initPersonalDataForm();
795  if (!$this->form->checkInput()
796  || $this->loginChanged() && !$this->updateLoginOrSetErrorMessages()) {
797  $this->form->setValuesByPost();
798  $this->showPersonalData(true);
799  return;
800  }
801  $this->savePersonalDataForm();
802 
804  $this->auth_session->logout();
805  session_unset();
806  $token = $this->change_mail_token_repo->getNewTokenForUser($this->user, $this->form->getInput('usr_email'));
807  $this->ctrl->redirectToURL('login.php?cmd=force_login&target=usr_' . self::CHANGE_EMAIL_CMD . $token);
808  }
showPersonalData(bool $a_no_init=false, bool $a_migration_started=false)
$token
Definition: xapitoken.php:70
const SESSION_CLOSE_USER
form( $class_path, string $cmd)
static setClosingContext(int $a_context)
set closing context (for statistics)
+ Here is the call graph for this function:

◆ importPersonalData()

ilPersonalProfileGUI::importPersonalData ( )

Definition at line 1403 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilUser, $tpl, ILIAS\Repository\form(), initPersonalDataImportForm(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\printToStdout(), ilGlobalTemplateInterface\setContent(), and setHeader().

1403  : void
1404  {
1405  global $DIC;
1406 
1407  $ilUser = $DIC['ilUser'];
1408  $ilCtrl = $DIC['ilCtrl'];
1409  $tpl = $DIC['tpl'];
1410  $ilTabs = $DIC['ilTabs'];
1411 
1412  $this->initPersonalDataImportForm();
1413  if ($this->form->checkInput()) {
1414  $ilUser->importPersonalData(
1415  $_FILES["file"],
1416  (int) $this->form->getInput("profile_data"),
1417  (int) $this->form->getInput("settings"),
1418  (int) $this->form->getInput("notes"),
1419  (int) $this->form->getInput("calendar")
1420  );
1421  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1422  $ilCtrl->redirect($this, "");
1423  } else {
1424  $ilTabs->activateTab("export");
1425  $this->setHeader();
1426  $this->form->setValuesByPost();
1427  $tpl->setContent($this->form->getHTML());
1428  $tpl->printToStdout();
1429  }
1430  }
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
global $DIC
Definition: feed.php:28
setContent(string $a_html)
Sets content for standard template.
form( $class_path, string $cmd)
ilGlobalTemplateInterface $tpl
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ importPersonalDataSelection()

ilPersonalProfileGUI::importPersonalDataSelection ( )

Definition at line 1349 of file class.ilPersonalProfileGUI.php.

References $DIC, $tpl, ILIAS\Repository\form(), initPersonalDataImportForm(), ilGlobalTemplateInterface\printToStdout(), ilGlobalTemplateInterface\setContent(), and setHeader().

1349  : void
1350  {
1351  global $DIC;
1352 
1353  $tpl = $DIC['tpl'];
1354  $ilTabs = $DIC['ilTabs'];
1355 
1356  $ilTabs->activateTab("export");
1357  $this->setHeader();
1358 
1359  $this->initPersonalDataImportForm();
1360 
1361  $tpl->setContent($this->form->getHTML());
1362  $tpl->printToStdout();
1363  }
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
global $DIC
Definition: feed.php:28
setContent(string $a_html)
Sets content for standard template.
form( $class_path, string $cmd)
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ initPersonalDataForm()

ilPersonalProfileGUI::initPersonalDataForm ( )

Definition at line 639 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilUser, addLocationToForm(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilCustomUserFieldsHelper\getInstance(), and ilLanguage\txt().

Referenced by goToEmailConfirmation(), savePersonalData(), and showPersonalData().

639  : void
640  {
641  global $DIC;
642 
643  $lng = $DIC['lng'];
644  $ilUser = $DIC['ilUser'];
645  $input = [];
646 
647  $this->form = new ilPropertyFormGUI();
648  $this->form->setFormAction($this->ctrl->getFormAction($this));
649  $this->form->setId(self::PERSONAL_DATA_FORM_ID);
650 
651  // user defined fields
652  $user_defined_data = $ilUser->getUserDefinedData();
653 
654 
655  foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
656  $value = $user_defined_data["f_" . $field_id] ?? "";
657 
658  $fprop = ilCustomUserFieldsHelper::getInstance()->getFormPropertyForDefinition(
659  $definition,
660  $definition['changeable'] ?? false,
661  $value
662  );
663  if ($fprop instanceof ilFormPropertyGUI) {
664  $input['udf_' . $definition['field_id']] = $fprop;
665  }
666  }
667 
668  // standard fields
669  $up = new ilUserProfile();
670  $up->skipField("password");
671  $up->skipGroup("settings");
672  $up->skipGroup("preferences");
673 
674  $up->setAjaxCallback(
675  $this->ctrl->getLinkTargetByClass('ilPublicUserProfileGUI', 'doProfileAutoComplete', '', true)
676  );
677 
678  // standard fields
679  $up->addStandardFieldsToForm($this->form, $ilUser, $input);
680 
681  $this->addLocationToForm($this->form, $ilUser);
682 
683  $this->form->addCommandButton("savePersonalData", $lng->txt("user_save_continue"));
684  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Class ilUserProfile.
global $DIC
Definition: feed.php:28
form( $class_path, string $cmd)
This class represents a property in a property form.
$ilUser
Definition: imgupload.php:34
addLocationToForm(ilPropertyFormGUI $a_form, ilObjUser $a_user)
Add location fields to form if activated.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPersonalDataImportForm()

ilPersonalProfileGUI::initPersonalDataImportForm ( )

Definition at line 1365 of file class.ilPersonalProfileGUI.php.

References $DIC, $lng, ILIAS\Repository\form(), ILIAS\Repository\lng(), ilFormPropertyGUI\setRequired(), and ilLanguage\txt().

Referenced by importPersonalData(), and importPersonalDataSelection().

1365  : void
1366  {
1367  global $DIC;
1368 
1369  $lng = $DIC['lng'];
1370  $ilCtrl = $DIC['ilCtrl'];
1371 
1372  $this->form = new ilPropertyFormGUI();
1373 
1374  // input file
1375  $fi = new ilFileInputGUI($lng->txt("file"), "file");
1376  $fi->setRequired(true);
1377  $fi->setSuffixes(array("zip"));
1378  $this->form->addItem($fi);
1379 
1380  // profile data
1381  $cb = new ilCheckboxInputGUI($this->lng->txt("pd_profile_data"), "profile_data");
1382  $this->form->addItem($cb);
1383 
1384  // settings
1385  $cb = new ilCheckboxInputGUI($this->lng->txt("settings"), "settings");
1386  $this->form->addItem($cb);
1387 
1388  // personal notes
1389  $cb = new ilCheckboxInputGUI($this->lng->txt("notes"), "notes");
1390  $this->form->addItem($cb);
1391 
1392  // calendar entries
1393  $cb = new ilCheckboxInputGUI($this->lng->txt("pd_private_calendars"), "calendar");
1394  $this->form->addItem($cb);
1395 
1396  $this->form->addCommandButton("importPersonalData", $lng->txt("import"));
1397  $this->form->addCommandButton("showExportImport", $lng->txt("cancel"));
1398 
1399  $this->form->setTitle($lng->txt("pd_import_personal_data"));
1400  $this->form->setFormAction($ilCtrl->getFormAction($this));
1401  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a file property in a property form.
This class represents a checkbox property in a property form.
global $DIC
Definition: feed.php:28
setRequired(bool $a_required)
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPublicProfileForm()

ilPersonalProfileGUI::initPublicProfileForm ( )

Definition at line 949 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilSetting, $ilUser, $lng, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), getProfilePortfolio(), ILIAS\Repository\lng(), ilCustomInputGUI\setHtml(), ilFormPropertyGUI\setInfo(), showPublicProfileFields(), and ilLanguage\txt().

Referenced by savePublicProfile(), and showPublicProfile().

949  : void
950  {
951  global $DIC;
952 
953  $lng = $DIC['lng'];
954  $ilUser = $DIC['ilUser'];
955  $ilSetting = $DIC['ilSetting'];
956 
957  $this->form = new ilPropertyFormGUI();
958 
959  $this->form->setTitle($lng->txt("user_publish_options"));
960  $this->form->setDescription($lng->txt("user_public_profile_info"));
961  $this->form->setFormAction($this->ctrl->getFormAction($this));
962 
963  $portfolio_id = $this->getProfilePortfolio();
964 
965  if (!$portfolio_id) {
966  // Activate public profile
967  $radg = new ilRadioGroupInputGUI($lng->txt("user_activate_public_profile"), "public_profile");
968  $info = $this->lng->txt("user_activate_public_profile_info");
969  $profile_mode = new ilPersonalProfileMode($ilUser, $ilSetting);
970  $pub_prof = $profile_mode->getMode();
971  $radg->setValue($pub_prof);
972  $op1 = new ilRadioOption($lng->txt("usr_public_profile_disabled"), "n", $lng->txt("usr_public_profile_disabled_info"));
973  $radg->addOption($op1);
974  $op2 = new ilRadioOption($lng->txt("usr_public_profile_logged_in"), "y");
975  $radg->addOption($op2);
976  if ($ilSetting->get('enable_global_profiles')) {
977  $op3 = new ilRadioOption($lng->txt("usr_public_profile_global"), "g");
978  $radg->addOption($op3);
979  }
980  $this->form->addItem($radg);
981 
982  // #11773
983  if ($ilSetting->get('user_portfolios')) {
984  // #10826
985  $prtf = "<br />" . $lng->txt("user_profile_portfolio");
986  $prtf .= "<br /><a href=\"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToPortfolio\">&raquo; " .
987  $lng->txt("user_portfolios") . "</a>";
988  $info .= $prtf;
989  }
990 
991  $radg->setInfo($info);
992  } else {
993  $prtf = $lng->txt("user_profile_portfolio_selected");
994  $prtf .= "<br /><a href=\"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToPortfolio&prt_id=" . $portfolio_id . "\">&raquo; " .
995  $lng->txt("portfolio") . "</a>";
996 
997  $info = new ilCustomInputGUI($lng->txt("user_activate_public_profile"));
998  $info->setHtml($prtf);
999  $this->form->addItem($info);
1000  $this->showPublicProfileFields($this->form, $ilUser->prefs);
1001  }
1002 
1003  if (isset($op2)) {
1004  $this->showPublicProfileFields($this->form, $ilUser->prefs, $op2, false, "-1");
1005  }
1006  if (isset($op3)) {
1007  $this->showPublicProfileFields($this->form, $ilUser->prefs, $op3, false, "-2");
1008  }
1009  $this->form->setForceTopButtons(true);
1010  $this->form->addCommandButton("savePublicProfile", $lng->txt("user_save_continue"));
1011  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getProfilePortfolio()
has profile set to a portfolio?
global $DIC
Definition: feed.php:28
This class represents a property in a property form.
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:34
showPublicProfileFields(ilPropertyFormGUI $form, array $prefs, ?object $parent=null, bool $anonymized=false, string $key_suffix="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loginChanged()

ilPersonalProfileGUI::loginChanged ( )
private

Definition at line 754 of file class.ilPersonalProfileGUI.php.

References ILIAS\Repository\form(), and ILIAS\Repository\user().

Referenced by goToEmailConfirmation(), and savePersonalData().

754  : bool
755  {
756  $login = $this->form->getInput('username');
757  if ((int) $this->setting->get('allow_change_loginname')
758  && $login !== $this->user->getLogin()) {
759  return true;
760  }
761 
762  return false;
763  }
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeUserPicture()

ilPersonalProfileGUI::removeUserPicture ( )

Definition at line 262 of file class.ilPersonalProfileGUI.php.

References $DIC, and $ilUser.

262  : void
263  {
264  global $DIC;
265 
266  $ilUser = $DIC['ilUser'];
267  $ilUser->removeUserPicture();
268  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34

◆ savePersonalData()

ilPersonalProfileGUI::savePersonalData ( )

Definition at line 686 of file class.ilPersonalProfileGUI.php.

References addEmailChangeModal(), ILIAS\Repository\ctrl(), emailChanged(), emailCompletionForced(), ILIAS\Repository\form(), initPersonalDataForm(), ILIAS\Repository\lng(), loginChanged(), savePersonalDataForm(), showPersonalData(), ilProfileChecklistStatus\STEP_PROFILE_DATA, tempStorePicture(), and updateLoginOrSetErrorMessages().

686  : void
687  {
688  $this->initPersonalDataForm();
689  if (!$this->form->checkInput()
690  || !$this->emailCompletionForced()
691  && $this->emailChanged()
692  && $this->addEmailChangeModal()
693  || $this->loginChanged() && !$this->updateLoginOrSetErrorMessages()) {
694  $this->form->setValuesByPost();
695  $this->tempStorePicture();
696  $this->showPersonalData(true);
697  return;
698  }
699 
700  $this->savePersonalDataForm();
701 
702  $this->checklist_status->saveStepSucess(ilProfileChecklistStatus::STEP_PROFILE_DATA);
703  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
704 
705  $this->ctrl->redirect($this, "showPublicProfile");
706  }
showPersonalData(bool $a_no_init=false, bool $a_migration_started=false)
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ savePersonalDataForm()

ilPersonalProfileGUI::savePersonalDataForm ( )
private

Definition at line 810 of file class.ilPersonalProfileGUI.php.

References Vendor\Package\$f, $location, emailCompletionForced(), ILIAS\Repository\form(), IL_CAL_DATE, ilMapUtil\isActivated(), ilUtil\stripSlashes(), uploadUserPicture(), and ILIAS\Repository\user().

Referenced by goToEmailConfirmation(), and savePersonalData().

810  : void
811  {
812  // if form field name differs from setter
813  $map = [
814  "firstname" => "FirstName",
815  "lastname" => "LastName",
816  "title" => "UTitle",
817  "sel_country" => "SelectedCountry",
818  "phone_office" => "PhoneOffice",
819  "phone_home" => "PhoneHome",
820  "phone_mobile" => "PhoneMobile",
821  "referral_comment" => "Comment",
822  "interests_general" => "GeneralInterests",
823  "interests_help_offered" => "OfferingHelp",
824  "interests_help_looking" => "LookingForHelp"
825  ];
826  $up = new ilUserProfile();
827  foreach (array_keys($up->getStandardFields()) as $f) {
828  // if item is part of form, it is currently valid (if not disabled)
829  $item = $this->form->getItemByPostVar("usr_" . $f);
830  if (!$item || $item->getDisabled()) {
831  continue;
832  }
833 
834  $value = $this->form->getInput("usr_" . $f);
835  switch ($f) {
836  case 'email':
837  if ($this->emailCompletionForced()) {
838  $this->user->setEmail($value);
839  }
840 
841  break;
842  case "birthday":
843  $value = $item->getDate();
844  $this->user->setBirthday($value
845  ? $value->get(IL_CAL_DATE)
846  : "");
847  break;
848  case "second_email":
849  $this->user->setSecondEmail($value);
850  break;
851  default:
852  $m = $map[$f] ?? ucfirst($f);
853  $this->user->{"set" . $m}($value);
854  break;
855  }
856  }
857  $this->user->setFullname();
858 
859  // check map activation
860  if (ilMapUtil::isActivated()) {
861  // #17619 - proper escaping
862  $location = $this->form->getInput("location");
863  $lat = ilUtil::stripSlashes($location["latitude"]);
864  $long = ilUtil::stripSlashes($location["longitude"]);
865  $zoom = ilUtil::stripSlashes($location["zoom"]);
866  $this->user->setLatitude(is_numeric($lat) ? $lat : null);
867  $this->user->setLongitude(is_numeric($long) ? $long : null);
868  $this->user->setLocationZoom(is_numeric($zoom) ? $zoom : null);
869  }
870 
871  // Set user defined data
872  $defs = $this->user_defined_fields->getVisibleDefinitions();
873  $udf = [];
874  foreach ($defs as $definition) {
875  $f = "udf_" . $definition['field_id'];
876  $item = $this->form->getItemByPostVar($f);
877  if ($item && !$item->getDisabled()) {
878  $udf[$definition['field_id']] = $this->form->getInput($f);
879  }
880  }
881  $this->user->setUserDefinedData($udf);
882 
883  $this->uploadUserPicture();
884 
885  // profile ok
886  $this->user->setProfileIncomplete(false);
887 
888  // save user data & object_data
889  $this->user->setTitle($this->user->getFullname());
890  $this->user->setDescription($this->user->getEmail());
891 
892  $this->user->update();
893  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
Class ilUserProfile.
form( $class_path, string $cmd)
static isActivated()
Checks whether Map feature is activated.
const IL_CAL_DATE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ savePublicProfile()

ilPersonalProfileGUI::savePublicProfile ( )

Definition at line 1174 of file class.ilPersonalProfileGUI.php.

References $DIC, $GLOBALS, $ilUser, ILIAS\LTI\ToolProvider\$key, $lng, $tpl, ILIAS\Repository\form(), ilSession\get(), getCheckedValues(), ILIAS\Survey\Mode\getId(), ilBadgeHandler\getInstance(), initPublicProfileForm(), ilUtil\redirect(), ilSession\set(), ilProfileChecklistStatus\STEP_PUBLISH_OPTIONS, ilLanguage\txt(), ilLuceneIndexer\updateLuceneIndex(), and ilBadgeAssignment\updatePositions().

1174  : void
1175  {
1176  global $DIC;
1177 
1178  $tpl = $DIC['tpl'];
1179  $lng = $DIC['lng'];
1180  $ilCtrl = $DIC['ilCtrl'];
1181  $ilUser = $DIC['ilUser'];
1182  $key_suffix = "";
1183 
1184  $this->initPublicProfileForm();
1185  if ($this->form->checkInput()) {
1186  // with active portfolio no options are presented
1187  if ($this->form->getInput("public_profile") != "") {
1188  $ilUser->setPref("public_profile", $this->form->getInput("public_profile"));
1189  }
1190 
1191  // if check on Institute
1192  $val_array = array("title", "birthday", "gender", "org_units", "institution", "department", "upload",
1193  "street", "zipcode", "city", "country", "sel_country", "phone_office", "phone_home", "phone_mobile",
1194  "fax", "email", "second_email", "hobby", "matriculation", "location",
1195  "interests_general", "interests_help_offered", "interests_help_looking");
1196 
1197  // set public profile preferences
1198  $checked_values = $this->getCheckedValues();
1199  foreach ($val_array as $key => $value) {
1200  if ($checked_values["chk_" . $value] ?? false) {
1201  $ilUser->setPref("public_" . $value, "y");
1202  } else {
1203  $ilUser->setPref("public_" . $value, "n");
1204  }
1205  }
1206  // additional defined user data fields
1207  foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
1208  if ($checked_values["chk_udf_" . $definition["field_id"]] ?? false) {
1209  $ilUser->setPref("public_udf_" . $definition["field_id"], "y");
1210  } else {
1211  $ilUser->setPref("public_udf_" . $definition["field_id"], "n");
1212  }
1213  }
1214 
1215  $ilUser->update();
1216 
1217  switch ($this->form->getInput("public_profile")) {
1218  case "y":
1219  $key_suffix = "-1";
1220  break;
1221  case "g":
1222  $key_suffix = "-2";
1223  break;
1224  }
1225 
1226  $handler = ilBadgeHandler::getInstance();
1227  if ($handler->isActive()) {
1228  $badgePositions = [];
1229  $bpos = $this->form->getInput("bpos" . $key_suffix);
1230  if (isset($bpos) && is_array($bpos)) {
1231  $badgePositions = $bpos;
1232  }
1233 
1234  if (count($badgePositions) > 0) {
1235  ilBadgeAssignment::updatePositions($ilUser->getId(), $badgePositions);
1236  }
1237  }
1238 
1239  // update lucene index
1240  ilLuceneIndexer::updateLuceneIndex(array((int) $GLOBALS['DIC']['ilUser']->getId()));
1241 
1242  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1243 
1244  $this->checklist_status->saveStepSucess(ilProfileChecklistStatus::STEP_PUBLISH_OPTIONS);
1245 
1246  if (ilSession::get('orig_request_target')) {
1247  $target = ilSession::get('orig_request_target');
1248  ilSession::set('orig_request_target', '');
1249  ilUtil::redirect($target);
1250  } else {
1251  $ilCtrl->redirectByClass("iluserprivacysettingsgui", "");
1252  }
1253  }
1254  $this->form->setValuesByPost();
1255  $tpl->showPublicProfile(true);
1256  }
static get(string $a_var)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static updateLuceneIndex(array $a_obj_ids)
Update lucene index.
global $DIC
Definition: feed.php:28
static updatePositions(int $a_user_id, array $a_positions)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
string $key
Consumer key/client ID value.
Definition: System.php:193
form( $class_path, string $cmd)
static redirect(string $a_script)
ilGlobalTemplateInterface $tpl
$ilUser
Definition: imgupload.php:34
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ setHeader()

ilPersonalProfileGUI::setHeader ( )

Definition at line 571 of file class.ilPersonalProfileGUI.php.

References ILIAS\Repository\lng().

Referenced by executeCommand(), importPersonalData(), importPersonalDataSelection(), showExportImport(), showPersonalData(), and showPublicProfile().

571  : void
572  {
573  $this->tpl->setTitle($this->lng->txt('personal_profile'));
574  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilPersonalProfileGUI::setTabs ( )

Definition at line 461 of file class.ilPersonalProfileGUI.php.

References $DIC, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by executeCommand().

461  : void
462  {
463  global $DIC;
464 
465  $ilTabs = $DIC['ilTabs'];
466  $ilHelp = $DIC['ilHelp'];
467 
468  $ilHelp->setScreenIdComponent("user");
469 
470  // personal data
471  $ilTabs->addTab(
472  "personal_data",
473  $this->lng->txt("user_profile_data"),
474  $this->ctrl->getLinkTarget($this, "showPersonalData")
475  );
476 
477  // publishing options
478  $ilTabs->addTab(
479  "public_profile",
480  $this->lng->txt("user_publish_options"),
481  $this->ctrl->getLinkTarget($this, "showPublicProfile")
482  );
483 
484  // visibility settings
485  $txt_visibility = $this->checklist_status->anyVisibilitySettings()
486  ? $this->lng->txt("user_visibility_settings")
487  : $this->lng->txt("preview");
488  $ilTabs->addTab(
489  "visibility_settings",
490  $txt_visibility,
491  $this->ctrl->getLinkTargetByClass("ilUserPrivacySettingsGUI", "")
492  );
493 
494  // export
495  $ilTabs->addTab(
496  "export",
497  $this->lng->txt("export") . "/" . $this->lng->txt("import"),
498  $this->ctrl->getLinkTarget($this, "showExportImport")
499  );
500  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showChecklist()

ilPersonalProfileGUI::showChecklist ( int  $active_step)
protected

Definition at line 1432 of file class.ilPersonalProfileGUI.php.

References $tpl, and ilGlobalTemplateInterface\setRightContent().

Referenced by executeCommand(), showPersonalData(), and showPublicProfile().

1432  : void
1433  {
1434  $main_tpl = $this->tpl;
1435  $main_tpl->setRightContent($this->checklist->render($active_step));
1436  }
ilGlobalTemplateInterface $tpl
setRightContent(string $a_html)
Sets content of right column.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showConsentWithdrawalConfirmation()

ilPersonalProfileGUI::showConsentWithdrawalConfirmation ( )
protected

Definition at line 324 of file class.ilPersonalProfileGUI.php.

References ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

324  : void
325  {
326  if (
327  !$this->user->getPref('consent_withdrawal_requested') ||
328  !$this->termsOfServiceHelper->isIncludedUser($this->user)
329  ) {
330  $this->errorHandler->raiseError($this->lng->txt('permission_denied'), $this->errorHandler->MESSAGE);
331  }
332 
333  $this->tabs->clearTargets();
334  $this->tabs->clearSubTabs();
335  $this->tpl->setTitle($this->lng->txt('refuse_tos_acceptance'));
336 
337  $tosWithdrawalGui = new ilTermsOfServiceWithdrawalGUIHelper($this->user);
338  $content = $tosWithdrawalGui->getConsentWithdrawalConfirmation($this);
339 
340  $this->tpl->setContent($content);
341  $this->tpl->setPermanentLink('usr', null, 'agreement');
342  $this->tpl->printToStdout();
343  }
+ Here is the call graph for this function:

◆ showExportImport()

ilPersonalProfileGUI::showExportImport ( )

Definition at line 1289 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilUser, $tpl, ilLinkButton\getInstance(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\printToStdout(), and setHeader().

1289  : void
1290  {
1291  global $DIC;
1292 
1293  $ilToolbar = $DIC['ilToolbar'];
1294  $ilCtrl = $DIC['ilCtrl'];
1295  $tpl = $DIC['tpl'];
1296  $ilTabs = $DIC['ilTabs'];
1297  $ilUser = $DIC['ilUser'];
1298 
1299  $ilTabs->activateTab("export");
1300  $this->setHeader();
1301 
1302  $button = ilLinkButton::getInstance();
1303  $button->setCaption("pd_export_profile");
1304  $button->setUrl($ilCtrl->getLinkTarget($this, "exportPersonalData"));
1305  $ilToolbar->addStickyItem($button);
1306 
1307  $exp_file = $ilUser->getPersonalDataExportFile();
1308  if ($exp_file != "") {
1309  $ilToolbar->addSeparator();
1310  $ilToolbar->addButton(
1311  $this->lng->txt("pd_download_last_export_file"),
1312  $ilCtrl->getLinkTarget($this, "downloadPersonalData")
1313  );
1314  }
1315 
1316  $ilToolbar->addSeparator();
1317  $ilToolbar->addButton(
1318  $this->lng->txt("pd_import_personal_data"),
1319  $ilCtrl->getLinkTarget($this, "importPersonalDataSelection")
1320  );
1321 
1322  $tpl->printToStdout();
1323  }
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
global $DIC
Definition: feed.php:28
ilGlobalTemplateInterface $tpl
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ showPersonalData()

ilPersonalProfileGUI::showPersonalData ( bool  $a_no_init = false,
bool  $a_migration_started = false 
)

Definition at line 582 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilUser, ILIAS\Repository\form(), ilCtrl\getLinkTarget(), initPersonalDataForm(), setHeader(), showChecklist(), ilProfileChecklistStatus\STEP_PROFILE_DATA, and ilLanguage\txt().

Referenced by goToEmailConfirmation(), savePersonalData(), and showProfile().

585  : void {
586  global $DIC;
587 
588  $ilUser = $DIC['ilUser'];
589  $lng = $DIC['lng'];
590  $ilTabs = $DIC['ilTabs'];
591  $prompt_service = new ilUserProfilePromptService();
592 
593  $ilTabs->activateTab("personal_data");
594  $ctrl = $DIC->ctrl();
595 
596  $it = "";
597  if ($this->profile_request->getPrompted() == 1) {
598  $it = $prompt_service->data()->getSettings()->getPromptText($ilUser->getLanguage());
599  }
600  if ($it === "") {
601  $it = $prompt_service->data()->getSettings()->getInfoText($ilUser->getLanguage());
602  }
603  if (trim($it) !== "") {
604  $pub_prof = in_array($ilUser->prefs["public_profile"] ?? "", array("y", "n", "g"))
605  ? $ilUser->prefs["public_profile"]
606  : "n";
607  $box = $DIC->ui()->factory()->messageBox()->info($it);
608  if ($pub_prof === "n") {
609  $box = $box->withLinks(
610  [$DIC->ui()->factory()->link()->standard(
611  $lng->txt("user_make_profile_public"),
612  $ctrl->getLinkTarget($this, "showPublicProfile")
613  )]
614  );
615  }
616  $it = $DIC->ui()->renderer()->render($box);
617  }
618  $this->setHeader();
619 
621 
622  if (!$a_no_init) {
623  $this->initPersonalDataForm();
624  // catch feedback message
625  if ($ilUser->getProfileIncomplete()) {
626  $this->tpl->setOnScreenMessage('info', $lng->txt("profile_incomplete"));
627  }
628  }
629 
630  $modal = '';
631  if ($this->email_change_confirmation_modal !== null) {
632  $modal = $this->ui_renderer->render($this->email_change_confirmation_modal);
633  }
634 
635  $this->tpl->setContent($it . $this->form->getHTML() . $modal);
636  $this->tpl->printToStdout();
637  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
form( $class_path, string $cmd)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showProfile()

ilPersonalProfileGUI::showProfile ( )

show profile form

/OLD IMPLEMENTATION DEPRECATED

Definition at line 275 of file class.ilPersonalProfileGUI.php.

References showPersonalData().

275  : void
276  {
277  $this->showPersonalData();
278  }
showPersonalData(bool $a_no_init=false, bool $a_migration_started=false)
+ Here is the call graph for this function:

◆ showPublicProfile()

ilPersonalProfileGUI::showPublicProfile ( bool  $a_no_init = false)

Definition at line 916 of file class.ilPersonalProfileGUI.php.

References $tabs, ilTabsGUI\activateTab(), ILIAS\Repository\form(), initPublicProfileForm(), setHeader(), showChecklist(), and ilProfileChecklistStatus\STEP_PUBLISH_OPTIONS.

Referenced by changeEmail().

916  : void
917  {
918  $ilTabs = $this->tabs;
919 
920  $ilTabs->activateTab("public_profile");
922 
923  $this->setHeader();
924 
925  if (!$a_no_init) {
926  $this->initPublicProfileForm();
927  }
928 
929  $this->tpl->setContent($this->form->getHTML());
930  $this->tpl->printToStdout();
931  }
form( $class_path, string $cmd)
activateTab(string $a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPublicProfileFields()

ilPersonalProfileGUI::showPublicProfileFields ( ilPropertyFormGUI  $form,
array  $prefs,
?object  $parent = null,
bool  $anonymized = false,
string  $key_suffix = "" 
)

Definition at line 1013 of file class.ilPersonalProfileGUI.php.

References $DIC, $ilUser, ILIAS\LTI\ToolProvider\$key, ilLink\_getLink(), ilObjUser\_getPersonalPicturePath(), ilPropertyFormGUI\addItem(), ilDatePresentation\formatDate(), ilBadgeHandler\getInstance(), ilBadgeAssignment\getInstancesByUserId(), IL_CAL_DATE, ILIAS\Repository\int(), ilMapUtil\isActivated(), ILIAS\Repository\lng(), ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setMultiValues(), ilNonEditableValueGUI\setValue(), ILIAS\Repository\user(), and userSettingVisible().

Referenced by initPublicProfileForm().

1019  : void {
1020  global $DIC;
1021 
1022  $ilUser = $DIC['ilUser'];
1023 
1024  $birthday = $ilUser->getBirthday();
1025  if ($birthday) {
1026  $birthday = ilDatePresentation::formatDate(new ilDate($birthday, IL_CAL_DATE));
1027  }
1028  $gender = $ilUser->getGender();
1029  if ($gender) {
1030  $gender = $this->lng->txt("gender_" . $gender);
1031  }
1032 
1033  $txt_sel_country = "";
1034  if ($ilUser->getSelectedCountry() != "") {
1035  $this->lng->loadLanguageModule("meta");
1036  $txt_sel_country = $this->lng->txt("meta_c_" . $ilUser->getSelectedCountry());
1037  }
1038 
1039  // profile picture
1040  $pic = ilObjUser::_getPersonalPicturePath($ilUser->getId(), "xsmall", true, true);
1041  if ($pic) {
1042  $pic = "<img src=\"" . $pic . "\" />";
1043  }
1044 
1045  // personal data
1046  $val_array = array(
1047  "title" => $ilUser->getUTitle(),
1048  "birthday" => $birthday,
1049  "gender" => $gender,
1050  "upload" => $pic,
1051  "interests_general" => $ilUser->getGeneralInterestsAsText(),
1052  "interests_help_offered" => $ilUser->getOfferingHelpAsText(),
1053  "interests_help_looking" => $ilUser->getLookingForHelpAsText(),
1054  "org_units" => $ilUser->getOrgUnitsRepresentation(),
1055  "institution" => $ilUser->getInstitution(),
1056  "department" => $ilUser->getDepartment(),
1057  "street" => $ilUser->getStreet(),
1058  "zipcode" => $ilUser->getZipcode(),
1059  "city" => $ilUser->getCity(),
1060  "country" => $ilUser->getCountry(),
1061  "sel_country" => $txt_sel_country,
1062  "phone_office" => $ilUser->getPhoneOffice(),
1063  "phone_home" => $ilUser->getPhoneHome(),
1064  "phone_mobile" => $ilUser->getPhoneMobile(),
1065  "fax" => $ilUser->getFax(),
1066  "email" => $ilUser->getEmail(),
1067  "second_email" => $ilUser->getSecondEmail(),
1068  "hobby" => $ilUser->getHobby(),
1069  "matriculation" => $ilUser->getMatriculation()
1070  );
1071 
1072  // location
1073  if (ilMapUtil::isActivated()) {
1074  $val_array["location"] = ((int) $ilUser->getLatitude() + (int) $ilUser->getLongitude() + (int) $ilUser->getLocationZoom() > 0)
1075  ? " "
1076  : "";
1077  }
1078  foreach ($val_array as $key => $value) {
1079  if (in_array($value, ["", "-"]) && !$anonymized) {
1080  continue;
1081  }
1082  if ($anonymized) {
1083  $value = null;
1084  }
1085 
1086  if ($this->userSettingVisible($key)) {
1087  // #18795 - we should use ilUserProfile
1088  switch ($key) {
1089  case "upload":
1090  $caption = "personal_picture";
1091  break;
1092 
1093  case "title":
1094  $caption = "person_title";
1095  break;
1096 
1097  default:
1098  $caption = $key;
1099  }
1100  $cb = new ilCheckboxInputGUI($this->lng->txt($caption), "chk_" . $key . $key_suffix);
1101  if (isset($prefs["public_" . $key]) && $prefs["public_" . $key] == "y") {
1102  $cb->setChecked(true);
1103  }
1104  //$cb->setInfo($value);
1105  $cb->setOptionTitle((string) $value);
1106 
1107  if (!$parent) {
1108  $form->addItem($cb);
1109  } else {
1110  $parent->addSubItem($cb);
1111  }
1112  }
1113  }
1114 
1115  // additional defined user data fields
1116  $user_defined_data = array();
1117  if (!$anonymized) {
1118  $user_defined_data = $ilUser->getUserDefinedData();
1119  }
1120  foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
1121  // public setting
1122  $cb = new ilCheckboxInputGUI($definition["field_name"], "chk_udf_" . $definition["field_id"] . $key_suffix);
1123  $cb->setOptionTitle($user_defined_data["f_" . $definition["field_id"]] ?? "");
1124  $public_udf = (string) ($prefs["public_udf_" . $definition["field_id"]] ?? '');
1125  if ($public_udf === 'y') {
1126  $cb->setChecked(true);
1127  }
1128 
1129  if (!$parent) {
1130  $form->addItem($cb);
1131  } else {
1132  $parent->addSubItem($cb);
1133  }
1134  }
1135 
1136  if (!$anonymized) {
1137  $handler = ilBadgeHandler::getInstance();
1138  if ($handler->isActive()) {
1139  $badge_options = array();
1140 
1141  foreach (ilBadgeAssignment::getInstancesByUserId($ilUser->getId()) as $ass) {
1142  // only active
1143  if ($ass->getPosition()) {
1144  $badge = new ilBadge($ass->getBadgeId());
1145  $badge_options[] = $badge->getTitle();
1146  }
1147  }
1148 
1149  if (count($badge_options) > 1) {
1150  $badge_order = new ilNonEditableValueGUI($this->lng->txt("obj_bdga"), "bpos" . $key_suffix);
1151  $badge_order->setMultiValues($badge_options);
1152  $badge_order->setValue(array_shift($badge_options));
1153  $badge_order->setMulti(true, true, false);
1154 
1155  if (!$parent) {
1156  $form->addItem($badge_order);
1157  } else {
1158  $parent->addSubItem($badge_order);
1159  }
1160  }
1161  }
1162  }
1163 
1164  // permalink
1165  $ne = new ilNonEditableValueGUI($this->lng->txt("perma_link"), "");
1166  $ne->setValue(ilLink::_getLink($this->user->getId(), "usr"));
1167  if (!$parent) {
1168  $form->addItem($ne);
1169  } else {
1170  $parent->addSubItem($ne);
1171  }
1172  }
static getInstancesByUserId(int $a_user_id)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
This class represents a checkbox property in a property form.
setMultiValues(array $a_values)
global $DIC
Definition: feed.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
static isActivated()
Checks whether Map feature is activated.
const IL_CAL_DATE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUserAgreement()

ilPersonalProfileGUI::showUserAgreement ( )
protected

Definition at line 280 of file class.ilPersonalProfileGUI.php.

References ilGlobalTemplateInterface\get(), ilSystemSupportContacts\getMailsToAddress(), ilTermsOfServiceHelper\isEnabled(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setVariable(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

280  : void
281  {
282  $this->tabs->clearTargets();
283  $this->tabs->clearSubTabs();
284 
285  $tpl = new \ilTemplate('tpl.view_terms_of_service.html', true, true, 'Services/Init');
286 
287  $this->tpl->setTitle($this->lng->txt('usr_agreement'));
288 
289  $noAgreement = true;
290  if (!$this->user->isAnonymous() && $this->user->getId() > 0 && $this->user->getAgreeDate()) {
291  $helper = new \ilTermsOfServiceHelper();
292 
293  $entity = $helper->getCurrentAcceptanceForUser($this->user);
294  if ($entity->getId()) {
295  $noAgreement = false;
296  $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', $entity->getText());
297  }
298  } else {
299  $handleDocument = \ilTermsOfServiceHelper::isEnabled() && $this->termsOfServiceEvaluation->hasDocument();
300  if ($handleDocument) {
301  $noAgreement = false;
302  $document = $this->termsOfServiceEvaluation->document();
303  $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', $document->content());
304  }
305  }
306 
307  if ($noAgreement) {
308  $tpl->setVariable(
309  'TERMS_OF_SERVICE_CONTENT',
310  sprintf(
311  $this->lng->txt('no_agreement_description'),
314  )
315  )
316  );
317  }
318 
319  $this->tpl->setContent($tpl->get());
320  $this->tpl->setPermanentLink('usr', null, 'agreement');
321  $this->tpl->printToStdout();
322  }
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
static getMailsToAddress()
Get mailto: emails.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ tempStorePicture()

ilPersonalProfileGUI::tempStorePicture ( )
private

Definition at line 1438 of file class.ilPersonalProfileGUI.php.

References ILIAS\Repository\form().

Referenced by savePersonalData().

1438  : void
1439  {
1440  $capture = $this->profile_request->getUserFileCapture();
1441 
1442  if ($capture !== '') {
1443  $this->form->getItemByPostVar('userfile')->setImage($capture);
1444  $hidden_user_picture_carry = new ilHiddenInputGUI('user_picture_carry');
1445  $hidden_user_picture_carry->setValue($capture);
1446  $this->form->addItem($hidden_user_picture_carry);
1447  }
1448  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLoginOrSetErrorMessages()

ilPersonalProfileGUI::updateLoginOrSetErrorMessages ( )
private

Definition at line 765 of file class.ilPersonalProfileGUI.php.

References Vendor\Package\$e, ilObjUser\_loginExists(), ILIAS\Repository\form(), ilUtil\isLogin(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by goToEmailConfirmation(), and savePersonalData().

765  : bool
766  {
767  $login = $this->form->getInput('username');
768  if ($login === '' || !ilUtil::isLogin($login)) {
769  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
770  $this->form->getItemByPostVar('username')->setAlert($this->lng->txt('login_invalid'));
771  return false;
772  }
773 
774  if (ilObjUser::_loginExists($login, $this->user->getId())) {
775  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
776  $this->form->getItemByPostVar('username')->setAlert($this->lng->txt('loginname_already_exists'));
777  return false;
778  }
779 
780  $this->user->setLogin($login);
781 
782  try {
783  $this->user->updateLogin($this->user->getLogin());
784  return true;
785  } catch (ilUserException $e) {
786  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
787  $this->form->getItemByPostVar('username')->setAlert($e->getMessage());
788  return false;
789  }
790  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _loginExists(string $a_login, int $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...
static isLogin(string $a_login)
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadUserPicture()

ilPersonalProfileGUI::uploadUserPicture ( )

Definition at line 164 of file class.ilPersonalProfileGUI.php.

References $data, $DIC, $ilUser, $img, convertUserPicture(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilFileUtils\getWebspaceDir(), ilFileUtils\ilTempnam(), ILIAS\Repository\lng(), ilFileUtils\makeDir(), and workWithUserSetting().

Referenced by savePersonalDataForm().

164  : void
165  {
166  global $DIC;
167  $ilUser = $DIC['ilUser'];
168 
169  if (!$this->workWithUserSetting("upload")) {
170  return;
171  }
172 
173  if (!$this->form->hasFileUpload('userfile')
174  && $this->profile_request->getUserFileCapture() === '') {
175  if ($this->form->getItemByPostVar("userfile")->getDeletionFlag()) {
176  $ilUser->removeUserPicture();
177  }
178  return;
179  }
180 
181  $webspace_dir = ilFileUtils::getWebspaceDir();
182  $image_dir = $webspace_dir . "/usr_images";
183  ilFileUtils::makeDir($image_dir);
184  $store_file = "usr_" . $ilUser->getID() . "." . "jpg";
185 
186  // store filename
187  $ilUser->setPref("profile_image", $store_file);
188  $ilUser->update();
189 
190  if ($this->form->hasFileUpload("userfile")) {
191  $file_info = $this->form->getFileUpload('userfile');
192  $tmp_path = $file_info['tmp_name'];
193  if (!$file_info['is_upload']) {
194  $new_path = ilFileUtils::ilTempnam();
195  rename($tmp_path, $new_path);
196  $tmp_path = $new_path;
197  }
198  $this->convertUserPicture($tmp_path, $image_dir);
199  return;
200  }
201 
202  $capture = $this->profile_request->getUserFileCapture();
203  if ($capture === null) {
204  return;
205  }
206 
207  $uploaded_file = $image_dir . DIRECTORY_SEPARATOR . "upload_" . $ilUser->getId() . ".png";
208  $img = str_replace(
209  ['data:image/png;base64,', ' '],
210  ['', '+'],
211  $capture
212  );
213  $data = base64_decode($img);
214  $success = file_put_contents($uploaded_file, $data);
215  if (!$success) {
216  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("upload_error_file_not_found", true));
217  $this->ctrl->redirect($this, "showProfile");
218  }
219 
220  $this->convertUserPicture($uploaded_file, $image_dir);
221  chmod($uploaded_file, 0770);
222  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
convertUserPicture(string $uploaded_file, string $image_dir)
global $DIC
Definition: feed.php:28
form( $class_path, string $cmd)
$img
Definition: imgupload.php:83
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
$ilUser
Definition: imgupload.php:34
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userSettingEnabled()

ilPersonalProfileGUI::userSettingEnabled ( string  $setting)

Definition at line 159 of file class.ilPersonalProfileGUI.php.

159  : bool
160  {
161  return $this->user_settings_config->isChangeable($setting);
162  }

◆ userSettingVisible()

ilPersonalProfileGUI::userSettingVisible ( string  $setting)

Definition at line 154 of file class.ilPersonalProfileGUI.php.

Referenced by __showOtherInformations(), and showPublicProfileFields().

154  : bool
155  {
156  return $this->user_settings_config->isVisible($setting);
157  }
+ Here is the caller graph for this function:

◆ withdrawAcceptance()

ilPersonalProfileGUI::withdrawAcceptance ( )
protected

Definition at line 362 of file class.ilPersonalProfileGUI.php.

References ilAuthUtils\AUTH_LDAP, ilAuthUtils\AUTH_LOCAL, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), and ILIAS\Repository\user().

362  : void
363  {
364  if (
365  !$this->user->getPref('consent_withdrawal_requested') ||
366  !$this->termsOfServiceHelper->isIncludedUser($this->user)
367  ) {
368  $this->errorHandler->raiseError($this->lng->txt('permission_denied'), $this->errorHandler->MESSAGE);
369  }
370  $this->termsOfServiceHelper->resetAcceptance($this->user);
371 
372  $defaultAuth = ilAuthUtils::AUTH_LOCAL;
373  if ($this->setting->get('auth_mode')) {
374  $defaultAuth = $this->setting->get('auth_mode');
375  }
376 
377  $withdrawalType = 0;
378  if (
379  $this->user->getAuthMode() == ilAuthUtils::AUTH_LDAP ||
380  ($this->user->getAuthMode() === 'default' && $defaultAuth == ilAuthUtils::AUTH_LDAP)
381  ) {
382  $withdrawalType = 2;
383  } elseif ($this->setting->get('tos_withdrawal_usr_deletion', '0') !== '0') {
384  $withdrawalType = 1;
385  }
386 
387  $domainEvent = new ilTermsOfServiceEventWithdrawn($this->user);
388  $this->eventHandler->raise(
389  'Services/TermsOfService',
390  'ilTermsOfServiceEventWithdrawn',
391  ['event' => $domainEvent]
392  );
393 
395  $this->auth_session->logout();
396 
397  $this->ctrl->redirectToURL('login.php?tos_withdrawal_type=' . $withdrawalType . '&cmd=force_login');
398  }
Class ilTermsOfServiceEventWithdrawn.
const SESSION_CLOSE_USER
static setClosingContext(int $a_context)
set closing context (for statistics)
+ Here is the call graph for this function:

◆ workWithUserSetting()

ilPersonalProfileGUI::workWithUserSetting ( string  $setting)

Definition at line 149 of file class.ilPersonalProfileGUI.php.

Referenced by uploadUserPicture().

149  : bool
150  {
151  return $this->user_settings_config->isVisibleAndChangeable($setting);
152  }
+ Here is the caller graph for this function:

Field Documentation

◆ $auth_session

ilAuthSession ilPersonalProfileGUI::$auth_session
protected

Definition at line 47 of file class.ilPersonalProfileGUI.php.

◆ $change_mail_token_repo

ProfileChangeMailTokenRepository ilPersonalProfileGUI::$change_mail_token_repo
private

Definition at line 59 of file class.ilPersonalProfileGUI.php.

◆ $checklist

ilProfileChecklistGUI ilPersonalProfileGUI::$checklist
protected

Definition at line 53 of file class.ilPersonalProfileGUI.php.

◆ $checklist_status

ilProfileChecklistStatus ilPersonalProfileGUI::$checklist_status
protected

Definition at line 55 of file class.ilPersonalProfileGUI.php.

◆ $ctrl

ilCtrl ilPersonalProfileGUI::$ctrl
protected

Definition at line 46 of file class.ilPersonalProfileGUI.php.

◆ $email_change_confirmation_modal

Interruptive ilPersonalProfileGUI::$email_change_confirmation_modal = null
protected

Definition at line 56 of file class.ilPersonalProfileGUI.php.

◆ $errorHandler

ilErrorHandling ilPersonalProfileGUI::$errorHandler
protected

Definition at line 52 of file class.ilPersonalProfileGUI.php.

◆ $eventHandler

ilAppEventHandler ilPersonalProfileGUI::$eventHandler
private

Definition at line 35 of file class.ilPersonalProfileGUI.php.

◆ $form

ilPropertyFormGUI ilPersonalProfileGUI::$form
protected

Definition at line 36 of file class.ilPersonalProfileGUI.php.

◆ $lng

ilLanguage ilPersonalProfileGUI::$lng
protected

◆ $password_error

string ilPersonalProfileGUI::$password_error
protected

Definition at line 37 of file class.ilPersonalProfileGUI.php.

◆ $profile_request

ILIAS User ProfileGUIRequest ilPersonalProfileGUI::$profile_request
protected

Definition at line 41 of file class.ilPersonalProfileGUI.php.

◆ $request

RequestInterface ilPersonalProfileGUI::$request
private

Definition at line 57 of file class.ilPersonalProfileGUI.php.

◆ $setting

ilSetting ilPersonalProfileGUI::$setting
protected

Definition at line 39 of file class.ilPersonalProfileGUI.php.

◆ $tabs

ilTabsGUI ilPersonalProfileGUI::$tabs
protected

Definition at line 49 of file class.ilPersonalProfileGUI.php.

Referenced by showPublicProfile().

◆ $termsOfServiceEvaluation

ilTermsOfServiceDocumentEvaluation ilPersonalProfileGUI::$termsOfServiceEvaluation
protected

Definition at line 50 of file class.ilPersonalProfileGUI.php.

◆ $termsOfServiceHelper

ilTermsOfServiceHelper ilPersonalProfileGUI::$termsOfServiceHelper
protected

Definition at line 51 of file class.ilPersonalProfileGUI.php.

◆ $tpl

◆ $ui_factory

UIFactory ilPersonalProfileGUI::$ui_factory
protected

Definition at line 42 of file class.ilPersonalProfileGUI.php.

◆ $ui_renderer

UIRenderer ilPersonalProfileGUI::$ui_renderer
protected

Definition at line 43 of file class.ilPersonalProfileGUI.php.

◆ $upload_error

string ilPersonalProfileGUI::$upload_error
protected

Definition at line 38 of file class.ilPersonalProfileGUI.php.

◆ $user

ilObjUser ilPersonalProfileGUI::$user
protected

Definition at line 40 of file class.ilPersonalProfileGUI.php.

◆ $user_defined_fields

ilUserDefinedFields ilPersonalProfileGUI::$user_defined_fields = null

Definition at line 48 of file class.ilPersonalProfileGUI.php.

◆ $user_settings_config

ilUserSettingsConfig ilPersonalProfileGUI::$user_settings_config
protected

Definition at line 54 of file class.ilPersonalProfileGUI.php.

◆ CHANGE_EMAIL_CMD

const ilPersonalProfileGUI::CHANGE_EMAIL_CMD = 'changeEmail'

Definition at line 34 of file class.ilPersonalProfileGUI.php.

Referenced by ilObjUserGUI\addAdminLocatorItems().

◆ PERSONAL_DATA_FORM_ID

const ilPersonalProfileGUI::PERSONAL_DATA_FORM_ID = 'pd'
private

Definition at line 33 of file class.ilPersonalProfileGUI.php.


The documentation for this class was generated from the following file: