function tNG_clearSessionVars() { if (!isset($_SESSION[md5(KT_getSiteRoot())])) { if (isset($_SESSION['kt_login_id'])) { unset($_SESSION['kt_login_id']); } if (isset($_SESSION['kt_login_user'])) { unset($_SESSION['kt_login_user']); } if (isset($_SESSION['kt_login_level'])) { unset($_SESSION['kt_login_level']); } } }
/** * Unset the $_SESSION[$siteroot][$var] and $_SESSION[$var] ; * @param string $var the name of the variable to be unseted; * @return nothing; */ function KT_unsetSessionVar($var) { $siteroot = md5(KT_getSiteRoot()); if (isset($_SESSION[$siteroot])) { if (isset($_SESSION[$siteroot][$var])) { unset($_SESSION[$siteroot][$var]); } if (count($_SESSION[$siteroot]) == 0) { unset($_SESSION[$siteroot]); } } }
/** * Get the Link for the Image Popup * @return string url for the popup page * @access public */ function getPopupLink() { $this->garbageCollector(); $ret = "#"; if ($this->popupWidth == '' || $this->popupHeight == '') { return $ret; } $fileName = $this->getFileName(); if ($fileName !== false) { $folder = $this->folder; $folder = KT_TransformToUrlPath($folder, true); if (!isset($_SESSION['tng_popup'])) { $_SESSION['tng_popup'] = array(); } if (!isset($_SESSION['tng_popup'][$this->id])) { $_SESSION['tng_popup'][$this->id] = array(); } if (!isset($_SESSION['tng_popup'][$this->id]['files'])) { $_SESSION['tng_popup'][$this->id]['files'] = array(); } $ret = $this->relpath . 'includes/tng/pub/popup_image.php?id=' . rawurlencode($this->id) . '&n=' . count($_SESSION['tng_popup'][$this->id]['files']); $siteRootFilename = $folder . $fileName; //$siteRootFilename = substr($siteRootFilename, strlen($this->relpath)); $siteRootFilename = substr($this->currentfolder, strlen(KT_getSiteRoot() . '/')) . $siteRootFilename; if (!$this->isSetted) { $arrP = array(); if ($this->watermarkImage != '') { $arrP['watermark'] = KT_realpath($this->watermarkImage, false); $arrP['watermarkAlpha'] = $this->watermarkAlpha; $arrP['watermarkAlignment'] = $this->watermarkAlignment; $arrP['watermarkResize'] = $this->watermarkResize; } if ($this->popupWidth != '' && $this->popupHeight != '') { $arrP['popupwidth'] = $this->popupWidth; $arrP['popupheight'] = $this->popupHeight; $arrP['fitToWindow'] = $this->fitToWindow; } $arrP['popupNavigation'] = $this->popupNavigation; $arrP['popupWatermark'] = $this->popupWatermark; $arrP['time'] = time(); $_SESSION['tng_popup'][$this->id]['properties'] = $arrP; $this->isSetted = true; } $_SESSION['tng_popup'][$this->id]['files'][] = array('fullfilename' => $siteRootFilename, 'filename' => $fileName); } return $ret; }