Quote( $position ) . "\n AND m.client_id = 1" ; $database->setQuery( $query ); return $database->loadResult(); } /** * Loads admin modules via module position * @param string The position * @param int 0 = no style, 1 = tabbed */ function mosLoadAdminModules( $position='left', $style=0 ) { global $database, $acl, $my; $cache =& mosCache::getCache( 'com_content' ); $query = "SELECT id, title, module, position, content, showtitle, params" . "\n FROM #__modules AS m" . "\n WHERE m.published = 1" . "\n AND m.position = " . $database->Quote( $position ) . "\n AND m.client_id = 1" . "\n ORDER BY m.ordering" ; $database->setQuery( $query ); $modules = $database->loadObjectList(); if($database->getErrorNum()) { echo "MA ".$database->stderr(true); return; } switch ($style) { case 1: // Tabs $tabs = new mosTabs(1); $tabs->startPane( 'modules-' . $position ); foreach ($modules as $module) { $params = new mosParameters( $module->params ); $editAllComponents = $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' ); // special handling for components module if ( $module->module != 'mod_components' || ( $module->module == 'mod_components' && $editAllComponents ) ) { $tabs->startTab( $module->title, 'module' . $module->id ); if ( $module->module == '' ) { mosLoadCustomModule( $module, $params ); } else { mosLoadAdminModule( substr( $module->module, 4 ), $params ); } $tabs->endTab(); } } $tabs->endPane(); break; case 2: // Div'd foreach ($modules as $module) { $params = new mosParameters( $module->params ); echo '
| ' . $module->content . ' | '; echo '
| Please make cache directory writable. | '; echo '
| '; echo $feed_title .' | '; echo '
| '. $feed_descrip .' | '; echo '
| '; echo $item_title .' - '. $text .' | '; echo '
";
if ($withLineNums) {
$txt .= "";
$txt .= str_replace( ' ', ' ', sprintf( "%4d:", $ln ) );
$txt .= "";
}
$txt .= "$line
";
$ln++;
}
return $txt;
}
function mosIsChmodable($file) {
$perms = fileperms($file);
if ( $perms !== FALSE ) {
if (@chmod($file, $perms ^ 0001)) {
@chmod($file, $perms);
return TRUE;
} // if
}
return FALSE;
} // mosIsChmodable
/**
* @param string An existing base path
* @param string A path to create from the base path
* @param int Directory permissions
* @return boolean True if successful
*/
function mosMakePath($base, $path='', $mode = NULL) {
global $mosConfig_dirperms;
// convert windows paths
$path = str_replace( '\\', '/', $path );
$path = str_replace( '//', '/', $path );
// ensure a clean join with a single slash
$path = ltrim( $path, '/' );
$base = rtrim( $base, '/' ).'/';
// check if dir exists
if (file_exists( $base . $path )) return true;
// set mode
$origmask = NULL;
if (isset($mode)) {
$origmask = @umask(0);
} else {
if ($mosConfig_dirperms=='') {
// rely on umask
$mode = 0777;
} else {
$origmask = @umask(0);
$mode = octdec($mosConfig_dirperms);
} // if
} // if
$parts = explode( '/', $path );
$n = count( $parts );
$ret = true;
if ($n < 1) {
if (substr( $base, -1, 1 ) == '/') {
$base = substr( $base, 0, -1 );
}
$ret = @mkdir($base, $mode);
} else {
$path = $base;
for ($i = 0; $i < $n; $i++) {
// don't add if part is empty
if ($parts[$i]) {
$path .= $parts[$i] . '/';
}
if (!file_exists( $path )) {
if (!@mkdir(substr($path,0,-1),$mode)) {
$ret = false;
break;
}
}
}
}
if (isset($origmask)) {
@umask($origmask);
}
return $ret;
}
function mosMainBody_Admin() {
echo $GLOBALS['_MOS_OPTION']['buffer'];
}
/*
* Added 1.0.11
*/
function josSecurityCheck($width='95%') {
$wrongSettingsTexts = array();
if ( ini_get('magic_quotes_gpc') != '1' ) {
$wrongSettingsTexts[] = 'PHP magic_quotes_gpc setting is `OFF` instead of `ON`';
}
if ( ini_get('register_globals') == '1' ) {
$wrongSettingsTexts[] = 'PHP register_globals setting is `ON` instead of `OFF`';
}
if ( RG_EMULATION != 0 ) {
$wrongSettingsTexts[] = 'Joomla! "Register Globals Emulation" setting is `ON`. To disable Register Globals Emulation, navigate to Site -> Global Configuration -> Server, select `OFF`, and save.
Register Globals Emulation is `ON` by default for backward compatibility.';
}
if ( count($wrongSettingsTexts) ) {
?>
Following PHP Server Settings are not optimal for Security and it is recommended to change them:
-
Please check the Official Joomla! Server Security post for more information.