| 57 |
var $rootPath = ''; |
var $rootPath = ''; |
| 58 |
var $Itemid = 0; |
var $Itemid = 0; |
| 59 |
var $option = ''; |
var $option = ''; |
| 60 |
|
var $subdirectory; |
| 61 |
var $current_user = null; |
var $current_user = null; |
| 62 |
var $do_gzip_compress = false; |
var $do_gzip_compress = false; |
| 63 |
|
|
| 136 |
fclose($f); |
fclose($f); |
| 137 |
eval($code); |
eval($code); |
| 138 |
$subdir = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])); |
$subdir = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])); |
| 139 |
$subdir = str_replace('\\', '/', $subdir); |
$this->subdirectory = str_replace('\\', '/', $subdir); |
| 140 |
$this->mosConfig_live_site = 'http://'.$_SERVER['SERVER_NAME'].$subdir; |
$this->mosConfig_live_site = 'http://'.$_SERVER['SERVER_NAME'].$this->subdirectory; |
| 141 |
$this->mosConfig_absolute_path = $this->rootPath; |
$this->mosConfig_absolute_path = $this->rootPath; |
| 142 |
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); |
| 143 |
foreach ($matches[1] as $match) $GLOBALS[$match] = $this->$match; |
foreach ($matches[1] as $match) $GLOBALS[$match] = $this->$match; |
| 197 |
} |
} |
| 198 |
} |
} |
| 199 |
|
|
| 200 |
DEFINE('_ISO','charset='.$this->language['encoding']); |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$this->language['encoding']); |
| 201 |
DEFINE('_DATE_FORMAT_LC', $this->language['dateformat']); //Uses PHP's strftime Command Format |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $this->language['dateformat']); //Uses PHP's strftime Command Format |
| 202 |
DEFINE('_DATE_FORMAT_LC2', $this->language['dateformat']." %H:%M"); |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $this->language['dateformat']." %H:%M"); |
| 203 |
|
|
| 204 |
//header('Content-Type: text/html; charset=utf-8'); |
//header('Content-Type: text/html; charset=utf-8'); |
| 205 |
$domain = $this->mosConfig_lang; |
$domain = $this->mosConfig_lang; |
| 296 |
if (strpos($url, '?')) $url .= '&mosmsg='.urlencode($message); |
if (strpos($url, '?')) $url .= '&mosmsg='.urlencode($message); |
| 297 |
else $url .= '?mosmsg='.urlencode($message); |
else $url .= '?mosmsg='.urlencode($message); |
| 298 |
} |
} |
| 299 |
|
//die('Ready to redirect to '.$url); |
| 300 |
if (headers_sent()) echo "<script>document.location.href='$url';</script>\n"; |
if (headers_sent()) echo "<script>document.location.href='$url';</script>\n"; |
| 301 |
else { |
else { |
| 302 |
@ob_end_clean(); // clear output buffer |
@ob_end_clean(); // clear output buffer |
| 317 |
<?php |
<?php |
| 318 |
} |
} |
| 319 |
if ($return = mosGetParam( $_REQUEST, 'return', '' )) { |
if ($return = mosGetParam( $_REQUEST, 'return', '' )) { |
| 320 |
|
echo 'About to redirect (return)'; |
| 321 |
$this->redirect( $return ); |
$this->redirect( $return ); |
| 322 |
} |
} |
| 323 |
else { |
else { |
| 324 |
|
echo 'About to redirect (live site)'; |
| 325 |
$this->redirect( $this->mosConfig_live_site.'/index.php' ); |
$this->redirect( $this->mosConfig_live_site.'/index.php' ); |
| 326 |
} |
} |
| 327 |
} |
} |
| 680 |
} |
} |
| 681 |
|
|
| 682 |
function deleteFile ($file) { |
function deleteFile ($file) { |
| 683 |
if (file_exists($file)) unlink($file); |
if (file_exists($file)) { |
| 684 |
|
@chmod($file, 0644); |
| 685 |
|
return unlink($file); |
| 686 |
|
} |
| 687 |
|
return true; |
| 688 |
} |
} |
| 689 |
|
|
| 690 |
function deleteDirectory ($dir) { |
function deleteDirectory ($dir) { |
| 691 |
rmdir($dir); |
if (file_exists($dir)) { |
| 692 |
|
if (is_dir($dir)) { |
| 693 |
|
@chmod($dir, 0755); |
| 694 |
|
return rmdir($dir); |
| 695 |
|
} |
| 696 |
|
return false; |
| 697 |
|
} |
| 698 |
|
return true; |
| 699 |
} |
} |
| 700 |
|
|
| 701 |
function createDirectory ($dir) { |
function createDirectory ($dir) { |
| 702 |
|
if (is_dir($dir)) return true; |
| 703 |
list($upDirectory, $count) = $this->containingDirectory($dir); |
list($upDirectory, $count) = $this->containingDirectory($dir); |
| 704 |
if ($count > 1 AND !file_exists($upDirectory)) $this->createDirectory($upDirectory); |
if ($count > 1 AND !is_dir($upDirectory)) if (!$this->createDirectory($upDirectory)) return false; |
| 705 |
mkdir($dir); |
$dirperms = mamboCore::get('mosConfig_dirperms'); |
| 706 |
|
if ($dirperms) { |
| 707 |
|
$origmask = @umask(0); |
| 708 |
|
$mode = octdec($dirperms); |
| 709 |
|
} |
| 710 |
|
else $mode = 0777; |
| 711 |
|
if (!@mkdir($dir, $mode )) $result = false; |
| 712 |
|
else { |
| 713 |
|
$result = true; |
| 714 |
|
@chmod ($dir, $mode); |
| 715 |
|
} |
| 716 |
|
if (isset($origmask)) @umask($origmask); |
| 717 |
|
return $result; |
| 718 |
} |
} |
| 719 |
|
|
| 720 |
function containingDirectory ($dir) { |
function containingDirectory ($dir) { |
| 778 |
function mosChmod($path) |
function mosChmod($path) |
| 779 |
{ |
{ |
| 780 |
$fileperms = mamboCore::get('mosConfig_fileperms'); |
$fileperms = mamboCore::get('mosConfig_fileperms'); |
|
$dirperms = mamboCore::get('mosConfig_dirperms'); |
|
| 781 |
if ($fileperms != '') $filemode = octdec($fileperms); |
if ($fileperms != '') $filemode = octdec($fileperms); |
| 782 |
else $filemode = null; |
else $filemode = null; |
| 783 |
|
$dirperms = mamboCore::get('mosConfig_dirperms'); |
| 784 |
if ($dirperms != '') $dirmode = octdec($dirperms); |
if ($dirperms != '') $dirmode = octdec($dirperms); |
| 785 |
else $dirmode = null; |
else $dirmode = null; |
| 786 |
if (isset($filemode) OR isset($dirmode)) |
if (isset($filemode) OR isset($dirmode)) |