| 1 |
<?php |
<?php |
| 2 |
|
/** |
| 3 |
|
* @package Mambo Open Source |
| 4 |
|
* @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
| 5 |
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 6 |
|
* |
| 7 |
|
* Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure |
| 8 |
|
* that Mambo remained free Open Source software owned and managed by the community. |
| 9 |
|
* Mambo is Free Software |
| 10 |
|
*/ |
| 11 |
|
|
| 12 |
/** |
/** |
| 13 |
* Mambo basic error object |
* Mambo basic error object |
| 323 |
$f = @fopen($this->rootPath.'/configuration.php','rb'); |
$f = @fopen($this->rootPath.'/configuration.php','rb'); |
| 324 |
if ($f) { |
if ($f) { |
| 325 |
while ($f AND !feof($f)) { |
while ($f AND !feof($f)) { |
| 326 |
$line = fgets($f, 256); |
$line = fgets($f); |
| 327 |
$altered = str_replace('$', '$this->', $line); |
$altered = str_replace('$', '$this->', $line); |
| 328 |
if ($altered != $line) $code .= $altered; |
if ($altered != $line) $code .= $altered; |
| 329 |
} |
} |
| 364 |
} |
} |
| 365 |
else $port = ''; |
else $port = ''; |
| 366 |
$afterscheme = '://'.$servername.$port.$this->subdirectory; |
$afterscheme = '://'.$servername.$port.$this->subdirectory; |
| 367 |
$this->mosConfig_live_site = $this->mosConfig_secure_site = $scheme.$afterscheme; |
//$this->mosConfig_live_site = $this->mosConfig_secure_site = $scheme.$afterscheme; |
| 368 |
$this->mosConfig_unsecure_site = 'http'.$afterscheme; |
$this->mosConfig_unsecure_site = 'http'.$afterscheme; |
| 369 |
$this->mosConfig_absolute_path = $this->rootPath; |
$this->mosConfig_absolute_path = $this->rootPath; |
| 370 |
preg_match_all('/\$this\-\>([A-Za-z_][A-Za-z0-9_]*)/', $code, $matches); |
preg_match_all('/\$this\-\>([A-Za-z_][A-Za-z0-9_]*)/', $code, $matches); |
| 463 |
foreach ( $superglobals as $superglobal ) { |
foreach ( $superglobals as $superglobal ) { |
| 464 |
foreach ( $superglobal as $key => $value) { |
foreach ( $superglobal as $key => $value) { |
| 465 |
unset( $GLOBALS[$key]); |
unset( $GLOBALS[$key]); |
| 466 |
|
unset( $GLOBALS[$key]); |
| 467 |
} |
} |
| 468 |
} |
} |
| 469 |
} |
} |
| 487 |
if ($pos !== false) $link = substr( $link, $pos+1 ). '&Itemid='.$this->Itemid; |
if ($pos !== false) $link = substr( $link, $pos+1 ). '&Itemid='.$this->Itemid; |
| 488 |
parse_str( $link, $temp ); |
parse_str( $link, $temp ); |
| 489 |
/** this is a patch, need to rework when globals are handled better */ |
/** this is a patch, need to rework when globals are handled better */ |
| 490 |
foreach ($temp as $k=>$v) $_GET[$k] = $v; |
foreach ($temp as $k=>$v) $_GET[$k] = $_REQUEST[$k] = $v; |
| 491 |
if (isset($temp['option'])) $option = $temp['option']; |
if (isset($temp['option'])) $option = $temp['option']; |
| 492 |
else return ''; |
else return ''; |
| 493 |
} |
} |
| 571 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 572 |
$authenticator =& mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 573 |
$loggedin = $authenticator->loginUser(); |
$loggedin = $authenticator->loginUser(); |
| 574 |
if ($loggedin) $this->logMessage(_LOGIN_SUCCESS); |
if ($loggedin) $this->logMessage('_LOGIN_SUCCESS'); |
| 575 |
else mamboCore::redirect('index.php'); |
else mamboCore::redirect('index.php'); |
| 576 |
} |
} |
| 577 |
|
|
| 583 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 584 |
$authenticator =& mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 585 |
$authenticator->logoutUser(); |
$authenticator->logoutUser(); |
| 586 |
$this->logMessage(_LOGOUT_SUCCESS); |
$this->logMessage('_LOGOUT_SUCCESS'); |
| 587 |
} |
} |
| 588 |
|
|
| 589 |
/** |
/** |
| 811 |
* Make a pathway string for display |
* Make a pathway string for display |
| 812 |
*/ |
*/ |
| 813 |
function makePathway () { |
function makePathway () { |
|
$last = count($this->_names) - 1; |
|
|
if ($last == 0) return ''; |
|
| 814 |
$mainframe =& mosMainFrame::getInstance(); |
$mainframe =& mosMainFrame::getInstance(); |
| 815 |
|
$customs = $mainframe->getCustomPathWay(); |
| 816 |
|
$last = count($this->_names) - 1; |
| 817 |
|
if ($last == 0 AND count($customs == 0)) return ''; |
| 818 |
$result = "<span class='pathway'>"; |
$result = "<span class='pathway'>"; |
| 819 |
$config =& mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 820 |
$rootpath = $config->rootPath(); |
$rootpath = $config->rootPath(); |
| 826 |
else $img = '>'; |
else $img = '>'; |
| 827 |
} |
} |
| 828 |
foreach ($this->_names as $i=>$name) { |
foreach ($this->_names as $i=>$name) { |
| 829 |
if ($i === $last) $result .= "$name</span>"; |
if ($i === $last AND count($customs) == 0) $result .= "$name</span>"; |
| 830 |
|
elseif (strstr($this->_urls[$i], 'view')) $result .= ""; |
| 831 |
else { |
else { |
| 832 |
$sefurl = sefRelToAbs($this->_urls[$i]); |
$sefurl = sefRelToAbs($this->_urls[$i]); |
| 833 |
$result .= "<a href='$sefurl' class='pathway'>$name</a>"; |
$result .= "<a href='$sefurl' class='pathway'>$name</a>"; |
| 834 |
$result .= " $img "; |
$result .= " $img "; |
| 835 |
} |
} |
| 836 |
} |
} |
|
$customs = $mainframe->getCustomPathWay(); |
|
| 837 |
foreach ($customs as $custom) $result .= $custom; |
foreach ($customs as $custom) $result .= $custom; |
| 838 |
$result .= '</span>'; |
if (count($customs)) $result .= '</span>'; |
| 839 |
return $result; |
return $result; |
| 840 |
} |
} |
| 841 |
|
|
| 2039 |
* @return boolean True is satisfactory |
* @return boolean True is satisfactory |
| 2040 |
*/ |
*/ |
| 2041 |
function check() { |
function check() { |
| 2042 |
|
Global $mosConfig_absolute_path; |
| 2043 |
|
include $mosConfig_absolute_path . ('/language/english.php'); |
| 2044 |
$this->_error = ''; |
$this->_error = ''; |
| 2045 |
if ($this->name == '') $this->_error = _REGWARN_NAME; |
if ($this->name == '') $this->_error = _REGWARN_NAME; |
| 2046 |
elseif ($this->username == '') $this->_error = _REGWARN_UNAME; |
elseif ($this->username == '') $this->_error = _REGWARN_UNAME; |
| 2583 |
<?php |
<?php |
| 2584 |
} |
} |
| 2585 |
|
|
| 2586 |
|
|
| 2587 |
|
/** |
| 2588 |
|
* retained for backward compatability |
| 2589 |
|
*/ |
| 2590 |
|
function getBlogSectionCount() { |
| 2591 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2592 |
|
$handler =& new contentHandler(); |
| 2593 |
|
return $handler->getBlogSectionCount(); |
| 2594 |
|
} |
| 2595 |
|
|
| 2596 |
|
function getBlogCategoryCount() { |
| 2597 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2598 |
|
$handler =& new contentHandler(); |
| 2599 |
|
return $handler->getBlogCategoryCount(); |
| 2600 |
|
} |
| 2601 |
|
|
| 2602 |
|
function getGlobalBlogSectionCount() { |
| 2603 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2604 |
|
$handler =& new contentHandler(); |
| 2605 |
|
return $handler->getGlobalBlogSectionCount(); |
| 2606 |
|
} |
| 2607 |
|
|
| 2608 |
|
function getStaticContentCount() { |
| 2609 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2610 |
|
$handler =& new contentHandler(); |
| 2611 |
|
return $handler->getStaticContentCount(); |
| 2612 |
|
} |
| 2613 |
|
|
| 2614 |
|
function getContentItemLinkCount() { |
| 2615 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2616 |
|
$handler =& new contentHandler(); |
| 2617 |
|
return $handler->getContentItemLinkCount(); |
| 2618 |
|
} |
| 2619 |
|
/** |
| 2620 |
|
* retained for backward compatability |
| 2621 |
|
*/ |
| 2622 |
|
|
| 2623 |
} |
} |
| 2624 |
|
|
| 2625 |
/** |
/** |