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 $tpl->setCurrentBlock(
"mail");
273 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
274 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
275 $tpl->setVariable(
'HREF_MAIL',
ilMailFormCall::_getLinkTarget(basename($_SERVER[
'REQUEST_URI']),
'', array(), array(
'type' =>
'new',
'rcp_to' => urlencode($user->getLogin()))));
276 $tpl->parseCurrentBlock();
282 $first_name .= $user->getUTitle().
" ";
284 $first_name .= $user->getFirstName();
286 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
287 $tpl->setVariable(
"FIRSTNAME", $first_name);
288 $tpl->setVariable(
"LASTNAME", $user->getLastName());
293 $tpl->setCurrentBlock(
"vcard");
294 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
295 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
296 $ilCtrl->setParameter($this,
"user", $this->
getUserId());
297 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this,
"deliverVCard"));
316 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image").
"?dummy=".rand(1,999999);
317 $check_file = $check_dir.
"/usr_images/".$user->getPref(
"profile_image");
319 if (!@is_file($check_file))
321 $imagefile = $check_file =
325 if ($this->
getPublicPref($user,
"public_upload")==
"y" && $imagefile !=
"")
329 $tpl->setCurrentBlock(
"image");
330 $tpl->setVariable(
"TXT_IMAGE",$lng->txt(
"image"));
331 $tpl->setVariable(
"IMAGE_PATH", $imagefile);
332 $tpl->setVariable(
"IMAGE_ALT", $lng->txt(
"personal_picture"));
333 $tpl->parseCurrentBlock();
342 $tpl->setCurrentBlock(
"address");
343 $tpl->setVariable(
"TXT_ADDRESS", $lng->txt(
"address"));
344 $val_arr = array (
"getStreet" =>
"street",
345 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country",
"getSelectedCountry" =>
"sel_country");
346 foreach ($val_arr as $key => $value)
351 if ($user->$key() !=
"")
353 if ($value ==
"sel_country")
355 $lng->loadLanguageModule(
"meta");
356 $tpl->setVariable(
"COUNTRY",
357 $lng->txt(
"meta_c_".$user->$key()));
361 $tpl->setVariable(strtoupper($value), $user->$key());
366 $tpl->parseCurrentBlock();
370 if ($this->
getPublicPref($user,
"public_institution") ==
"y" ||
373 $tpl->setCurrentBlock(
"inst_dep");
375 if ($this->
getPublicPref($user,
"public_institution") ==
"y")
377 $h = $lng->txt(
"institution");
378 $v = $user->getInstitution();
383 $h.= $sep.$lng->txt(
"department");
384 $v.= $sep.$user->getDepartment();
386 $tpl->setVariable(
"TXT_INST_DEP", $h);
387 $tpl->setVariable(
"INST_DEP", $v);
388 $tpl->parseCurrentBlock();
393 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
394 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email");
396 foreach ($val_arr as $key => $value)
401 $v.= $sep.$lng->txt($value).
": ".$user->$key();
405 if ($ilSetting->get(
"usr_settings_hide_instant_messengers") != 1)
407 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
409 foreach ($im_arr as $im_name)
411 if ($im_id = $user->getInstantMessengerId($im_name))
413 if ($this->
getPublicPref($user,
"public_im_".$im_name) !=
"n")
415 $v.= $sep.$lng->txt(
'im_'.$im_name).
": ".$im_id;
423 $tpl->parseCurrentBlock(
"contact");
424 $tpl->setVariable(
"TXT_CONTACT", $lng->txt(
"contact"));
425 $tpl->setVariable(
"CONTACT", $v);
426 $tpl->parseCurrentBlock();
431 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
433 foreach ($val_arr as $key => $value)
438 $tpl->setCurrentBlock(
"profile_data");
439 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
440 $tpl->setVariable(
"DATA", $user->$key());
441 $tpl->parseCurrentBlock();
449 $tpl->setCurrentBlock(
"delicious_row");
450 $tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
451 $tpl->setVariable(
"TXT_DEL_ICON", $lng->txt(
"delicious"));
453 $tpl->setVariable(
"DEL_ACCOUNT", $user->getDelicious());
454 $tpl->parseCurrentBlock();
458 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
461 $user->getLatitude() !=
"")
463 $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
465 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
468 $map_gui->setMapId(
"user_map");
469 $map_gui->setWidth(
"350px");
470 $map_gui->setHeight(
"230px");
471 $map_gui->setLatitude($user->getLatitude());
472 $map_gui->setLongitude($user->getLongitude());
473 $map_gui->setZoom($user->getLocationZoom());
474 $map_gui->setEnableNavigationControl(
true);
475 $map_gui->addUserMarker($user->getId());
477 $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
481 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
483 $user_defined_data = $user->getUserDefinedData();
484 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
487 if ($this->
getPublicPref($user,
"public_udf_".$definition[
"field_id"]) ==
"y")
489 if ($user_defined_data[
"f_".$definition[
"field_id"]] !=
"")
491 $tpl->setCurrentBlock(
"udf_data");
492 $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
493 $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_".$definition[
"field_id"]]);
494 $tpl->parseCurrentBlock();
505 $tpl->setCurrentBlock(
"profile_data");
506 $tpl->setVariable(
"TXT_DATA", $key);
507 $tpl->setVariable(
"DATA", $val);
508 $tpl->parseCurrentBlock();
527 require_once
"./Services/User/classes/class.ilvCard.php";
531 if ($user->getPref(
"public_profile") !=
"y" &&
532 $user->getPref(
"public_profile") !=
"g" &&
533 $_GET[
"baseClass"] !=
"ilsharedresourceGUI")
538 $vcard->setName($user->getLastName(), $user->getFirstName(),
"", $user->getUTitle());
539 $vcard->setNickname($user->getLogin());
542 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image");
543 if ($user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
545 $fh = fopen($imagefile,
"r");
548 $image = fread($fh, filesize($imagefile));
550 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
552 if (preg_match(
"/^image/", $mimetype))
556 $vcard->setPhoto($image, $type);
560 $val_arr = array(
"getInstitution" =>
"institution",
"getDepartment" =>
"department",
561 "getStreet" =>
"street",
562 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country",
563 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
564 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
565 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
569 foreach ($val_arr as $key => $value)
572 if ($user->getPref(
"public_".$value) ==
"y")
577 $org[0] = $user->$key();
580 $org[1] = $user->$key();
583 $adr[2] = $user->$key();
586 $adr[5] = $user->$key();
589 $adr[3] = $user->$key();
592 $adr[6] = $user->$key();
607 $vcard->setEmail($user->$key());
610 $vcard->setNote($user->$key());
618 $vcard->setOrganization(join(
";", $org));
622 $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
625 ilUtil::deliverData(utf8_decode($vcard->buildVCard()), $vcard->getFilename(), $vcard->getMimetype());
642 if ($ilUser->getId() == ANONYMOUS_USER_ID && $user->getPref(
"public_profile") !=
"g")
653 $tpl->resetHeaderBlock();
655 include_once(
"./Services/User/classes/class.ilUserUtil.php");
665 $ilTabs->clearTargets();
666 $ilTabs->setBackTarget($lng->txt(
"back"),
678 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
682 include_once(
'./Services/Portfolio/classes/class.ilPortfolioAccessHandler.php');
684 if($access_handler->checkAccess(
"read",
"", $portfolio_id))
686 return $portfolio_id;