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