| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @package Mambo |
* @package Mambo |
|
* @copyright Refer to copyright.php |
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
|
| 4 |
* @author Mambo Foundation Inc see README.php |
* @author Mambo Foundation Inc see README.php |
| 5 |
|
* @copyright Mambo Foundation Inc. |
| 6 |
|
* See COPYRIGHT.php for copyright notices and details. |
| 7 |
|
* @license GNU/GPL Version 2, see LICENSE.php |
| 8 |
|
* Mambo is free software; you can redistribute it and/or |
| 9 |
|
* modify it under the terms of the GNU General Public License |
| 10 |
|
* as published by the Free Software Foundation; version 2 of the License. |
| 11 |
*/ |
*/ |
| 12 |
|
|
| 13 |
/** |
/** |
| 229 |
//$this->rootPath = str_replace('\\', '/', realpath(str_replace('includes', '', dirname(__FILE__)))); |
//$this->rootPath = str_replace('\\', '/', realpath(str_replace('includes', '', dirname(__FILE__)))); |
| 230 |
$this->rootPath = str_replace('\\', '/',str_replace('includes', '', dirname(__FILE__))); |
$this->rootPath = str_replace('\\', '/',str_replace('includes', '', dirname(__FILE__))); |
| 231 |
$this->checkConfig(); |
$this->checkConfig(); |
| 232 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = (int)mosGetParam($_REQUEST, 'Itemid', 0); |
| 233 |
$this->getConfig(); |
$this->getConfig(); |
| 234 |
$this->fixLanguage(); |
$this->fixLanguage(); |
| 235 |
@set_magic_quotes_runtime( 0 ); |
@set_magic_quotes_runtime( 0 ); |
| 325 |
if ($f) { |
if ($f) { |
| 326 |
while ($f AND !feof($f)) { |
while ($f AND !feof($f)) { |
| 327 |
$line = fgets($f); |
$line = fgets($f); |
| 328 |
$altered = str_replace('$', '$this->', $line); |
$altered = preg_replace('/^\$/', '$this->', $line); |
| 329 |
if ($altered != $line) $code .= $altered; |
if ($altered != $line) $code .= $altered; |
| 330 |
} |
} |
| 331 |
} |
} |
| 399 |
global $adminside; |
global $adminside; |
| 400 |
if (($this->mosConfig_offline && !$adminside) OR file_exists($this->rootPath.'/installation/index.php')) { |
if (($this->mosConfig_offline && !$adminside) OR file_exists($this->rootPath.'/installation/index.php')) { |
| 401 |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
|
session_name(md5($this->mosConfig_live_site)); |
|
| 402 |
session_start(); |
session_start(); |
| 403 |
$session =& mosSession::getCurrent(); |
$session =& mosSession::getCurrent(); |
| 404 |
|
if (!isset($_SESSION['initiated'])) { |
| 405 |
|
session_regenerate_id(true); |
| 406 |
|
$_SESSION['initiated'] = true; |
| 407 |
|
} |
| 408 |
$my =& new mosUser(); |
$my =& new mosUser(); |
| 409 |
$my->getSessionData(); |
$my->getSessionData(); |
| 410 |
if (mosSession::validate($my)) return; |
if (mosSession::validate($my)) return; |
| 422 |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
| 423 |
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
| 424 |
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
| 425 |
$this->mosConfig_locale = mosGetParam($_POST, 'lang', $this->mosConfig_locale); |
if (!mosGetParam($_REQUEST, 'lang')); |
| 426 |
|
else $this->mosConfig_locale = mosGetParam($_REQUEST, 'lang', $this->mosConfig_locale); |
| 427 |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
| 428 |
$languages = $language->getLanguages(); |
$languages = $language->getLanguages(); |
| 429 |
$charset = $language->get('charset'); |
$charset = $language->get('charset'); |
| 431 |
$this->mosConfig_lang = $language->get('lang'); |
$this->mosConfig_lang = $language->get('lang'); |
| 432 |
$this->current_language = $language; |
$this->current_language = $language; |
| 433 |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$charset); |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$charset); |
| 434 |
|
header('Content-type: text/html; '._ISO); |
| 435 |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $dateformat); //Uses PHP's strftime Command Format |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $dateformat); //Uses PHP's strftime Command Format |
| 436 |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $dateformat); |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $dateformat); |
| 437 |
|
|
| 483 |
* @return unknown |
* @return unknown |
| 484 |
*/ |
*/ |
| 485 |
function determineOptionAndItemid () { |
function determineOptionAndItemid () { |
| 486 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = (int)mosGetParam($_REQUEST, 'Itemid', 0); |
| 487 |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
| 488 |
else { |
else { |
| 489 |
$menuhandler =& mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 490 |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
| 491 |
|
if (count($menus)) { |
| 492 |
$this->Itemid = $menus[0]->id; |
$this->Itemid = $menus[0]->id; |
| 493 |
$_REQUEST['Itemid'] = $this->Itemid; |
$_REQUEST['Itemid'] = $this->Itemid; |
| 494 |
$link = $menus[0]->link; |
$link = $menus[0]->link; |
| 500 |
if (isset($temp['option'])) $option = $temp['option']; |
if (isset($temp['option'])) $option = $temp['option']; |
| 501 |
else return ''; |
else return ''; |
| 502 |
} |
} |
| 503 |
|
} |
| 504 |
/** patch to lessen the impact on templates */ |
/** patch to lessen the impact on templates */ |
| 505 |
if ($option == 'search') $option = 'com_search'; |
if ($option == 'search') $option = 'com_search'; |
| 506 |
// checking if we can find the Itemid thru the component |
// checking if we can find the Itemid thru the component |
| 508 |
if ( $option == 'com_content') { |
if ( $option == 'com_content') { |
| 509 |
require_once($this->rootPath().'/components/com_content/content.class.php'); |
require_once($this->rootPath().'/components/com_content/content.class.php'); |
| 510 |
$handler =& contentHandler::getInstance(); |
$handler =& contentHandler::getInstance(); |
| 511 |
$this->Itemid = $handler->getItemid(mosGetParam($_REQUEST, 'id', 0 )); |
$this->Itemid = (int)$handler->getItemid(mosGetParam($_REQUEST, 'id', 0 )); |
| 512 |
$_REQUEST['Itemid'] = $this->Itemid; |
$_REQUEST['Itemid'] = $this->Itemid; |
| 513 |
} |
} |
| 514 |
else { |
else { |
| 520 |
} |
} |
| 521 |
} |
} |
| 522 |
} |
} |
| 523 |
return $option; |
return trim(htmlspecialchars($option)); |
| 524 |
} |
} |
| 525 |
|
|
| 526 |
/** |
/** |
| 835 |
if (file_exists( "$rootpath/$imgPath" )) $img = "<img src='$config->mosConfig_live_site/images/M_images/arrow.png' alt='arrow' />"; |
if (file_exists( "$rootpath/$imgPath" )) $img = "<img src='$config->mosConfig_live_site/images/M_images/arrow.png' alt='arrow' />"; |
| 836 |
else $img = '>'; |
else $img = '>'; |
| 837 |
} |
} |
| 838 |
|
$uri =& mosUriHelper::getInstance(); |
| 839 |
foreach ($this->_names as $i=>$name) { |
foreach ($this->_names as $i=>$name) { |
| 840 |
|
$uri->setUri($this->_urls[$i]); |
| 841 |
if ($i === $last AND count($customs) == 0) $result .= "$name</span>"; |
if ($i === $last AND count($customs) == 0) $result .= "$name</span>"; |
| 842 |
elseif (strstr($this->_urls[$i], 'view')) $result .= ""; |
elseif (strstr($uri->get('task'), 'view')) $result .= ""; |
| 843 |
else { |
else { |
| 844 |
$sefurl = sefRelToAbs($this->_urls[$i]); |
$sefurl = sefRelToAbs($this->_urls[$i]); |
| 845 |
$result .= "<a href='$sefurl' class='pathway'>$name</a>"; |
$result .= "<a href='$sefurl' class='pathway'>$name</a>"; |
| 1200 |
function &listAll ($type='file', $recurse=false, $fullpath=false) { |
function &listAll ($type='file', $recurse=false, $fullpath=false) { |
| 1201 |
$results = array(); |
$results = array(); |
| 1202 |
if ($dir = @opendir($this->path)) { |
if ($dir = @opendir($this->path)) { |
| 1203 |
while ($file = readdir($dir)) { |
while (false !== ($file = readdir($dir))) { |
| 1204 |
if ($file == '.' OR $file == '..') continue; |
if ($file == '.' OR $file == '..') continue; |
| 1205 |
if (is_dir($this->path.$file)) { |
if (is_dir($this->path.$file)) { |
| 1206 |
if ($recurse) { |
if ($recurse) { |
| 1216 |
} |
} |
| 1217 |
closedir($dir); |
closedir($dir); |
| 1218 |
} |
} |
| 1219 |
|
asort($results); |
| 1220 |
return $results; |
return $results; |
| 1221 |
} |
} |
| 1222 |
|
|
| 1228 |
function soleDir () { |
function soleDir () { |
| 1229 |
$found = ''; |
$found = ''; |
| 1230 |
if ($dir = @opendir($this->path)) { |
if ($dir = @opendir($this->path)) { |
| 1231 |
while ($file = readdir($dir)) { |
while (false !== ($file = readdir($dir))) { |
| 1232 |
if ($file == '.' OR $file == '..') continue; |
if ($file == '.' OR $file == '..') continue; |
| 1233 |
if (is_dir($this->path.$file)) { |
if (is_dir($this->path.$file)) { |
| 1234 |
if ($found) return ''; |
if ($found) return ''; |
| 1565 |
} |
} |
| 1566 |
} |
} |
| 1567 |
} |
} |
| 1568 |
|
if ($Itemid == 0 && !count($result)){ |
| 1569 |
|
$result[0] = new stdclass; |
| 1570 |
|
$result[0]->id = 1; |
| 1571 |
|
$result[0]->link = 'index.php?option=com_frontpage'; |
| 1572 |
|
$result[0]->parent = 0; |
| 1573 |
|
$result[0]->type = 'components'; |
| 1574 |
|
$result[0]->browserNav = 0; |
| 1575 |
|
$result[0]->name = 'Home'; |
| 1576 |
|
} |
| 1577 |
return $result; |
return $result; |
| 1578 |
} |
} |
| 1579 |
|
|
| 1585 |
function setPathway ($Itemid) { |
function setPathway ($Itemid) { |
| 1586 |
if ($Itemid) { |
if ($Itemid) { |
| 1587 |
$menu =& $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1588 |
|
if (!$menu) return; |
| 1589 |
if ($menu->parent) $this->setPathway($menu->parent); |
if ($menu->parent) $this->setPathway($menu->parent); |
| 1590 |
$pathway =& mosPathway::getInstance(); |
$pathway =& mosPathway::getInstance(); |
| 1591 |
$pathway->addItem($menu->name, $menu->link."&Itemid=$Itemid"); |
$pathway->addItem($menu->name, $menu->link."&Itemid=$Itemid"); |
| 1606 |
if ($this->getIDLikeLink($dblink) == 0) return true; |
if ($this->getIDLikeLink($dblink) == 0) return true; |
| 1607 |
if ($Itemid) { |
if ($Itemid) { |
| 1608 |
$menu =& $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1609 |
|
if (!$menu) return false; |
| 1610 |
if (strpos($menu->link,$dblink) ===0) { |
if (strpos($menu->link,$dblink) ===0) { |
| 1611 |
$access = $menu->access; |
$access = $menu->access; |
| 1612 |
} elseif ($menu_option == 'com_content' AND $Itemid == 1) { |
} elseif ($menu_option == 'com_content' AND $Itemid == 1) { |
| 1706 |
*/ |
*/ |
| 1707 |
function mosShowVIMenu( &$params ) { |
function mosShowVIMenu( &$params ) { |
| 1708 |
global $my, $cur_template, $Itemid; |
global $my, $cur_template, $Itemid; |
| 1709 |
if (mamboCore::get('mosConfig_shownoauth')) $maxaccess = 0; |
if (mamboCore::get('mosConfig_shownoauth')) $maxaccess = 9999999; |
| 1710 |
else $maxaccess = $my->gid; |
else $maxaccess = $my->getAccessGid(); |
| 1711 |
$rows =& $this->getByParentOrder(0, $params->get('menutype'), $maxaccess); |
$rows =& $this->getByParentOrder(0, $params->get('menutype'), $maxaccess); |
| 1712 |
foreach ($rows as $i=>$row) $crosslink[$row->id] = $i; |
foreach ($rows as $i=>$row) $crosslink[$row->id] = $i; |
| 1713 |
// indent icons |
// indent icons |
| 1793 |
function mosShowHFMenu( &$params, $style=0 ) { |
function mosShowHFMenu( &$params, $style=0 ) { |
| 1794 |
global $my, $cur_template, $Itemid; |
global $my, $cur_template, $Itemid; |
| 1795 |
|
|
| 1796 |
if (mamboCore::get('mosConfig_shownoauth')) $maxaccess = 0; |
if (mamboCore::get('mosConfig_shownoauth')) $maxaccess = 9999999; |
| 1797 |
else $maxaccess = $my->gid; |
else $maxaccess = $my->getAccessGid(); |
| 1798 |
$rows =& $this->getByParentOrder(0, $params->get('menutype'), $maxaccess, true); |
$rows =& $this->getByParentOrder(0, $params->get('menutype'), $maxaccess, true); |
| 1799 |
|
|
| 1800 |
$links = array(); |
$links = array(); |
| 1988 |
if (isset($result[0])) return $result[0]; |
if (isset($result[0])) return $result[0]; |
| 1989 |
return null; |
return null; |
| 1990 |
} |
} |
| 1991 |
|
|
| 1992 |
|
function getBot($element, $folder) { |
| 1993 |
|
$returnBot = ''; |
| 1994 |
|
foreach ($this->_bots as $i=>$bot) { |
| 1995 |
|
if ($bot->folder == $folder && $bot->element == $element){ |
| 1996 |
|
$returnBot = $bot; |
| 1997 |
|
break; |
| 1998 |
|
} |
| 1999 |
|
} |
| 2000 |
|
return $returnBot; |
| 2001 |
|
} |
| 2002 |
} |
} |
| 2003 |
|
|
| 2004 |
/** |
/** |
| 2071 |
$this->grp = mosGetParam( $_SESSION, 'session_grp', 0); |
$this->grp = mosGetParam( $_SESSION, 'session_grp', 0); |
| 2072 |
} |
} |
| 2073 |
/** |
/** |
| 2074 |
|
* User access level |
| 2075 |
|
*/ |
| 2076 |
|
function getAccessGid() { |
| 2077 |
|
static $access; |
| 2078 |
|
if (!isset($access)) { |
| 2079 |
|
$acl = new gacl; |
| 2080 |
|
$access = $this->id > 0 ? 1 : 0; |
| 2081 |
|
$access += $acl->acl_check( 'action', 'access', 'users', $this->usertype, 'frontend', 'special' ); |
| 2082 |
|
} |
| 2083 |
|
return $access; |
| 2084 |
|
} |
| 2085 |
|
/** |
| 2086 |
* Validation and filtering |
* Validation and filtering |
| 2087 |
* @return boolean True is satisfactory |
* @return boolean True is satisfactory |
| 2088 |
*/ |
*/ |
| 2562 |
$sql['os'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$os',1)"; |
$sql['os'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$os',1)"; |
| 2563 |
$sql['domain'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$tldomain',2)"; |
$sql['domain'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$tldomain',2)"; |
| 2564 |
if ($stats) foreach ($stats as $stat) { |
if ($stats) foreach ($stats as $stat) { |
| 2565 |
if ($stat->type == 0) $sql['agents'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$browser' AND type=0"; |
if ($stat->type == 0) $sql['browser'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$browser' AND type=0"; |
| 2566 |
if ($stat->type == 1) $sql['os'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$os' AND type=1"; |
if ($stat->type == 1) $sql['os'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$os' AND type=1"; |
| 2567 |
if ($stat->type == 2) $sql['domain'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$tldomain' AND type=2"; |
if ($stat->type == 2) $sql['domain'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$tldomain' AND type=2"; |
| 2568 |
} |
} |
| 2611 |
<?php |
<?php |
| 2612 |
} |
} |
| 2613 |
} |
} |
| 2614 |
|
/** |
| 2615 |
|
* Render head tags |
| 2616 |
|
* tags are assembled into an associative array with the following elements: |
| 2617 |
|
* - title |
| 2618 |
|
* - meta |
| 2619 |
|
* - mambojavascript |
| 2620 |
|
* - custom (custom head tags) |
| 2621 |
|
* - livebookmark |
| 2622 |
|
* - favicon |
| 2623 |
|
* @param unknown keys - array elements to output (null = output all) |
| 2624 |
|
* @param unknown exclude - array elements to exclude in output |
| 2625 |
|
* |
| 2626 |
|
* Usage: mosShowHead() - to render all tags |
| 2627 |
|
* mosShowHead('title') - to render a single tag |
| 2628 |
|
* mosShowHead(array('title', 'meta')) - to selectively render tags (in order) |
| 2629 |
|
* mosShowHead(null, 'custom') - to exclude a single tag |
| 2630 |
|
* mosShowHead(null, array('custom','favicon')) - to exclude multiple tags |
| 2631 |
|
*/ |
| 2632 |
|
function mosShowHead($keys='', $exclude='') { |
| 2633 |
|
if (!is_array($keys)) |
| 2634 |
|
if ($keys !== '' && !is_null($keys)) |
| 2635 |
|
$keys = array($keys); |
| 2636 |
|
else $keys = array(); |
| 2637 |
|
if (!is_array($exclude)) |
| 2638 |
|
if ($exclude !== '') |
| 2639 |
|
$exclude = array($exclude); |
| 2640 |
|
else $exclude = array(); |
| 2641 |
|
|
| 2642 |
|
$this->_head['output'] = array(); |
| 2643 |
|
|
| 2644 |
|
$head = array();; |
| 2645 |
|
$head['title'] = '<title>'.$this->_head['title'].'</title>'; |
| 2646 |
|
|
|
function mosShowHead () { |
|
|
global $_VERSION; |
|
|
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
|
| 2647 |
$this->appendMetaTag( 'description', mamboCore::get('mosConfig_MetaDesc'), true ); |
$this->appendMetaTag( 'description', mamboCore::get('mosConfig_MetaDesc'), true ); |
| 2648 |
$this->appendMetaTag( 'keywords', mamboCore::get('mosConfig_MetaKeys'), true ); |
$this->appendMetaTag( 'keywords', mamboCore::get('mosConfig_MetaKeys'), true ); |
| 2649 |
echo $this->getHead(); |
$head['meta'] = array(); |
| 2650 |
if (mamboCore::get('mosConfig_sef')) { |
foreach ($this->_head['meta'] as $name=>$meta) { |
| 2651 |
echo "<base href=\"$mosConfig_live_site/\" />\r\n"; |
if ($meta[1]) $head['meta'][] = $meta[1]; |
| 2652 |
|
$head['meta'][] = '<meta name="' . $name . '" content="' . $meta[0] . '" />'; |
| 2653 |
|
if ($meta[2]) $head['meta'][] = $meta[2]; |
| 2654 |
} |
} |
| 2655 |
|
$head['meta'] = implode( "\n", $head['meta'] ); |
| 2656 |
|
|
| 2657 |
$my = mamboCore::get('currentUser'); |
$my = mamboCore::get('currentUser'); |
| 2658 |
if ( $my->id ) { |
$head['mambojavascript'] = $my->id ? '<script type="text/javascript" src="'.mamboCore::get('mosConfig_live_site').'/includes/js/mambojavascript.js"></script>' : ''; |
| 2659 |
?> |
|
| 2660 |
<script language="JavaScript1.2" src="<?php echo $mosConfig_live_site;?>/includes/js/mambojavascript.js" type="text/javascript"></script> |
$head['custom'] = array(); |
| 2661 |
<?php |
foreach ($this->_head['custom'] as $html) |
| 2662 |
} |
if (trim($html) !== '') |
| 2663 |
|
$head['custom'][] = $html; |
| 2664 |
|
if (count($head['custom']) !== 0) |
| 2665 |
|
$head['custom'] = implode( "\n", $head['custom'] ); |
| 2666 |
|
else |
| 2667 |
|
$head['custom'] = ''; |
| 2668 |
|
|
| 2669 |
|
ob_start(); |
| 2670 |
$this->liveBookMark(); |
$this->liveBookMark(); |
| 2671 |
// outputs link tag for page |
$head['livebookmark'] = ob_get_contents(); |
| 2672 |
|
ob_end_clean(); |
| 2673 |
|
|
| 2674 |
$configuration =& mamboCore::getMamboCore(); |
$configuration =& mamboCore::getMamboCore(); |
| 2675 |
?> |
$head['favicon'] = "<link rel=\"shortcut icon\" href=\"".$configuration->getFavIcon()."\" />"; |
| 2676 |
<link rel="shortcut icon" href="<?php echo $configuration->getFavIcon();?>" /> |
|
| 2677 |
<?php |
if (mamboCore::get('mosConfig_sef')) { |
| 2678 |
|
$head['base'] = "<base href=\"".mamboCore::get('mosConfig_live_site')."/\" />"; |
| 2679 |
} |
} |
| 2680 |
|
|
| 2681 |
|
foreach($head as $key=>$value) |
| 2682 |
|
$this->_head['output'][$key] = "$value"; |
| 2683 |
|
|
| 2684 |
|
$tags = $this->_head['output']; |
| 2685 |
|
if (count($keys) == 0) { |
| 2686 |
|
foreach($tags as $key=>$value) |
| 2687 |
|
if (!in_array($key, $exclude)) |
| 2688 |
|
if ($value !== '') |
| 2689 |
|
echo trim($value)."\n"; |
| 2690 |
|
} else { |
| 2691 |
|
foreach($keys as $key) |
| 2692 |
|
if (isset($tags[$key])) |
| 2693 |
|
if(trim($tags[$key]) !== '') |
| 2694 |
|
echo trim($tags[$key])."\n"; |
| 2695 |
|
} |
| 2696 |
|
} |
| 2697 |
|
|
| 2698 |
/** |
/** |
| 2699 |
* retained for backward compatability |
* retained for backward compatability |
| 2727 |
$handler =& new contentHandler(); |
$handler =& new contentHandler(); |
| 2728 |
return $handler->getContentItemLinkCount(); |
return $handler->getContentItemLinkCount(); |
| 2729 |
} |
} |
| 2730 |
|
|
| 2731 |
|
function formId($option='', $task='', $my='') { |
| 2732 |
|
$option=trim($option);$task=trim($task); |
| 2733 |
|
if (!$option) die('Illegal option for mainframe formId in core.classes.php'); |
| 2734 |
|
if (!$task) die('Illegal task for mainframe formId in core.classes.php'); |
| 2735 |
|
if (!is_object($my)) die('Illegal user object for mainframe formId in core.classes.php'); |
| 2736 |
|
mos_session_start(); |
| 2737 |
|
$hash = md5(microtime().mt_rand()); |
| 2738 |
|
$_SESSION['mosfid'] = md5($hash.$option.$task.$my->id.mamboCore::get('mosConfig_secret')); |
| 2739 |
|
return $hash; |
| 2740 |
|
} |
| 2741 |
|
|
| 2742 |
|
function validFormId($option='', $task='', $my='') { |
| 2743 |
|
$option=trim($option);$task=trim($task); |
| 2744 |
|
if (!$option) die('Illegal option for mainframe validFormId in core.classes.php'); |
| 2745 |
|
if (!$task) die('Illegal task for mainframe validFormId in core.classes.php'); |
| 2746 |
|
if (!is_object($my)) die('Illegal user object for mainframe validFormId in core.classes.php'); |
| 2747 |
|
if (!isset($_REQUEST['f'])) die('Missing hash for mainframe validFormId in core.classes.php'); |
| 2748 |
|
if (!isset($_SESSION['mosfid'])) return false; |
| 2749 |
|
$valid = $_SESSION['mosfid'] == md5($_REQUEST['f'].$option.$task.$my->id.mamboCore::get('mosConfig_secret')); |
| 2750 |
|
unset($_SESSION['mosfid']); |
| 2751 |
|
return $valid; |
| 2752 |
|
} |
| 2753 |
|
|
| 2754 |
/** |
/** |
| 2755 |
* retained for backward compatability |
* retained for backward compatability |
| 2756 |
*/ |
*/ |
| 3666 |
//$Debug [$Group][$Number] = "Message, can by with $Value"; |
//$Debug [$Group][$Number] = "Message, can by with $Value"; |
| 3667 |
//$Group[0] - Errors |
//$Group[0] - Errors |
| 3668 |
//$Group[1] - Notice |
//$Group[1] - Notice |
| 3669 |
$Debug[0][0] = "Error, can NOT read file: " . $Value . "<br>"; |
$Debug[0][0] = "Error, can NOT read file: " . $Value . "<br />"; |
| 3670 |
$Debug[0][1] = "Error, can't find maching char \"". $Value ."\" in destination encoding table!" . "<br>"; |
$Debug[0][1] = "Error, can't find maching char \"". $Value ."\" in destination encoding table!" . "<br />"; |
| 3671 |
$Debug[0][2] = "Error, can't find maching char \"". $Value ."\" in source encoding table!" . "<br>"; |
$Debug[0][2] = "Error, can't find maching char \"". $Value ."\" in source encoding table!" . "<br />"; |
| 3672 |
$Debug[0][3] = "Error, you did NOT set variable " . $Value . " in Convert() function." . "<br>"; |
$Debug[0][3] = "Error, you did NOT set variable " . $Value . " in Convert() function." . "<br />"; |
| 3673 |
$Debug[0][4] = "You can NOT convert string from " . $Value . " to " . $Value . "!" . "<BR>"; |
$Debug[0][4] = "You can NOT convert string from " . $Value . " to " . $Value . "!" . "<br />"; |
| 3674 |
$Debug[1][0] = "Notice, you are trying to convert string from ". $Value ." to ". $Value .", don't you feel it's strange? ;-)" . "<br>"; |
$Debug[1][0] = "Notice, you are trying to convert string from ". $Value ." to ". $Value .", don't you feel it's strange? ;-)" . "<br />"; |
| 3675 |
$Debug[1][1] = "Notice, both charsets " . $Value . " are identical! Check encoding tables files." . "<br>"; |
$Debug[1][1] = "Notice, both charsets " . $Value . " are identical! Check encoding tables files." . "<br />"; |
| 3676 |
$Debug[1][2] = "Notice, there is no unicode char in the string you are trying to convert." . "<br>"; |
$Debug[1][2] = "Notice, there is no unicode char in the string you are trying to convert." . "<br />"; |
| 3677 |
|
|
| 3678 |
if (DEBUG_MODE >= $Group) |
if (DEBUG_MODE >= $Group) |
| 3679 |
{ |
{ |
| 3682 |
} // function DebugOutput |
} // function DebugOutput |
| 3683 |
|
|
| 3684 |
} //class ends here |
} //class ends here |
| 3685 |
|
|
| 3686 |
?> |
?> |