ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 '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
490 [$this->getUserId()]
491 );
492 $cnt = 0;
493 if ($port !== []) {
494 foreach ($port as $u) {
495 $tpl->setCurrentBlock('portfolio');
496 foreach ($u as $link => $title) {
497 $cnt++;
498 $tpl->setVariable('HREF_PORTFOLIO', $link);
499 $tpl->setVariable('TITLE_PORTFOLIO', $title);
501 }
502 }
503 $tpl->setCurrentBlock('portfolios');
504 if ($cnt > 1) {
505 $this->lng->loadLanguageModule('prtf');
506 $tpl->setVariable('TXT_PORTFOLIO', $this->lng->txt('prtf_portfolios'));
507 } else {
508 $tpl->setVariable('TXT_PORTFOLIO', $this->lng->txt('portfolio'));
509 }
510 $tpl->parseCurrentBlock();
511 }
512
513 // map
515 && $this->getPublicPref($user, 'public_location') === 'y'
516 && $user->getLatitude() != '') {
517 $tpl->setVariable('TXT_LOCATION', $this->lng->txt('location'));
518
519 $map_gui = \ilMapUtil::getMapGUI();
520 $map_gui->setMapId('user_map_' . md5($user->getLogin()))
521 ->setWidth('350px')
522 ->setHeight('230px')
523 ->setLatitude($user->getLatitude())
524 ->setLongitude($user->getLongitude())
525 ->setZoom($user->getLocationZoom())
526 ->setEnableNavigationControl(true)
527 ->addUserMarker($user->getId());
528
529 $tpl->setVariable('MAP_CONTENT', $map_gui->getHtml());
530 }
531
532 foreach ($this->profile->getVisibleUserDefinedFields(Context::User) as $field) {
533 $value = $field->retrieveValueFromUser($user);
534 if ($value === '' || $value === '-' || $value === null) {
535 continue;
536 }
537 $tpl->setCurrentBlock('udf_data');
538 $tpl->setVariable('TXT_UDF_DATA', $field->getLabel($this->lng));
539 $tpl->setVariable('UDF_DATA', $value);
541 }
542
543 foreach ($this->getAdditional() as $key => $val) {
544 $tpl->setCurrentBlock('profile_data');
545 $tpl->setVariable('TXT_DATA', $key);
546 $tpl->setVariable('DATA', $val);
548 }
549
550 if ($this->getUserId() !== $this->current_user->getId()
551 && !$this->current_user->isAnonymous()
552 && !\ilObjUser::_isAnonymous($this->getUserId())) {
553 $button = \ilBuddySystemLinkButton::getInstanceByUserId($user->getId());
554 $tpl->setVariable('BUDDY_HTML', $button->getHtml());
555 }
556
557 //badge
558 $tpl->setVariable('USER_BADGES', $this->badges_renderer->render($user->getId()));
559
560 $goto = '';
561 if ($a_add_goto) {
562 $mtpl = $this->tpl;
563
564 $mtpl->setPermanentLink(
565 'usr',
566 $user->getId(),
567 '',
568 '_top'
569 );
570 }
571 return $tpl->get() . $goto;
572 }
573
577 public function deliverVCard(): void
578 {
579 // get user object
580 if (!\ilObject::_exists($this->getUserId())) {
581 return;
582 }
583 $user = new \ilObjUser($this->getUserId());
584
585 $vcard = new VCard();
586
587 // ilsharedresourceGUI: embedded in shared portfolio
588 if ($user->getPref('public_profile') != 'y' &&
589 $user->getPref('public_profile') != 'g' &&
590 strtolower($this->profile_request->getBaseClass()) != 'ilsharedresourcegui' &&
591 $this->current_user->getId() != $this->getUserId()
592 ) {
593 return;
594 }
595
596 $vcard->setName($user->getLastname(), $user->getFirstname(), '', $user->getUTitle());
597 $vcard->setNickname($user->getLogin());
598
599 list($image, $type) = (new \ilUserAvatarResolver($this->getUserId()))->getUserPictureForVCard();
600 if ($image !== null) {
601 $vcard->setPhoto($image, $type);
602 }
603
604 $val_arr = [
605 'getOrgUnitsRepresentation' => 'org_units', 'getInstitution' => 'institution',
606 'getDepartment' => 'department', 'getStreet' => 'street',
607 'getZipcode' => 'zipcode', 'getCity' => 'city', 'getCountry' => 'country',
608 'getPhoneOffice' => 'phone_office', 'getPhoneHome' => 'phone_home',
609 'getPhoneMobile' => 'phone_mobile', 'getFax' => 'fax', 'getEmail' => 'email',
610 'getHobby' => 'hobby', 'getMatriculation' => 'matriculation',
611 'getClientIP' => 'client_ip', 'dummy' => 'location'
612 ];
613
614 $org = [];
615 $adr = [];
616 foreach ($val_arr as $key => $value) {
617 // if value 'y' show information
618 if ($user->getPref('public_' . $value) == 'y') {
619 switch ($value) {
620 case 'institution':
621 $org[0] = $user->$key();
622 break;
623 case 'department':
624 $org[1] = $user->$key();
625 break;
626 case 'street':
627 $adr[2] = $user->$key();
628 break;
629 case 'zipcode':
630 $adr[5] = $user->$key();
631 break;
632 case 'city':
633 $adr[3] = $user->$key();
634 break;
635 case 'country':
636 $adr[6] = $user->$key();
637 break;
638 case 'phone_office':
639 $vcard->setPhone($user->$key(), VCard::TEL_TYPE_WORK);
640 break;
641 case 'phone_home':
642 $vcard->setPhone($user->$key(), VCard::TEL_TYPE_HOME);
643 break;
644 case 'phone_mobile':
645 $vcard->setPhone($user->$key(), VCard::TEL_TYPE_CELL);
646 break;
647 case 'fax':
648 $vcard->setPhone($user->$key(), VCard::TEL_TYPE_FAX);
649 break;
650 case 'email':
651 $vcard->setEmail($user->$key());
652 break;
653 case 'hobby':
654 $vcard->setNote($user->$key());
655 break;
656 case 'location':
657 $vcard->setPosition($user->getLatitude(), $user->getLongitude());
658 break;
659 }
660 }
661 }
662
663 if (count($org)) {
664 $vcard->setOrganization(implode(';', $org));
665 }
666 if (count($adr)) {
667 $vcard->setAddress(
668 $adr[0] ?? '',
669 $adr[1] ?? '',
670 $adr[2] ?? '',
671 $adr[3] ?? '',
672 $adr[4] ?? '',
673 $adr[5] ?? '',
674 $adr[6] ?? ''
675 );
676 }
677
678 \ilUtil::deliverData($vcard->buildVCard(), $vcard->getFilename(), $vcard->getMimetype());
679 }
680
684 protected function validateUser(int $usr_id): bool
685 {
686 if (\ilObject::_lookupType($usr_id) !== 'usr') {
687 return false;
688 }
689
690 $user = new \ilObjUser($usr_id);
691
692 if ($this->current_user->isAnonymous()) {
693 if (strtolower($this->ctrl->getCmd()) == strtolower('approveContactRequest')) {
694 $this->ctrl->redirectToURL('login.php?cmd=force_login&target=usr_' . $usr_id . '_contact_approved');
695 } elseif (strtolower($this->ctrl->getCmd()) == strtolower('ignoreContactRequest')) {
696 $this->ctrl->redirectToURL('login.php?cmd=force_login&target=usr_' . $usr_id . '_contact_ignored');
697 }
698
699 if ($user->getPref('public_profile') != 'g') {
700 // #12151
701 if ($user->getPref('public_profile') == 'y') {
702 $this->ctrl->redirectToURL('login.php?cmd=force_login&target=usr_' . $usr_id);
703 }
704
705 return false;
706 }
707 }
708
709 return true;
710 }
711
712 public function renderTitle(): void
713 {
714 $this->tpl->resetHeaderBlock();
715 $this->tpl->setTitle(\ilUserUtil::getNamePresentation($this->getUserId()));
716 $this->tpl->setTitleIcon(\ilObjUser::_getPersonalPicturePath($this->getUserId(), 'xsmall'));
717 }
718
722 protected function getProfilePortfolio(): ?int
723 {
724 $portfolio_id = \ilObjPortfolio::getDefaultPortfolio($this->getUserId());
725 if ($portfolio_id) {
726 $access_handler = new \ilPortfolioAccessHandler();
727 if ($access_handler->checkAccess('read', '', $portfolio_id)) {
728 return $portfolio_id;
729 }
730 }
731 return null;
732 }
733
734 protected function doProfileAutoComplete(): void
735 {
736 $field_id = $this->profile_request->getFieldId();
737 $term = $this->profile_request->getTerm();
738
739 $result = [];
740 $multi_fields = [
741 'interests_general',
742 'interests_help_offered',
743 'interests_help_looking'
744 ];
745 if (in_array($field_id, $multi_fields) && $term) {
746 // registration has no current user
747 $user_id = null;
748 if ($this->current_user->getId() !== 0 && $this->current_user->getId() !== ANONYMOUS_USER_ID) {
749 $user_id = $this->current_user->getId();
750 }
751
752 $result = [];
753 $cnt = 0;
754
755 // term is searched in ALL interest fields, no distinction
756 foreach (\ilObjUser::findInterests($term, $this->current_user->getId()) as $item) {
757 $result[$cnt] = new stdClass();
758 $result[$cnt]->value = $item;
759 $result[$cnt]->label = $item;
760 $cnt++;
761 }
762 }
763
764 echo json_encode($result, JSON_THROW_ON_ERROR);
765 exit();
766 }
767
768 protected function approveContactRequest(): void
769 {
770 $osd_id = $this->profile_request->getOsdId();
771 if ($osd_id) {
772 $this->ctrl->setParameterByClass('ilBuddySystemGUI', 'osd_id', $osd_id);
773 }
774 $this->ctrl->setParameterByClass('ilBuddySystemGUI', 'user_id', $this->getUserId());
775 $this->ctrl->redirectByClass([self::class, 'ilBuddySystemGUI'], 'link');
776 }
777
778 protected function ignoreContactRequest(): void
779 {
780 $osd_id = $this->profile_request->getOsdId();
781 if ($osd_id > 0) {
782 $this->ctrl->setParameterByClass('ilBuddySystemGUI', 'osd_id', $osd_id);
783 }
784
785 $this->ctrl->setParameterByClass('ilBuddySystemGUI', 'user_id', $this->getUserId());
786 $this->ctrl->redirectByClass([self::class, 'ilBuddySystemGUI'], 'ignore');
787 }
788}
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