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
"Services/Portfolio/classes/class.ilObjPortfolioGUI.php";
186 $gui->initPortfolioObject($portfolio_id);
188 $gui->setPermaLink($plink);
189 $ilCtrl->forwardCommand($gui);
195 $tpl->setContent(
$ret);
198 if (
$_GET[
"baseClass"] ==
"ilPublicUserProfileGUI")
228 $ilCtrl->redirectByClass(
"ilobjportfoliogui",
"preview");
237 if ($user->getPref(
"public_profile") !=
"y" &&
238 ($user->getPref(
"public_profile") !=
"g" || !$ilSetting->get(
'enable_global_profiles')) &&
239 !$this->custom_prefs)
267 $tpl->setVariable(
"ROWCOL1",
"tblrow1");
268 $tpl->setVariable(
"ROWCOL2",
"tblrow2");
270 if(!$this->offline && $ilUser->getId() != ANONYMOUS_USER_ID)
272 $ref_url = str_replace(
"&",
"&", $this->
getBackUrl());
275 $ref_url = basename($_SERVER[
'REQUEST_URI']);
278 $tpl->setCurrentBlock(
"mail");
279 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
280 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
282 $tpl->parseCurrentBlock();
288 $first_name .= $user->getUTitle().
" ";
290 $first_name .= $user->getFirstName();
292 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
293 $tpl->setVariable(
"FIRSTNAME", $first_name);
294 $tpl->setVariable(
"LASTNAME", $user->getLastName());
299 $tpl->setCurrentBlock(
"vcard");
300 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
301 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
302 $ilCtrl->setParameter($this,
"user", $this->
getUserId());
303 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this,
"deliverVCard"));
309 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image").
"?dummy=".rand(1,999999);
310 $check_file = $check_dir.
"/usr_images/".$user->getPref(
"profile_image");
312 if (!@is_file($check_file))
314 $imagefile = $check_file =
318 if ($this->
getPublicPref($user,
"public_upload")==
"y" && $imagefile !=
"")
322 $tpl->setCurrentBlock(
"image");
323 $tpl->setVariable(
"TXT_IMAGE",$lng->txt(
"image"));
324 $tpl->setVariable(
"IMAGE_PATH", $imagefile);
325 $tpl->setVariable(
"IMAGE_ALT", $lng->txt(
"personal_picture"));
326 $tpl->parseCurrentBlock();
336 $val_arr = array (
"getStreet" =>
"street",
337 "getZipcode" =>
"zipcode",
339 "getCountry" =>
"country",
340 "getSelectedCountry" =>
"sel_country");
341 foreach ($val_arr as $key => $value)
346 $address_value = $user->$key();
349 if (trim($address_value) !=
"")
354 $address[0] = $address_value;
359 $address[1] .=
" ".$address_value;
363 $lng->loadLanguageModule(
"meta");
364 $address[2] = $lng->txt(
"meta_c_".$address_value);
368 $address[2] = $address_value;
376 $tpl->setCurrentBlock(
"address_line");
377 foreach($address as $line)
381 $tpl->setVariable(
"TXT_ADDRESS_LINE", trim($line));
382 $tpl->parseCurrentBlock();
385 $tpl->setCurrentBlock(
"address");
386 $tpl->setVariable(
"TXT_ADDRESS", $lng->txt(
"address"));
387 $tpl->parseCurrentBlock();
392 if ($this->
getPublicPref($user,
"public_institution") ==
"y" ||
395 $tpl->setCurrentBlock(
"inst_dep");
397 if ($this->
getPublicPref($user,
"public_institution") ==
"y")
399 $h = $lng->txt(
"institution");
400 $v = $user->getInstitution();
405 $h.= $sep.$lng->txt(
"department");
406 $v.= $sep.$user->getDepartment();
408 $tpl->setVariable(
"TXT_INST_DEP", $h);
409 $tpl->setVariable(
"INST_DEP", $v);
410 $tpl->parseCurrentBlock();
415 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
416 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email");
418 foreach ($val_arr as $key => $value)
423 $v.= $sep.$lng->txt($value).
": ".$user->$key();
427 if ($ilSetting->get(
"usr_settings_hide_instant_messengers") != 1)
429 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
431 foreach ($im_arr as $im_name)
433 if ($im_id = $user->getInstantMessengerId($im_name))
435 if ($this->
getPublicPref($user,
"public_im_".$im_name) !=
"n")
437 $v.= $sep.$lng->txt(
'im_'.$im_name).
": ".$im_id;
445 $tpl->parseCurrentBlock(
"contact");
446 $tpl->setVariable(
"TXT_CONTACT", $lng->txt(
"contact"));
447 $tpl->setVariable(
"CONTACT", $v);
448 $tpl->parseCurrentBlock();
453 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
455 foreach ($val_arr as $key => $value)
460 $tpl->setCurrentBlock(
"profile_data");
461 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
462 $tpl->setVariable(
"DATA", $user->$key());
463 $tpl->parseCurrentBlock();
471 $tpl->setCurrentBlock(
"delicious_row");
472 $tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
473 $tpl->setVariable(
"TXT_DEL_ICON", $lng->txt(
"delicious"));
475 $tpl->setVariable(
"DEL_ACCOUNT", $user->getDelicious());
476 $tpl->parseCurrentBlock();
480 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
483 $user->getLatitude() !=
"")
485 $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
487 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
490 $map_gui->setMapId(
"user_map");
491 $map_gui->setWidth(
"350px");
492 $map_gui->setHeight(
"230px");
493 $map_gui->setLatitude($user->getLatitude());
494 $map_gui->setLongitude($user->getLongitude());
495 $map_gui->setZoom($user->getLocationZoom());
496 $map_gui->setEnableNavigationControl(
true);
497 $map_gui->addUserMarker($user->getId());
499 $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
503 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
505 $user_defined_data = $user->getUserDefinedData();
506 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
509 if ($this->
getPublicPref($user,
"public_udf_".$definition[
"field_id"]) ==
"y")
511 if ($user_defined_data[
"f_".$definition[
"field_id"]] !=
"")
513 $tpl->setCurrentBlock(
"udf_data");
514 $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
515 $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_".$definition[
"field_id"]]);
516 $tpl->parseCurrentBlock();
527 $tpl->setCurrentBlock(
"profile_data");
528 $tpl->setVariable(
"TXT_DATA", $key);
529 $tpl->setVariable(
"DATA", $val);
530 $tpl->parseCurrentBlock();
537 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
542 return $tpl->get().$goto;
557 require_once
"./Services/User/classes/class.ilvCard.php";
561 if ($user->getPref(
"public_profile") !=
"y" &&
562 $user->getPref(
"public_profile") !=
"g" &&
563 $_GET[
"baseClass"] !=
"ilsharedresourceGUI")
568 $vcard->setName($user->getLastName(), $user->getFirstName(),
"", $user->getUTitle());
569 $vcard->setNickname($user->getLogin());
572 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image");
573 if ($user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
575 $fh = fopen($imagefile,
"r");
578 $image = fread($fh, filesize($imagefile));
580 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
582 if (preg_match(
"/^image/", $mimetype))
586 $vcard->setPhoto($image, $type);
590 $val_arr = array(
"getInstitution" =>
"institution",
"getDepartment" =>
"department",
591 "getStreet" =>
"street",
592 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country",
593 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
594 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
595 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
599 foreach ($val_arr as $key => $value)
602 if ($user->getPref(
"public_".$value) ==
"y")
607 $org[0] = $user->$key();
610 $org[1] = $user->$key();
613 $adr[2] = $user->$key();
616 $adr[5] = $user->$key();
619 $adr[3] = $user->$key();
622 $adr[6] = $user->$key();
637 $vcard->setEmail($user->$key());
640 $vcard->setNote($user->$key());
648 $vcard->setOrganization(join(
";", $org));
652 $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
655 ilUtil::deliverData(utf8_decode($vcard->buildVCard()), $vcard->getFilename(), $vcard->getMimetype());
672 if ($ilUser->getId() == ANONYMOUS_USER_ID && $user->getPref(
"public_profile") !=
"g")
675 if($user->getPref(
"public_profile") ==
"y")
688 $tpl->resetHeaderBlock();
690 include_once(
"./Services/User/classes/class.ilUserUtil.php");
700 $ilTabs->clearTargets();
701 $ilTabs->setBackTarget($lng->txt(
"back"),
713 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
717 include_once(
'./Services/Portfolio/classes/class.ilPortfolioAccessHandler.php');
719 if($access_handler->checkAccess(
"read",
"", $portfolio_id))
721 return $portfolio_id;