| 316 |
$f = @fopen($this->rootPath.'/configuration.php','rb'); |
$f = @fopen($this->rootPath.'/configuration.php','rb'); |
| 317 |
if ($f) { |
if ($f) { |
| 318 |
while ($f AND !feof($f)) { |
while ($f AND !feof($f)) { |
| 319 |
$line = fgets($f, 256); |
$line = fgets($f); |
| 320 |
$altered = str_replace('$', '$this->', $line); |
$altered = str_replace('$', '$this->', $line); |
| 321 |
if ($altered != $line) $code .= $altered; |
if ($altered != $line) $code .= $altered; |
| 322 |
} |
} |
| 357 |
} |
} |
| 358 |
else $port = ''; |
else $port = ''; |
| 359 |
$afterscheme = '://'.$servername.$port.$this->subdirectory; |
$afterscheme = '://'.$servername.$port.$this->subdirectory; |
| 360 |
$this->mosConfig_live_site = $this->mosConfig_secure_site = $scheme.$afterscheme; |
//$this->mosConfig_live_site = $this->mosConfig_secure_site = $scheme.$afterscheme; |
| 361 |
$this->mosConfig_unsecure_site = 'http'.$afterscheme; |
$this->mosConfig_unsecure_site = 'http'.$afterscheme; |
| 362 |
$this->mosConfig_absolute_path = $this->rootPath; |
$this->mosConfig_absolute_path = $this->rootPath; |
| 363 |
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); |
| 456 |
foreach ( $superglobals as $superglobal ) { |
foreach ( $superglobals as $superglobal ) { |
| 457 |
foreach ( $superglobal as $key => $value) { |
foreach ( $superglobal as $key => $value) { |
| 458 |
unset( $GLOBALS[$key]); |
unset( $GLOBALS[$key]); |
| 459 |
|
unset( $GLOBALS[$key]); |
| 460 |
} |
} |
| 461 |
} |
} |
| 462 |
} |
} |
| 564 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 565 |
$authenticator =& mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 566 |
$loggedin = $authenticator->loginUser(); |
$loggedin = $authenticator->loginUser(); |
| 567 |
if ($loggedin) $this->logMessage(_LOGIN_SUCCESS); |
if ($loggedin) $this->logMessage('_LOGIN_SUCCESS'); |
| 568 |
else mamboCore::redirect('index.php'); |
else mamboCore::redirect('index.php'); |
| 569 |
} |
} |
| 570 |
|
|
| 576 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 577 |
$authenticator =& mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 578 |
$authenticator->logoutUser(); |
$authenticator->logoutUser(); |
| 579 |
$this->logMessage(_LOGOUT_SUCCESS); |
$this->logMessage('_LOGOUT_SUCCESS'); |
| 580 |
} |
} |
| 581 |
|
|
| 582 |
/** |
/** |
| 804 |
* Make a pathway string for display |
* Make a pathway string for display |
| 805 |
*/ |
*/ |
| 806 |
function makePathway () { |
function makePathway () { |
|
$last = count($this->_names) - 1; |
|
|
if ($last == 0) return ''; |
|
| 807 |
$mainframe =& mosMainFrame::getInstance(); |
$mainframe =& mosMainFrame::getInstance(); |
| 808 |
|
$customs = $mainframe->getCustomPathWay(); |
| 809 |
|
$last = count($this->_names) - 1; |
| 810 |
|
if ($last == 0 AND count($customs == 0)) return ''; |
| 811 |
$result = "<span class='pathway'>"; |
$result = "<span class='pathway'>"; |
| 812 |
$config =& mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 813 |
$rootpath = $config->rootPath(); |
$rootpath = $config->rootPath(); |
| 819 |
else $img = '>'; |
else $img = '>'; |
| 820 |
} |
} |
| 821 |
foreach ($this->_names as $i=>$name) { |
foreach ($this->_names as $i=>$name) { |
| 822 |
if ($i === $last) $result .= "$name</span>"; |
if ($i === $last AND count($customs) == 0) $result .= "$name</span>"; |
| 823 |
else { |
else { |
| 824 |
$sefurl = sefRelToAbs($this->_urls[$i]); |
$sefurl = sefRelToAbs($this->_urls[$i]); |
| 825 |
$result .= "<a href='$sefurl' class='pathway'>$name</a>"; |
$result .= "<a href='$sefurl' class='pathway'>$name</a>"; |
| 826 |
$result .= " $img "; |
$result .= " $img "; |
| 827 |
} |
} |
| 828 |
} |
} |
|
$customs = $mainframe->getCustomPathWay(); |
|
| 829 |
foreach ($customs as $custom) $result .= $custom; |
foreach ($customs as $custom) $result .= $custom; |
| 830 |
$result .= '</span>'; |
if (count($customs)) $result .= '</span>'; |
| 831 |
return $result; |
return $result; |
| 832 |
} |
} |
| 833 |
|
|
| 2031 |
* @return boolean True is satisfactory |
* @return boolean True is satisfactory |
| 2032 |
*/ |
*/ |
| 2033 |
function check() { |
function check() { |
| 2034 |
|
Global $mosConfig_absolute_path; |
| 2035 |
|
include $mosConfig_absolute_path . ('/language/english.php'); |
| 2036 |
$this->_error = ''; |
$this->_error = ''; |
| 2037 |
if ($this->name == '') $this->_error = _REGWARN_NAME; |
if ($this->name == '') $this->_error = _REGWARN_NAME; |
| 2038 |
elseif ($this->username == '') $this->_error = _REGWARN_UNAME; |
elseif ($this->username == '') $this->_error = _REGWARN_UNAME; |
| 2336 |
* @param string The default value for the variable if not found |
* @param string The default value for the variable if not found |
| 2337 |
*/ |
*/ |
| 2338 |
function getUserStateFromRequest( $var_name, $req_name, $var_default=null ) { |
function getUserStateFromRequest( $var_name, $req_name, $var_default=null ) { |
| 2339 |
|
if (is_array($this->_userstate)) { |
| 2340 |
if (isset($_REQUEST[$req_name])) $this->setUserState($var_name, $_REQUEST[$req_name]); |
if (isset($_REQUEST[$req_name])) $this->setUserState($var_name, $_REQUEST[$req_name]); |
| 2341 |
elseif (isset($var_default) AND !isset($this->userstate[$var_name])) $this->setUserState($var_name, $var_default); |
else if (isset($var_default) AND !isset($this->_userstate[$var_name])) $this->setUserState($var_name, $var_default); |
| 2342 |
return $this->getUserState($var_name); |
return $this->_userstate[$var_name]; |
| 2343 |
|
} else { |
| 2344 |
|
return null; |
| 2345 |
|
} |
| 2346 |
} |
} |
| 2347 |
/** |
/** |
| 2348 |
* Initialises the user session |
* Initialises the user session |
| 2575 |
<?php |
<?php |
| 2576 |
} |
} |
| 2577 |
|
|
| 2578 |
|
|
| 2579 |
|
/** |
| 2580 |
|
* retained for backward compatability |
| 2581 |
|
*/ |
| 2582 |
|
function getBlogSectionCount() { |
| 2583 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2584 |
|
$handler =& new contentHandler(); |
| 2585 |
|
return $handler->getBlogSectionCount(); |
| 2586 |
|
} |
| 2587 |
|
|
| 2588 |
|
function getBlogCategoryCount() { |
| 2589 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2590 |
|
$handler =& new contentHandler(); |
| 2591 |
|
return $handler->getBlogCategoryCount(); |
| 2592 |
|
} |
| 2593 |
|
|
| 2594 |
|
function getGlobalBlogSectionCount() { |
| 2595 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2596 |
|
$handler =& new contentHandler(); |
| 2597 |
|
return $handler->getGlobalBlogSectionCount(); |
| 2598 |
|
} |
| 2599 |
|
|
| 2600 |
|
function getStaticContentCount() { |
| 2601 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2602 |
|
$handler =& new contentHandler(); |
| 2603 |
|
return $handler->getStaticContentCount(); |
| 2604 |
|
} |
| 2605 |
|
|
| 2606 |
|
function getContentItemLinkCount() { |
| 2607 |
|
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2608 |
|
$handler =& new contentHandler(); |
| 2609 |
|
return $handler->getContentItemLinkCount(); |
| 2610 |
|
} |
| 2611 |
|
/** |
| 2612 |
|
* retained for backward compatability |
| 2613 |
|
*/ |
| 2614 |
|
|
| 2615 |
} |
} |
| 2616 |
|
|
| 2617 |
/** |
/** |