| 176 |
// favourites icon |
// favourites icon |
| 177 |
if (!isset($this->mosConfig_favicon)) $this->mosConfig_favicon = 'favicon.ico'; |
if (!isset($this->mosConfig_favicon)) $this->mosConfig_favicon = 'favicon.ico'; |
| 178 |
if (!file_exists($this->rootPath.'/images/'.$this->mosConfig_favicon)) $this->mosConfig_favicon = 'favicon.ico'; |
if (!file_exists($this->rootPath.'/images/'.$this->mosConfig_favicon)) $this->mosConfig_favicon = 'favicon.ico'; |
| 179 |
return $this->rootPath.'/images/'.$this->mosConfig_favicon; |
return $this->mosConfig_live_site.'/images/'.$this->mosConfig_favicon; |
| 180 |
} |
} |
| 181 |
|
|
| 182 |
function offlineCheck (&$user, &$database) { |
function offlineCheck (&$user, &$database) { |
| 739 |
return true; |
return true; |
| 740 |
} |
} |
| 741 |
|
|
| 742 |
function createDirectory ($dir) { |
function setPermissions ($fileSysObject) { |
| 743 |
if (file_exists($dir)) { |
if (file_exists($fileSysObject)) { |
| 744 |
if (is_dir($dir)) return true; |
if (is_dir($fileSysObject)) $perms = mamboCore::get('mosConfig_dirperms'); |
| 745 |
else return false; |
else $perms = mamboCore::get('mosConfig_fileperms'); |
| 746 |
} |
if ($perms) { |
|
list($upDirectory, $count) = $this->containingDirectory($dir); |
|
|
if ($count > 1 AND !file_exists($upDirectory)) if (!$this->createDirectory($upDirectory)) return false; |
|
|
if (!is_dir($upDirectory)) return false; |
|
|
$dirperms = mamboCore::get('mosConfig_dirperms'); |
|
|
if ($dirperms) { |
|
| 747 |
$origmask = @umask(0); |
$origmask = @umask(0); |
| 748 |
$mode = octdec($dirperms); |
$mode = octdec($perms); |
| 749 |
|
@chmod($fileSysObject, $mode); |
| 750 |
|
@umask($origmask); |
| 751 |
} |
} |
|
else $mode = 0755; |
|
|
if (!@mkdir($dir, $mode )) $result = false; |
|
|
else { |
|
|
$result = true; |
|
|
@chmod ($dir, $mode); |
|
| 752 |
} |
} |
| 753 |
if (isset($origmask)) @umask($origmask); |
} |
| 754 |
|
|
| 755 |
|
function makeDirectory ($dir) { |
| 756 |
|
$perms = mamboCore::get('mosConfig_dirperms'); |
| 757 |
|
$origmask = @umask(0); |
| 758 |
|
if ($perms) $result = @mkdir($dir, octdec($perms)); |
| 759 |
|
else $result = @mkdir($dir, 0755); |
| 760 |
|
if ($result) $this->setPermissions($dir); |
| 761 |
|
@umask($origmask); |
| 762 |
return $result; |
return $result; |
| 763 |
} |
} |
| 764 |
|
|
| 765 |
|
|
| 766 |
|
function createDirectory ($dir, $onlyCheck=false) { |
| 767 |
|
if (file_exists($dir)) { |
| 768 |
|
if (is_dir($dir) AND is_writable($dir)) return true; |
| 769 |
|
else return false; |
| 770 |
|
} |
| 771 |
|
list($upDirectory, $count) = $this->containingDirectory($dir); |
| 772 |
|
if ($count > 1 AND !file_exists($upDirectory) AND !($result = $this->createDirectory($upDirectory, $onlyCheck))) return false; |
| 773 |
|
if ($onlyCheck AND isset($result)) return true; |
| 774 |
|
if (!is_dir($upDirectory) OR !is_writable($upDirectory)) return false; |
| 775 |
|
if ($onlyCheck) return true; |
| 776 |
|
else return $this->makeDirectory($dir); |
| 777 |
|
} |
| 778 |
|
|
| 779 |
function containingDirectory ($dir) { |
function containingDirectory ($dir) { |
| 780 |
$dirs = preg_split('*[/|\\\]*', $dir); |
$dirs = preg_split('*[/|\\\]*', $dir); |
| 781 |
for ($i = count($dirs)-1; $i >= 0; $i--) { |
for ($i = count($dirs)-1; $i >= 0; $i--) { |
| 783 |
unset($dirs[$i]); |
unset($dirs[$i]); |
| 784 |
if ($text) break; |
if ($text) break; |
| 785 |
} |
} |
| 786 |
return array(implode('/',$dirs), count($dirs)); |
$result2 = count($dirs); |
| 787 |
|
$result1 = implode('/',$dirs).($result2 > 1 ? '' : '/'); |
| 788 |
|
return array($result1, $result2); |
| 789 |
} |
} |
| 790 |
|
|
| 791 |
|
function simpleCopy ($from, $to) { |
| 792 |
|
if (@copy($from, $to)) { |
| 793 |
|
$this->setPermissions($to); |
| 794 |
|
return true; |
| 795 |
|
} |
| 796 |
|
else return false; |
| 797 |
|
} |
| 798 |
|
|
| 799 |
function forceCopy ($from, $to) { |
function forceCopy ($from, $to) { |
| 800 |
$todir = dirname($to); |
$todir = dirname($to); |
| 802 |
if (!file_exists($todir)) return false; |
if (!file_exists($todir)) return false; |
| 803 |
$name = basename($from); |
$name = basename($from); |
| 804 |
$this->deleteFile($to.$name); |
$this->deleteFile($to.$name); |
| 805 |
return @copy($from, $to); |
return $this->simpleCopy ($from, $to); |
| 806 |
} |
} |
| 807 |
|
|
| 808 |
function lightCopy ($from, $to) { |
function lightCopy ($from, $to) { |
| 811 |
$todir = dirname($to); |
$todir = dirname($to); |
| 812 |
if (!file_exists($todir)) $this->createDirectory($todir); |
if (!file_exists($todir)) $this->createDirectory($todir); |
| 813 |
if (!file_exists($todir)) return false; |
if (!file_exists($todir)) return false; |
| 814 |
return @copy($from, $to); |
return $this->simpleCopy ($from, $to); |
| 815 |
|
} |
| 816 |
|
|
| 817 |
|
function acceptCopy ($to) { |
| 818 |
|
$todir = dirname($to); |
| 819 |
|
return $this->createDirectory($todir, true); |
| 820 |
} |
} |
| 821 |
|
|
| 822 |
|
|
| 1174 |
function menuCheck( $Itemid, $menu_option, $task, $gid ) { |
function menuCheck( $Itemid, $menu_option, $task, $gid ) { |
| 1175 |
// Construct a link to this component - if no menu for it, assume it is OK |
// Construct a link to this component - if no menu for it, assume it is OK |
| 1176 |
$dblink="index.php?option=$menu_option"; |
$dblink="index.php?option=$menu_option"; |
| 1177 |
|
// if ($menu_option == 'com_content' AND $Itemid == 1) return true; |
| 1178 |
if ($this->getIDLikeLink($dblink) == 0) return true; |
if ($this->getIDLikeLink($dblink) == 0) return true; |
| 1179 |
if ($Itemid) { |
if ($Itemid) { |
| 1180 |
$menu =& $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 2536 |
$act = strtolower(mosGetParam($_REQUEST, 'act', '')); |
$act = strtolower(mosGetParam($_REQUEST, 'act', '')); |
| 2537 |
$section = mosGetParam($_REQUEST, 'section', ''); |
$section = mosGetParam($_REQUEST, 'section', ''); |
| 2538 |
$no_html = strtolower(mosGetParam($_REQUEST, 'no_html', '')); |
$no_html = strtolower(mosGetParam($_REQUEST, 'no_html', '')); |
| 2539 |
|
$cid = (array) mosGetParam( $_POST, 'cid', array() ); |
| 2540 |
|
|
| 2541 |
ini_set('session.use_trans_sid', 0); |
ini_set('session.use_trans_sid', 0); |
| 2542 |
ini_set('session.use_cookies', 1); |
ini_set('session.use_cookies', 1); |