41 $ilCtrl->saveParameter($this, array(
"user_id",
"back_url",
"user"));
42 if (
$_GET[
"back_url"] !=
"")
47 $lng->loadLanguageModule(
"user");
57 $this->userid = $a_userid;
77 $this->additional = $a_additional;
100 $parts = parse_url($a_backurl);
106 $this->backurl = $a_backurl;
107 $ilCtrl->setParameter($this,
"back_url", rawurlencode($a_backurl));
127 $this->custom_prefs = $a_prefs;
141 if(!$this->custom_prefs)
143 return $a_user->
getPref($a_id);
147 return $this->custom_prefs[$a_id];
153 $this->embedded = (bool)$a_value;
154 $this->offline = (bool)$a_offline;
164 if(!self::validateUser($this->
getUserId()))
169 $next_class = $ilCtrl->getNextClass($this);
170 $cmd = $ilCtrl->getCmd();
172 $tpl->getStandardTemplate();
176 case "ilobjportfoliogui":
180 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
182 $plink = $plink->getHTML();
184 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioGUI.php";
187 $gui->setPermaLink($plink);
188 $ilCtrl->forwardCommand($gui);
194 $tpl->setContent(
$ret);
197 if (
$_GET[
"baseClass"] ==
"ilPublicUserProfileGUI")
228 if(!$user->getActive() ||
229 !$user->checkTimeLimit())
236 $ilCtrl->redirectByClass(
"ilobjportfoliogui",
"preview");
250 if ($user->getPref(
"public_profile") !=
"y" &&
251 ($user->getPref(
"public_profile") !=
"g" || !$ilSetting->get(
'enable_global_profiles')) &&
252 !$this->custom_prefs)
280 $tpl->setVariable(
"ROWCOL1",
"tblrow1");
281 $tpl->setVariable(
"ROWCOL2",
"tblrow2");
283 if(!$this->offline && $ilUser->getId() != ANONYMOUS_USER_ID)
285 $ref_url = str_replace(
"&",
"&", $this->
getBackUrl());
288 $ref_url = basename($_SERVER[
'REQUEST_URI']);
291 $tpl->setCurrentBlock(
"mail");
292 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
293 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
295 $tpl->parseCurrentBlock();
301 $first_name .= $user->getUTitle().
" ";
303 $first_name .= $user->getFirstName();
305 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
306 $tpl->setVariable(
"FIRSTNAME", $first_name);
307 $tpl->setVariable(
"LASTNAME", $user->getLastName());
312 $tpl->setCurrentBlock(
"vcard");
313 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
314 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
315 $ilCtrl->setParameter($this,
"user", $this->
getUserId());
316 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this,
"deliverVCard"));
322 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image").
"?dummy=".rand(1,999999);
323 $check_file = $check_dir.
"/usr_images/".$user->getPref(
"profile_image");
325 if (!@is_file($check_file))
327 $imagefile = $check_file =
331 if ($this->
getPublicPref($user,
"public_upload")==
"y" && $imagefile !=
"")
335 $tpl->setCurrentBlock(
"image");
336 $tpl->setVariable(
"TXT_IMAGE",$lng->txt(
"image"));
337 $tpl->setVariable(
"IMAGE_PATH", $imagefile);
338 $tpl->setVariable(
"IMAGE_ALT", $lng->txt(
"personal_picture"));
339 $tpl->parseCurrentBlock();
349 $val_arr = array (
"getStreet" =>
"street",
350 "getZipcode" =>
"zipcode",
352 "getCountry" =>
"country",
353 "getSelectedCountry" =>
"sel_country");
354 foreach ($val_arr as $key => $value)
359 $address_value = $user->$key();
362 if (trim($address_value) !=
"")
367 $address[0] = $address_value;
372 $address[1] .=
" ".$address_value;
376 $lng->loadLanguageModule(
"meta");
377 $address[2] = $lng->txt(
"meta_c_".$address_value);
381 $address[2] = $address_value;
389 $tpl->setCurrentBlock(
"address_line");
390 foreach($address as $line)
394 $tpl->setVariable(
"TXT_ADDRESS_LINE", trim($line));
395 $tpl->parseCurrentBlock();
398 $tpl->setCurrentBlock(
"address");
399 $tpl->setVariable(
"TXT_ADDRESS", $lng->txt(
"address"));
400 $tpl->parseCurrentBlock();
405 if ($this->
getPublicPref($user,
"public_institution") ==
"y" ||
408 $tpl->setCurrentBlock(
"inst_dep");
410 if ($this->
getPublicPref($user,
"public_institution") ==
"y")
412 $h = $lng->txt(
"institution");
413 $v = $user->getInstitution();
418 $h.= $sep.$lng->txt(
"department");
419 $v.= $sep.$user->getDepartment();
421 $tpl->setVariable(
"TXT_INST_DEP", $h);
422 $tpl->setVariable(
"INST_DEP", $v);
423 $tpl->parseCurrentBlock();
428 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
429 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email");
431 foreach ($val_arr as $key => $value)
436 $v.= $sep.$lng->txt($value).
": ".$user->$key();
440 if ($ilSetting->get(
"usr_settings_hide_instant_messengers") != 1)
442 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
444 foreach ($im_arr as $im_name)
446 if ($im_id = $user->getInstantMessengerId($im_name))
448 if ($this->
getPublicPref($user,
"public_im_".$im_name) !=
"n")
450 $v.= $sep.$lng->txt(
'im_'.$im_name).
": ".$im_id;
458 $tpl->parseCurrentBlock(
"contact");
459 $tpl->setVariable(
"TXT_CONTACT", $lng->txt(
"contact"));
460 $tpl->setVariable(
"CONTACT", $v);
461 $tpl->parseCurrentBlock();
466 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
468 foreach ($val_arr as $key => $value)
473 $tpl->setCurrentBlock(
"profile_data");
474 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
475 $tpl->setVariable(
"DATA", $user->$key());
476 $tpl->parseCurrentBlock();
484 $tpl->setCurrentBlock(
"delicious_row");
485 $tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
486 $tpl->setVariable(
"TXT_DEL_ICON", $lng->txt(
"delicious"));
488 $tpl->setVariable(
"DEL_ACCOUNT", $user->getDelicious());
489 $tpl->parseCurrentBlock();
493 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
496 $user->getLatitude() !=
"")
498 $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
500 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
503 $map_gui->setMapId(
"user_map");
504 $map_gui->setWidth(
"350px");
505 $map_gui->setHeight(
"230px");
506 $map_gui->setLatitude($user->getLatitude());
507 $map_gui->setLongitude($user->getLongitude());
508 $map_gui->setZoom($user->getLocationZoom());
509 $map_gui->setEnableNavigationControl(
true);
510 $map_gui->addUserMarker($user->getId());
512 $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
516 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
518 $user_defined_data = $user->getUserDefinedData();
519 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
522 if ($this->
getPublicPref($user,
"public_udf_".$definition[
"field_id"]) ==
"y")
524 if ($user_defined_data[
"f_".$definition[
"field_id"]] !=
"")
526 $tpl->setCurrentBlock(
"udf_data");
527 $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
528 $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_".$definition[
"field_id"]]);
529 $tpl->parseCurrentBlock();
540 $tpl->setCurrentBlock(
"profile_data");
541 $tpl->setVariable(
"TXT_DATA", $key);
542 $tpl->setVariable(
"DATA", $val);
543 $tpl->parseCurrentBlock();
550 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
555 return $tpl->get().$goto;
570 require_once
"./Services/User/classes/class.ilvCard.php";
574 if ($user->getPref(
"public_profile") !=
"y" &&
575 $user->getPref(
"public_profile") !=
"g" &&
576 $_GET[
"baseClass"] !=
"ilsharedresourceGUI")
581 $vcard->setName($user->getLastName(), $user->getFirstName(),
"", $user->getUTitle());
582 $vcard->setNickname($user->getLogin());
585 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image");
586 if ($user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
588 $fh = fopen($imagefile,
"r");
591 $image = fread($fh, filesize($imagefile));
593 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
595 if (preg_match(
"/^image/", $mimetype))
599 $vcard->setPhoto($image, $type);
603 $val_arr = array(
"getInstitution" =>
"institution",
"getDepartment" =>
"department",
604 "getStreet" =>
"street",
605 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country",
606 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
607 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
608 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
612 foreach ($val_arr as $key => $value)
615 if ($user->getPref(
"public_".$value) ==
"y")
620 $org[0] = $user->$key();
623 $org[1] = $user->$key();
626 $adr[2] = $user->$key();
629 $adr[5] = $user->$key();
632 $adr[3] = $user->$key();
635 $adr[6] = $user->$key();
650 $vcard->setEmail($user->$key());
653 $vcard->setNote($user->$key());
661 $vcard->setOrganization(join(
";", $org));
665 $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
668 ilUtil::deliverData(utf8_decode($vcard->buildVCard()), $vcard->getFilename(), $vcard->getMimetype());
685 if ($ilUser->getId() == ANONYMOUS_USER_ID && $user->getPref(
"public_profile") !=
"g")
688 if($user->getPref(
"public_profile") ==
"y")
701 $tpl->resetHeaderBlock();
703 include_once(
"./Services/User/classes/class.ilUserUtil.php");
713 $ilTabs->clearTargets();
714 $ilTabs->setBackTarget($lng->txt(
"back"),
726 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
730 include_once(
'./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
732 if($access_handler->checkAccess(
"read",
"", $portfolio_id))
734 return $portfolio_id;