ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.PublicProfileGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\User\Profile;
22
27
34{
35 private bool $offline = false;
37 private int $userid = 0;
38 private string $backurl = '';
39 private array $additional = []; // Missing array type.
40 private bool $embedded = false;
41 private array $custom_prefs = []; // Missing array type.
42 private \ilObjUser $current_user;
44 private \ilSetting $setting;
45 private \ilCtrl $ctrl;
46 private \ilTabsGUI $tabs;
47 private \ilGlobalTemplateInterface $tpl;
48 private \ilRbacSystem $rbac_system;
49 private Language $lng;
51
52 public function __construct(int $a_user_id = 0)
53 {
55 global $DIC;
56
57 $this->ctrl = $DIC['ilCtrl'];
58 $this->lng = $DIC['lng'];
59 $this->current_user = $DIC['ilUser'];
60 $this->setting = $DIC['ilSetting'];
61 $this->tabs = $DIC['ilTabs'];
62 $this->tpl = $DIC['tpl'];
63 $this->rbac_system = $DIC['rbacsystem'];
64 $this->lng = $DIC['lng'];
65
66 $this->profile = LocalDIC::dic()[Profile::class];
67
68 $this->profile_request = new GUIRequest(
69 $DIC->http(),
70 $DIC->refinery()
71 );
72
73 $this->badges_renderer = new PublicUserProfileBadgesRenderer();
74
75 if ($a_user_id) {
76 $this->setUserId($a_user_id);
77 } else {
78 $this->setUserId($this->profile_request->getUserId());
79 }
80
81 $this->ctrl->saveParameter($this, ['user_id','back_url', 'user']);
82 $back_url = $this->profile_request->getBackUrl();
83 if ($back_url !== '') {
84 $this->setBackUrl($back_url);
85 }
86
87 $this->lng->loadLanguageModule('user');
88 }
89
90 public function setUserId(int $a_userid): void
91 {
92 $this->userid = $a_userid;
93 }
94
95 public function getUserId(): int
96 {
97 return $this->userid;
98 }
99
103 public function setAdditional(array $a_additional): void
104 {
105 $this->additional = $a_additional;
106 }
107
108 public function getAdditional(): array
109 {
110 return $this->additional;
111 }
112
116 public function setBackUrl(string $backurl): void
117 {
118 // we only allow relative links
119 $parts = parse_url($backurl);
120 $host = $parts['host'] ?? '';
121 if ($host !== '') {
122 $backurl = '#';
123 }
124 $this->backurl = $backurl;
125 $this->ctrl->setParameter($this, 'back_url', rawurlencode($backurl));
126 }
127
128 public function getBackUrl(): string
129 {
130 return $this->backurl;
131 }
132
136 public function setCustomPrefs(array $a_prefs): void // Missing array type.
137 {
138 $this->custom_prefs = $a_prefs;
139 }
140
144 protected function getPublicPref(\ilObjUser $a_user, string $a_id): string
145 {
146 if (!$this->custom_prefs) {
147 return (string) $a_user->getPref($a_id);
148 } else {
149 return (string) ($this->custom_prefs[$a_id] ?? '');
150 }
151 }
152
153 public function setEmbedded(bool $a_value, bool $a_offline = false): void
154 {
155 $this->embedded = $a_value;
156 $this->offline = $a_offline;
157 }
158
159 public function executeCommand(): string
160 {
161 $ret = '';
162 if (!$this->validateUser($this->getUserId())) {
163 return '';
164 }
165 $next_class = $this->ctrl->getNextClass($this);
166 $cmd = $this->ctrl->getCmd();
167
168 $this->tpl->loadStandardTemplate();
169
170 switch ($next_class) {
171 case strtolower(\ilBuddySystemGUI::class):
172 $gui = new \ilBuddySystemGUI();
173 $this->ctrl->setReturn($this, 'view');
174 $this->ctrl->forwardCommand($gui);
175 break;
176 case strtolower(\ilObjPortfolioGUI::class):
177 $portfolio_id = $this->getProfilePortfolio();
178 if ($portfolio_id
179 && $cmd !== 'deliverVCard') {
180 $gui = new \ilObjPortfolioGUI($portfolio_id); // #11876
181 $gui->setAdditional($this->getAdditional());
182 $gui->setPermaLink($this->getUserId(), 'usr');
183 $this->ctrl->forwardCommand($gui);
184 break;
185 }
186 // no break
187 default:
188 $ret = $this->$cmd();
189 $this->tpl->setContent($ret);
190 break;
191 }
192
193 // only for direct links
194 if (strtolower($this->profile_request->getBaseClass()) === strtolower(self::class)) {
195 $this->tpl->printToStdout();
196 }
197 return (string) $ret;
198 }
199
203 public function view(): string
204 {
205 return $this->getHTML();
206 }
207
208 protected function isProfilePublic(): bool
209 {
210 $user = new \ilObjUser($this->getUserId());
211 $current = $user->getPref('public_profile');
212 if ($user->getPref('public_profile') === 'g' && !$this->setting->get('enable_global_profiles')) {
213 $current = 'y';
214 }
215 return in_array($current, ['g', 'y']);
216 }
217
218 public function getHTML(): string
219 {
220 if ($this->embedded) {
221 return $this->getEmbeddable();
222 }
223
224 // #15438 - (currently) inactive user?
225 $is_active = true;
226 $user = new \ilObjUser($this->getUserId());
227 if (!$user->getActive() ||
228 !$user->checkTimeLimit()) {
229 $is_active = false;
230 }
231
232 if ($is_active && $this->getProfilePortfolio()) {
233 $this->ctrl->redirectByClass('ilobjportfoliogui', 'preview');
234 }
235
236 if (!$is_active) {
237 \ilUtil::redirect('ilias.php?baseClass=ilDashboardGUI');
238 }
239
240 $profile_public = $user->getPref('public_profile');
241 if ($user->getPref('public_profile') === 'g' && !$this->setting->get('enable_global_profiles')) {
242 $profile_public = 'y';
243 }
244
245 if ($profile_public !== 'y'
246 && ($profile_public !== 'g' || !$this->setting->get('enable_global_profiles'))
247 && !$this->custom_prefs) {
248 \ilUtil::redirect('ilias.php?baseClass=ilDashboardGUI');
249 }
250
251 $this->renderTitle();
252 return $this->getEmbeddable(true);
253 }
254
255
260 public function getEmbeddable(bool $a_add_goto = false): string
261 {
262 $h = $v = '';
263
264 // get user object
265 if (!\ilObject::_exists($this->getUserId())) {
266 return '';
267 }
268 $user = new \ilObjUser($this->getUserId());
269
270 $tpl = new \ilTemplate(
271 'tpl.usr_public_profile.html',
272 true,
273 true,
274 'components/ILIAS/User'
275 );
276
277
278 $tpl->setVariable('ROWCOL1', 'tblrow1');
279 $tpl->setVariable('ROWCOL2', 'tblrow2');
280
281 if (!$this->offline && $this->current_user->getId() !== ANONYMOUS_USER_ID) {
282 $ref_url = str_replace('&amp;', '&', $this->getBackUrl());
283 if ($ref_url === '') {
284 $ref_url = basename($_SERVER['REQUEST_URI']);
285 }
286
287 $mail_url = '';
288 if ($this->rbac_system->checkAccess('internal_mail', \ilMailGlobalServices::getMailObjectRefId())) {
290 $ref_url,
291 '',
292 [],
293 [
294 'type' => 'new',
295 'rcp_to' => $user->getLogin()
296 ]
297 );
298 } elseif ($user->getPref('public_profile') === 'g'
299 || !$this->current_user->isAnonymous()
300 && $user->getPref('public_profile') === 'y'
301 && $user->getPref('public_email')
302 && $user->getEmail() !== '') {
303 $mail_url = 'mailto:' . $user->getEmail();
304 }
305
306 if ($mail_url !== '') {
307 $tpl->setCurrentBlock('mail');
308 $tpl->setVariable('TXT_MAIL', $this->lng->txt('send_mail'));
309 $tpl->setVariable('HREF_MAIL', $mail_url);
311 }
312 }
313
314 if (!$this->isProfilePublic()) {
315 $tpl->setVariable('TXT_NAME', $this->lng->txt('name'));
316 $tpl->setVariable('FIRSTNAME', \ilUserUtil::getNamePresentation($user->getId()));
317 return $tpl->get();
318 }
319
320 $first_name = '';
321 if ($this->getPublicPref($user, 'public_title') === 'y') {
322 $first_name .= $user->getUTitle() . ' ';
323 }
324 $first_name .= $user->getFirstname();
325
326 if ($this->getPublicPref($user, 'public_gender') === 'y' && in_array($user->getGender(), ['m', 'f'])) {
328 'SALUTATION',
329 "{$this->lng->txt("salutation_{$user->getGender()}")} "
330 );
331 }
332
333 $tpl->setVariable('TXT_NAME', $this->lng->txt('name'));
334 $tpl->setVariable('FIRSTNAME', $first_name);
335 $tpl->setVariable('LASTNAME', $user->getLastname());
336
337 if ($user->getBirthday()
338 && $this->getPublicPref($user, 'public_birthday') == 'y') {
339 $tpl->setCurrentBlock('bday_bl');
340 $tpl->setVariable('TXT_BIRTHDAY', $this->lng->txt('birthday'));
341 $tpl->setVariable('VAL_BIRTHDAY', \ilDatePresentation::formatDate(new \ilDate($user->getBirthday(), IL_CAL_DATE)));
343 }
344
345 if (!$this->offline) {
346 $tpl->setCurrentBlock('vcard');
347 $tpl->setVariable('TXT_VCARD', $this->lng->txt('vcard'));
348 $tpl->setVariable('TXT_DOWNLOAD_VCARD', $this->lng->txt('vcard_download'));
349 $this->ctrl->setParameter($this, 'user_id', $this->getUserId());
350 $tpl->setVariable('HREF_VCARD', $this->ctrl->getLinkTarget($this, 'deliverVCard'));
351 }
352
353 $imagefile = \ilObjUser::_getPersonalPicturePath($user->getId(), 'big', false, true);
354 if ($this->getPublicPref($user, 'public_upload') === 'y' && $imagefile !== ''
355 && ($this->current_user->getId() !== ANONYMOUS_USER_ID || $user->getPref('public_profile') === 'g')) {
356
357 $tpl->setCurrentBlock('image');
358 $tpl->setVariable('TXT_IMAGE', $this->lng->txt('image'));
359 $tpl->setVariable('IMAGE_PATH', $imagefile);
360 $tpl->setVariable('IMAGE_ALT', $this->lng->txt('personal_picture'));
361 $tpl->parseCurrentBlock();
362 }
363
364 // address
365 if ($this->getPublicPref($user, 'public_street') == 'y' ||
366 $this->getPublicPref($user, 'public_zipcode') == 'y' ||
367 $this->getPublicPref($user, 'public_city') == 'y' ||
368 $this->getPublicPref($user, 'public_country') == 'y') {
369 $address = [];
370 $val_arr = [
371 'getStreet' => 'street',
372 'getZipcode' => 'zipcode',
373 'getCity' => 'city',
374 'getCountry' => 'country',
375 'getSelectedCountry' => 'sel_country'
376 ];
377 foreach ($val_arr as $key => $value) {
378 // if value 'y' show information
379 if ($this->getPublicPref($user, 'public_' . $value) == 'y') {
380 $address_value = $user->$key();
381
382 // only if set
383 if (trim($address_value) != '') {
384 switch ($value) {
385 case 'street':
386 $address[0] = $address_value;
387 break;
388
389 case 'zipcode':
390 case 'city':
391 $address[1] = isset($address[1])
392 ? "{$address[1]} {$address_value}"
393 : $address_value;
394 break;
395
396 case 'sel_country':
397 $this->lng->loadLanguageModule('meta');
398 $address[2] = $this->lng->txt('meta_c_' . $address_value);
399 break;
400
401 case 'country':
402 $address[2] = $address_value;
403 break;
404 }
405 }
406 }
407 }
408 if ($address !== []) {
409 $tpl->setCurrentBlock('address_line');
410 foreach ($address as $line) {
411 if (trim($line)) {
412 $tpl->setVariable('TXT_ADDRESS_LINE', trim($line));
414 }
415 }
416 $tpl->setCurrentBlock('address');
417 $tpl->setVariable('TXT_ADDRESS', $this->lng->txt('address'));
418 $tpl->parseCurrentBlock();
419 }
420 }
421
422 // if value 'y' show information
423 if ($this->getPublicPref($user, 'public_org_units') === 'y') {
424 $tpl->setCurrentBlock('org_units');
425 $tpl->setVariable('TXT_ORG_UNITS', $this->lng->txt('objs_orgu'));
426 $tpl->setVariable('ORG_UNITS', $user->getOrgUnitsRepresentation());
428 }
429
430 if ($this->getPublicPref($user, 'public_institution') === 'y'
431 || $this->getPublicPref($user, 'public_department') === 'y') {
432 $tpl->setCurrentBlock('inst_dep');
433 $sep = '';
434 if ($this->getPublicPref($user, 'public_institution') === 'y') {
435 $h = $this->lng->txt('institution');
436 $v = $user->getInstitution();
437 $sep = ' / ';
438 }
439 if ($this->getPublicPref($user, 'public_department') === 'y') {
440 $h .= $sep . $this->lng->txt('department');
441 $v .= $sep . $user->getDepartment();
442 }
443 $tpl->setVariable('TXT_INST_DEP', $h);
444 $tpl->setVariable('INST_DEP', $v);
446 }
447
448 // contact
449 $val_arr = [
450 'getPhoneOffice' => 'phone_office', 'getPhoneHome' => 'phone_home',
451 'getPhoneMobile' => 'phone_mobile', 'getFax' => 'fax', 'getEmail' => 'email', 'getSecondEmail' => 'second_email'
452 ];
453 $v = $sep = '';
454 foreach ($val_arr as $key => $value) {
455 // if value 'y' show information
456 if ($this->getPublicPref($user, 'public_' . $value) == 'y') {
457 $v .= $sep . $this->lng->txt($value) . ': ' . $user->$key();
458 $sep = '<br />';
459 }
460 }
461 if ($v != '') {
462 $tpl->parseCurrentBlock('contact');
463 $tpl->setVariable('TXT_CONTACT', $this->lng->txt('contact'));
464 $tpl->setVariable('CONTACT', $v);
466 }
467
468
469 $val_arr = [
470 'getHobby' => 'hobby',
471 'getGeneralInterestsAsText' => 'interests_general',
472 'getOfferingHelpAsText' => 'interests_help_offered',
473 'getLookingForHelpAsText' => 'interests_help_looking',
474 'getMatriculation' => 'matriculation',
475 'getClientIP' => 'client_ip'
476 ];
477
478 foreach ($val_arr as $key => $value) {
479 // if value 'y' show information
480 if ($this->getPublicPref($user, 'public_' . $value) == 'y') {
481 $tpl->setCurrentBlock('profile_data');
482 $tpl->setVariable('TXT_DATA', $this->lng->txt($value));
483 $tpl->setVariable('DATA', $user->$key());
485 }
486 }
487
488 // portfolios
489 $back = ($this->getBackUrl() != '')
490 ? $this->getBackUrl()
491 : \ilLink::_getStaticLink($this->getUserId(), 'usr', true);
493 [$this->getUserId()],
494 $back
495 );
496 $cnt = 0;
497 if ($port !== []) {
498 foreach ($port as $u) {
499 $tpl->setCurrentBlock('portfolio');
500 foreach ($u as $link => $title) {
501 $cnt++;
502 $tpl->setVariable('HREF_PORTFOLIO', $link);
503 $tpl->setVariable('TITLE_PORTFOLIO', $title);
505 }
506 }
507 $tpl->setCurrentBlock('portfolios');
508 if ($cnt > 1) {
509 $this->lng->loadLanguageModule('prtf');
510 $tpl->setVariable('TXT_PORTFOLIO', $this->lng->txt('prtf_portfolios'));
511 } else {
512 $tpl->setVariable('TXT_PORTFOLIO', $this->lng->txt('portfolio'));
513 }
514 $tpl->parseCurrentBlock();
515 }
516
517 // map
519 && $this->getPublicPref($user, 'public_location') === 'y'
520 && $user->getLatitude() != '') {
521 $tpl->setVariable('TXT_LOCATION', $this->lng->txt('location'));
522
523 $map_gui = \ilMapUtil::getMapGUI();
524 $map_gui->setMapId('user_map_' . md5($user->login))
525 ->setWidth('350px')
526 ->setHeight('230px')
527 ->setLatitude($user->getLatitude())
528 ->setLongitude($user->getLongitude())
529 ->setZoom($user->getLocationZoom())
530 ->setEnableNavigationControl(true)
531 ->addUserMarker($user->getId());
532
533 $tpl->setVariable('MAP_CONTENT', $map_gui->getHtml());
534 }
535
536 foreach ($this->profile->getVisibleUserDefinedFields(Context::User) as $field) {
537 // public setting
538 if ($this->getPublicPref($user, 'public_udf_' . $field->getIdentifier()) === 'y'
539 && !empty(($value = $field->retrieveValueFromUser($user)))) {
540 $tpl->setCurrentBlock('udf_data');
541 $tpl->setVariable('TXT_UDF_DATA', $field->getLabel($this->lng));
542 $tpl->setVariable('UDF_DATA', $value);
544 }
545 }
546
547 foreach ($this->getAdditional() as $key => $val) {
548 $tpl->setCurrentBlock('profile_data');
549 $tpl->setVariable('TXT_DATA', $key);
550 $tpl->setVariable('DATA', $val);
552 }
553
554 if ($this->getUserId() !== $this->current_user->getId()
555 && !$this->current_user->isAnonymous()
556 && !\ilObjUser::_isAnonymous($this->getUserId())) {
557 $button = \ilBuddySystemLinkButton::getInstanceByUserId($user->getId());
558 $tpl->setVariable('BUDDY_HTML', $button->getHtml());
559 }
560
561 //badge
562 $tpl->setVariable('USER_BADGES', $this->badges_renderer->render($user->getId()));
563
564 $goto = '';
565 if ($a_add_goto) {
566 $mtpl = $this->tpl;
567
568 $mtpl->setPermanentLink(
569 'usr',
570 $user->getId(),
571 '',
572 '_top'
573 );
574 }
575 return $tpl->get() . $goto;
576 }
577
581 public function deliverVCard(): void
582 {
583 // get user object
584 if (!\ilObject::_exists($this->getUserId())) {
585 return;
586 }
587 $user = new \ilObjUser($this->getUserId());
588
589 $vcard = new VCard();
590
591 // ilsharedresourceGUI: embedded in shared portfolio
592 if ($user->getPref('public_profile') != 'y' &&
593 $user->getPref('public_profile') != 'g' &&
594 strtolower($this->profile_request->getBaseClass()) != 'ilsharedresourcegui' &&
595 $this->current_user->getId() != $this->getUserId()
596 ) {
597 return;
598 }
599
600 $vcard->setName($user->getLastname(), $user->getFirstname(), '', $user->getUTitle());
601 $vcard->setNickname($user->getLogin());
602
603 list($image, $type) = (new \ilUserAvatarResolver($this->getUserId()))->getUserPictureForVCard();
604 if ($image !== null) {
605 $vcard->setPhoto($image, $type);
606 }
607
608 $val_arr = [
609 'getOrgUnitsRepresentation' => 'org_units', 'getInstitution' => 'institution',
610 'getDepartment' => 'department', 'getStreet' => 'street',
611 'getZipcode' => 'zipcode', 'getCity' => 'city', 'getCountry' => 'country',
612 'getPhoneOffice' => 'phone_office', 'getPhoneHome' => 'phone_home',
613 'getPhoneMobile' => 'phone_mobile', 'getFax' => 'fax', 'getEmail' => 'email',
614 'getHobby' => 'hobby', 'getMatriculation' => 'matriculation',
615 'getClientIP' => 'client_ip', 'dummy' => 'location'
616 ];
617
618 $org = [];
619 $adr = [];
620 foreach ($val_arr as $key => $value) {
621 // if value 'y' show information
622 if ($user->getPref('public_' . $value) == 'y') {
623 switch ($value) {
624 case 'institution':
625 $org[0] = $user->$key();
626 break;
627 case 'department':
628 $org[1] = $user->$key();
629 break;
630 case 'street':
631 $adr[2] = $user->$key();
632 break;
633 case 'zipcode':
634 $adr[5] = $user->$key();
635 break;
636 case 'city':
637 $adr[3] = $user->$key();
638 break;
639 case 'country':
640 $adr[6] = $user->$key();
641 break;
642 case 'phone_office':
643 $vcard->setPhone($user->$key(), VCard::TEL_TYPE_WORK);
644 break;
645 case 'phone_home':
646 $vcard->setPhone($user->$key(), VCard::TEL_TYPE_HOME);
647 break;
648 case 'phone_mobile':
649 $vcard->setPhone($user->$key(), VCard::TEL_TYPE_CELL);
650 break;
651 case 'fax':
652 $vcard->setPhone($user->$key(), VCard::TEL_TYPE_FAX);
653 break;
654 case 'email':
655 $vcard->setEmail($user->$key());
656 break;
657 case 'hobby':
658 $vcard->setNote($user->$key());
659 break;
660 case 'location':
661 $vcard->setPosition($user->getLatitude(), $user->getLongitude());
662 break;
663 }
664 }
665 }
666
667 if (count($org)) {
668 $vcard->setOrganization(implode(';', $org));
669 }
670 if (count($adr)) {
671 $vcard->setAddress(
672 $adr[0] ?? '',
673 $adr[1] ?? '',
674 $adr[2] ?? '',
675 $adr[3] ?? '',
676 $adr[4] ?? '',
677 $adr[5] ?? '',
678 $adr[6] ?? ''
679 );
680 }
681
682 \ilUtil::deliverData($vcard->buildVCard(), $vcard->getFilename(), $vcard->getMimetype());
683 }
684
688 protected function validateUser(int $usrId): bool
689 {
690 if (\ilObject::_lookupType($usrId) != 'usr') {
691 return false;
692 }
693
694 $user = new \ilObjUser($usrId);
695
696 if ($this->current_user->isAnonymous()) {
697 if (strtolower($this->ctrl->getCmd()) == strtolower('approveContactRequest')) {
698 $this->ctrl->redirectToURL('login.php?cmd=force_login&target=usr_' . $usrId . '_contact_approved');
699 } elseif (strtolower($this->ctrl->getCmd()) == strtolower('ignoreContactRequest')) {
700 $this->ctrl->redirectToURL('login.php?cmd=force_login&target=usr_' . $usrId . '_contact_ignored');
701 }
702
703 if ($user->getPref('public_profile') != 'g') {
704 // #12151
705 if ($user->getPref('public_profile') == 'y') {
706 $this->ctrl->redirectToURL('login.php?cmd=force_login&target=usr_' . $usrId);
707 }
708
709 return false;
710 }
711 }
712
713 return true;
714 }
715
716 public function renderTitle(): void
717 {
718 $this->tpl->resetHeaderBlock();
719 $this->tpl->setTitle(\ilUserUtil::getNamePresentation($this->getUserId()));
720 $this->tpl->setTitleIcon(\ilObjUser::_getPersonalPicturePath($this->getUserId(), 'xsmall'));
721 }
722
726 protected function getProfilePortfolio(): ?int
727 {
728 $portfolio_id = \ilObjPortfolio::getDefaultPortfolio($this->getUserId());
729 if ($portfolio_id) {
730 $access_handler = new \ilPortfolioAccessHandler();
731 if ($access_handler->checkAccess('read', '', $portfolio_id)) {
732 return $portfolio_id;
733 }
734 }
735 return null;
736 }
737
738 protected function doProfileAutoComplete(): void
739 {
740 $field_id = $this->profile_request->getFieldId();
741 $term = $this->profile_request->getTerm();
742
743 $result = [];
744 $multi_fields = [
745 'interests_general',
746 'interests_help_offered',
747 'interests_help_looking'
748 ];
749 if (in_array($field_id, $multi_fields) && $term) {
750 // registration has no current user
751 $user_id = null;
752 if ($this->current_user->getId() !== 0 && $this->current_user->getId() !== ANONYMOUS_USER_ID) {
753 $user_id = $this->current_user->getId();
754 }
755
756 $result = [];
757 $cnt = 0;
758
759 // term is searched in ALL interest fields, no distinction
760 foreach (\ilObjUser::findInterests($term, $this->current_user->getId()) as $item) {
761 $result[$cnt] = new stdClass();
762 $result[$cnt]->value = $item;
763 $result[$cnt]->label = $item;
764 $cnt++;
765 }
766 }
767
768 echo json_encode($result, JSON_THROW_ON_ERROR);
769 exit();
770 }
771
772 protected function approveContactRequest(): void
773 {
774 $osd_id = $this->profile_request->getOsdId();
775 if ($osd_id) {
776 $this->ctrl->setParameterByClass('ilBuddySystemGUI', 'osd_id', $osd_id);
777 }
778 $this->ctrl->setParameterByClass('ilBuddySystemGUI', 'user_id', $this->getUserId());
779 $this->ctrl->redirectByClass([self::class, 'ilBuddySystemGUI'], 'link');
780 }
781
782 protected function ignoreContactRequest(): void
783 {
784 $osd_id = $this->profile_request->getOsdId();
785 if ($osd_id > 0) {
786 $this->ctrl->setParameterByClass('ilBuddySystemGUI', 'osd_id', $osd_id);
787 }
788
789 $this->ctrl->setParameterByClass('ilBuddySystemGUI', 'user_id', $this->getUserId());
790 $this->ctrl->redirectByClass([self::class, 'ilBuddySystemGUI'], 'ignore');
791 }
792}
GUI class for public user profile presentation.
getProfilePortfolio()
Check if current profile portfolio is accessible.
setCustomPrefs(array $a_prefs)
Set custom preferences for public profile fields.
PublicUserProfileBadgesRenderer $badges_renderer
deliverVCard()
Deliver vcard information.
setBackUrl(string $backurl)
Set Back Link URL.
setAdditional(array $a_additional)
Set Additonal Information.
getEmbeddable(bool $a_add_goto=false)
get public profile html code Used in Personal Profile (as preview) and Portfolio (as page block)
validateUser(int $usrId)
Check if given user id is valid.
setEmbedded(bool $a_value, bool $a_offline=false)
getPublicPref(\ilObjUser $a_user, string $a_id)
Get user preference for public profile.
RFC 2426 vCard MIME Directory Profile 3.0 class.
Definition: VCard.php:28
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76
const IL_CAL_DATE
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
Class for single dates.
static getLinkTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static isActivated()
Checks whether Map feature is activated.
static getMapGUI()
Get an instance of the GUI class.
static getDefaultPortfolio(int $a_user_id)
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, ?string $a_back_url=null)
User class.
static _isAnonymous(int $usr_id)
getPref(string $a_keyword)
static findInterests(string $a_term, ?int $a_user_id=null, ?string $a_field_id=null)
static _getPersonalPicturePath(int $a_usr_id, string $a_size='small', bool $a_force_pic=false)
static _lookupType(int $id, bool $reference=false)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
static redirect(string $a_script)
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
const ANONYMOUS_USER_ID
Definition: constants.php:27
exit
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
global $DIC
Definition: shib_login.php:26