$database->setQuery("DELETE FROM #__session WHERE session_id='" . $_SESSION['session_id'] . "'"); if (!$database->query()) { echo $database->stderr(); } } $name = ""; $fullname = ""; $id = ""; $session_id = ""; session_unregister("session_id"); session_unregister("session_user_id"); session_unregister("session_username"); session_unregister("session_usertype"); session_unregister("session_logintime"); if (session_is_registered("session_id")) { session_destroy(); } if (session_is_registered("session_user_id")) { session_destroy(); } if (session_is_registered("session_username")) { session_destroy(); } if (session_is_registered("session_usertype")) { session_destroy(); } if (session_is_registered("session_logintime")) { session_destroy(); } $configuration =& mamboCore::getMamboCore(); $configuration->redirect("../index.php");
function mosInputFilter() { static $filter; if (!isset($filter)) { $filter = new InputFilter(); foreach (get_object_vars($filter) as $key => $value) { $this->{$key} = $value; } $filter = null; } $configuration =& mamboCore::getMamboCore(); $this->charset = $configuration->current_language->charset; // could handle this easier? }
/** * Load Mambo generated head tags into an array */ function loadHeadTags() { static $obj; if (!is_object($obj)) { $obj =& mosHtmlHelper::getInstance(); } $mainframe =& mosMainFrame::getInstance(); $obj->_headTags = array(); $mainframe->appendMetaTag('description', mamboCore::get('mosConfig_MetaDesc'), true); $mainframe->appendMetaTag('keywords', mamboCore::get('mosConfig_MetaKeys'), true); $title = $mainframe->_head['title']; $obj->_headTags['title'] = $obj->tag('title', $title); $obj->_headTags['meta'] = array(); foreach ($mainframe->_head['meta'] as $name => $meta) { if ($meta[1]) { $obj->_headTags['meta'][] = $meta[1]; } $obj->_headTags['meta'][$name] = $obj->tag('meta', array($name, $meta[0])); if ($meta[2]) { $obj->_headTags['meta'][] = $meta[2]; } } $my =& mamboCore::get('currentUser'); $obj->_headTags['mambojavascript'] = $my->id ? $obj->tag('javascript', ' src="' . mamboCore::get('mosConfig_live_site') . "/includes/js/mambojavascript.js\"") : ''; $obj->_headTags['custom'] = array(); foreach ($mainframe->_head['custom'] as $html) { if (trim($html) !== '') { $obj->_headTags['custom'][] = $html; } } ob_start(); $mainframe->liveBookMark(); $obj->_headTags['livebookmark'] = trim(ob_get_contents()); ob_end_clean(); $configuration =& mamboCore::getMamboCore(); $obj->_headTags['favicon'] = $obj->tag('metalinkrel', array("shortcut icon", $configuration->getFavIcon())); }
function mosIsRTL() { $core = mamboCore::getMamboCore(); if ($core->current_language->text_direction == "rtl") { return true; } else { return false; } }
/** * Render head tags * tags are assembled into an associative array with the following elements: * - title * - meta * - mambojavascript * - custom (custom head tags) * - livebookmark * - favicon * @param unknown keys - array elements to output (null = output all) * @param unknown exclude - array elements to exclude in output * * Usage: mosShowHead() - to render all tags * mosShowHead('title') - to render a single tag * mosShowHead(array('title', 'meta')) - to selectively render tags (in order) * mosShowHead(null, 'custom') - to exclude a single tag * mosShowHead(null, array('custom','favicon')) - to exclude multiple tags */ function mosShowHead($keys = '', $exclude = '') { if (!is_array($keys)) { if ($keys !== '' && !is_null($keys)) { $keys = array($keys); } else { $keys = array(); } } if (!is_array($exclude)) { if ($exclude !== '') { $exclude = array($exclude); } else { $exclude = array(); } } $this->_head['output'] = array(); $head = array(); $head['title'] = '<title>' . $this->_head['title'] . '</title>'; $this->appendMetaTag('description', mamboCore::get('mosConfig_MetaDesc'), true); $this->appendMetaTag('keywords', mamboCore::get('mosConfig_MetaKeys'), true); $head['meta'] = array(); foreach ($this->_head['meta'] as $name => $meta) { if ($meta[1]) { $head['meta'][] = $meta[1]; } $head['meta'][] = '<meta name="' . $name . '" content="' . $meta[0] . '" />'; if ($meta[2]) { $head['meta'][] = $meta[2]; } } $head['meta'] = implode("\n", $head['meta']); $my = mamboCore::get('currentUser'); $head['mambojavascript'] = $my->id ? '<script type="text/javascript" src="' . mamboCore::get('mosConfig_live_site') . '/includes/js/mambojavascript.js"></script>' : ''; $head['custom'] = array(); foreach ($this->_head['custom'] as $html) { if (trim($html) !== '') { $head['custom'][] = $html; } } if (count($head['custom']) !== 0) { $head['custom'] = implode("\n", $head['custom']); } else { $head['custom'] = ''; } ob_start(); $this->liveBookMark(); $head['livebookmark'] = ob_get_contents(); ob_end_clean(); $configuration =& mamboCore::getMamboCore(); $head['favicon'] = "<link rel=\"shortcut icon\" href=\"" . $configuration->getFavIcon() . "\" />"; foreach ($head as $key => $value) { $this->_head['output'][$key] = "{$value}"; } $tags = $this->_head['output']; if (count($keys) == 0) { foreach ($tags as $key => $value) { if (!in_array($key, $exclude)) { if ($value !== '') { echo trim($value) . "\n"; } } } } else { foreach ($keys as $key) { if (isset($tags[$key])) { if (trim($tags[$key]) !== '') { echo trim($tags[$key]) . "\n"; } } } } }