/** * Return HTML code for avatar image (with full path) * @param string $sSize type of avatar: large, medium, tiny * @param bool $boolNoCache if true, then add a timestamp to url, making * browser not to use cached version and to get a fresh new one * * @return string the HTML code for image src which actually * includes 2 images - an avatar and a tiny facebook icon. */ public function getAvatarImgSrc($sSize = 'medium', $boolNoCache = false) { $strAvatar = parent::getAvatarImgSrc($sSize, $boolNoCache); $strAvatar .= '<img width="16" height="16" class="icontw" alt="Twitter User" src="/images/tw-user.png" />'; return $strAvatar; }
/** * Return HTML code for avatar image (with full path) * @param string $sSize type of avatar: large, medium, tiny * @param bool $boolNoCache if true, then add a timestamp to url, making * browser not to use cached version and to get a fresh new one * * @return string the HTML code for image src which actually * includes 2 images - an avatar and a tiny facebook icon. */ public function getAvatarImgSrc($sSize = 'medium', $boolNoCache = false) { $strAvatar = parent::getAvatarImgSrc($sSize, $boolNoCache); $strAvatar .= '<img width="14" height="14" class="iconfb" alt="Facebook Connect User" src="{_IMAGE_SITE_}{_DIR_}/images/fb-user.gif">'; return $strAvatar; }
/** * Helper method to create a CAS based user * @param string $sEmail * @param array $aGroups * @return bool true on success, false otherwise */ protected static function CreateCASUser($sEmail, $aGroups) { if (!MetaModel::IsValidClass('URP_Profiles')) { phpCAS::log("URP_Profiles is not a valid class. Automatic creation of Users is not supported in this context, sorry."); return false; } $oUser = MetaModel::GetObjectByName('UserExternal', $sEmail, false); if ($oUser == null) { // Create the user, link it to a contact phpCAS::log("Info: the user '{$sEmail}' does not exist. A new UserExternal will be created."); $oSearch = new DBObjectSearch('Person'); $oSearch->AddCondition('email', $sEmail); $oSet = new DBObjectSet($oSearch); $iContactId = 0; switch ($oSet->Count()) { case 0: phpCAS::log("Error: found no contact with the email: '{$sEmail}'. Cannot create the user in iTop."); return false; case 1: $oContact = $oSet->Fetch(); $iContactId = $oContact->GetKey(); phpCAS::log("Info: Found 1 contact '" . $oContact->GetName() . "' (id={$iContactId}) corresponding to the email '{$sEmail}'."); break; default: phpCAS::log("Error: " . $oSet->Count() . " contacts have the same email: '{$sEmail}'. Cannot create a user for this email."); return false; } $oUser = new UserExternal(); $oUser->Set('login', $sEmail); $oUser->Set('contactid', $iContactId); $oUser->Set('language', MetaModel::GetConfig()->GetDefaultLanguage()); } else { phpCAS::log("Info: the user '{$sEmail}' already exists (id=" . $oUser->GetKey() . ")."); } // Now synchronize the profiles if (!self::SetProfilesFromCAS($oUser, $aGroups)) { return false; } else { if ($oUser->IsNew() || $oUser->IsModified()) { $oMyChange = MetaModel::NewObject("CMDBChange"); $oMyChange->Set("date", time()); $oMyChange->Set("userinfo", 'CAS/LDAP Synchro'); $oMyChange->DBInsert(); if ($oUser->IsNew()) { $oUser->DBInsertTracked($oMyChange); } else { $oUser->DBUpdateTracked($oMyChange); } } return true; } }
} } else { if (!isnull(getCookieValue("userid"))) { define("CALLER_BROWSER_ID", getId(USER_ID_LENGTH)); define("CALLER_USER_ID", getCookieValue("userid")); } } if (!defined("CALLER_USER_ID")) { define("CALLER_USER_ID", getId(USER_ID_LENGTH)); define("CALLER_BROWSER_ID", getId(USER_ID_LENGTH)); define("CALLER_FILE_ID", CALLER_BROWSER_ID . "." . EX_BROWSER_SESSION); if (isnull(getCookieValue("userid")) || !isnull(getCookieValue("userid")) && getCookieValue("userid") != CALLER_USER_ID) { setCookieValue("userid", CALLER_USER_ID); } } $externalUser = new UserExternal(CALLER_USER_ID); $externalUser->LoadStaticInformation(); if (isset($_GET[GET_TRACK_OUTPUT_TYPE]) && ($_GET[GET_TRACK_OUTPUT_TYPE] == "jscript" || $_GET[GET_TRACK_OUTPUT_TYPE] == "jcrpt")) { if (!isset($_GET[GET_TRACK_NO_SEARCH_ENGINE])) { header("Location: http://www.livezilla.net"); exit(getFile(TEMPLATE_HTML_SUPPORT)); } $TRACKINGSCRIPT = getFile(TEMPLATE_SCRIPT_GLOBAL) . getFile(TEMPLATE_SCRIPT_TRACK) . getFile(TEMPLATE_SCRIPT_BOX); $TRACKINGSCRIPT = str_replace("<!--server-->", LIVEZILLA_URL, $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--area_code-->", !isnull(getParam(GET_TRACK_SPECIAL_AREA_CODE)) ? $_GET[GET_TRACK_SPECIAL_AREA_CODE] : "", $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--browser_id-->", CALLER_BROWSER_ID, $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--user_id-->", CALLER_USER_ID, $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--connection_error_span-->", CONNECTION_ERROR_SPAN, $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--poll_frequency-->", $CONFIG["poll_frequency_tracking"], $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--timeout-->", $CONFIG["timeout_track"], $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--height-->", $CONFIG["wcl_window_height"], $TRACKINGSCRIPT);
/** * Return HTML code for avatar image (with full path) * @param string $sSize type of avatar: large, medium, tiny * @param bool $boolNoCache if true, then add a timestamp to url, making * browser not to use cached version and to get a fresh new one * * @return string the HTML code for image src which actually * includes 2 images - an avatar and a tiny LinkedIn icon. */ public function getAvatarImgSrc($sSize = 'medium', $boolNoCache = false) { $strAvatar = parent::getAvatarImgSrc($sSize, $boolNoCache); $strAvatar .= '<img width="14" height="14" class="iconfb" alt="LinkedIn User" src="{_IMAGE_SITE_}{_DIR_}/images/linkedin_16.png">'; return $strAvatar; }
if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.1.1") { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); if (isset($_GET[GET_EXTERN_USER_HEADER]) && !isnull($_GET[GET_EXTERN_USER_HEADER])) { $html = str_replace("<!--logo-->", "<img src=\"" . base64UrlDecode($_GET[GET_EXTERN_USER_HEADER]) . "\" alt=\"\" border=\"0\"><br>", $html); } else { $html = str_replace("<!--logo-->", file_exists(FILE_CARRIERLOGO) ? "<img src=\"" . FILE_CARRIERLOGO . "\" alt=\"\" border=\"0\"><br>" : "", $html); } } else { if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.0.0") { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = str_replace("<!--FU_HIDDEN-->", !$CONFIG["gl_ex_fu"] ? " style=\"display:none;\"" : "", $html); } else { if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.1.0") { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); if (isset($_POST[POST_EXTERN_USER_USERID])) { $externalUser = new UserExternal($_POST[POST_EXTERN_USER_USERID]); $externalChat = new ExternalChat($externalUser->UserId, $_POST[POST_EXTERN_USER_BROWSERID]); $externalChat->Load(); if (isset($_FILES["userfile"]) && $externalUser->StoreFile($_POST[POST_EXTERN_USER_BROWSERID], $externalChat->DesiredChatPartner, $externalChat->Fullname)) { $html = str_replace("<!--response-->", "top.lz_chat_file_ready();", $html); } else { if (isset($_FILES['userfile'])) { $html = str_replace("<!--response-->", "top.lz_chat_file_error(2);", $html); } else { $html = str_replace("<!--response-->", "", $html); } } } else { if (isset($_GET["file"])) { $html = str_replace("<!--response-->", "top.lz_chat_file_error(2);", $html); } else {