Exemple #1
0
    }
}
/** get the information about the current user from the sessions table */
$my = $mainframe->getUser();
/** detect first visit */
$mainframe->detect();
$gid = intval($my->gid);
// gets template for page
$cur_template = $mainframe->getTemplate();
/** temp fix - this feature is currently disabled */
/** @global A places to store information from processing of the component */
$_MOS_OPTION = array();
// precapture the output of the component
require_once $mosConfig_absolute_path . '/editor/editor.php';
ob_start();
if ($path = $mainframe->getPath('front')) {
    $task = mosGetParam($_REQUEST, 'task', '');
    $ret = mosMenuCheck($Itemid, $option, $task, $gid);
    if ($ret) {
        require_once $path;
    } else {
        mosNotAuth();
    }
} else {
    echo _NOT_EXIST;
}
$_MOS_OPTION['buffer'] = ob_get_contents();
ob_end_clean();
initGzip();
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
Exemple #2
0
    $database->setQuery("SELECT * FROM #__session" . "\nWHERE session_id='{$session_id}'");
    if (!($result = $database->query())) {
        echo $database->stderr();
    }
    if ($database->getNumRows($result) != 1) {
        echo "<script>document.location.href='index.php'</script>\n";
        exit;
    }
} else {
    echo "<script>document.location.href='{$mosConfig_live_site}/administrator/index.php'</script>\n";
    exit;
}
// update session timestamp
$current_time = time();
$database->setQuery("UPDATE #__session SET time='{$current_time}'" . "\nWHERE session_id='{$session_id}'");
$database->query();
// timeout old sessions
$past = time() - 1800;
$database->setQuery("DELETE FROM #__session WHERE time < '{$past}'");
$database->query();
// start the html output
if ($no_html) {
    if ($path = $mainframe->getPath("admin")) {
        require $path;
    }
    exit;
}
initGzip();
$path = $mosConfig_absolute_path . "/administrator/templates/" . $mainframe->getTemplate() . "/index.php";
require_once $path;
doGzip();
Exemple #3
0
// initialise some common request directives
$act = strtolower(mosGetParam($_REQUEST, 'act', ''));
$section = mosGetParam($_REQUEST, 'section', '');
$no_html = intval(mosGetParam($_REQUEST, 'no_html', 0));
$id = intval(mosGetParam($_REQUEST, 'id', 0));
$cur_template = $mainframe->getTemplate();
// default admin homepage
if ($option == '') {
    $option = 'com_admin';
}
// set for overlib check
$mainframe->set('loadOverlib', false);
// precapture the output of the component
require_once $mosConfig_absolute_path . '/editor/editor.php';
ob_start();
if ($path = $mainframe->getPath('admin')) {
    require_once $path;
} else {
    ?>
	<img src="images/joomla_logo_black.jpg" border="0" alt="<?php 
    echo 'Joomla! Logo';
    ?>
" />
	<br />
	<?php 
}
$_MOS_OPTION['buffer'] = ob_get_contents();
ob_end_clean();
initGzip();
// start the html output
if ($no_html == 0) {
Exemple #4
0
     }
 }
 $_SESSION['session_id'] = $session_id;
 $_SESSION['session_user_id'] = $my->id;
 $_SESSION['session_username'] = $my->username;
 $_SESSION['session_usertype'] = $my->usertype;
 $_SESSION['session_gid'] = $my->gid;
 $_SESSION['session_logintime'] = $logintime;
 $_SESSION['session_user_params'] = $my->params;
 $_SESSION['session_userstate'] = array();
 session_write_close();
 $expired = 'index2.php';
 // check if site designated as a production site
 // for a demo site disallow expired page functionality
 if ($_VERSION->SITE == 1 && @$mosConfig_admin_expired === '1') {
     $file = $mainframe->getPath('com_xml', 'com_users');
     $params =& new mosParameters($my->params, $file, 'component');
     $now = time();
     // expired page functionality handling
     $expired = $params->def('expired', '');
     $expired_time = $params->def('expired_time', '');
     // if now expired link set or expired time is more than half the admin session life set, simply load normal admin homepage
     $checktime = ($mosConfig_session_life_admin ? $mosConfig_session_life_admin : 1800) / 2;
     if (!$expired || $now - $expired_time > $checktime) {
         $expired = 'index2.php';
     }
     // link must also be a Joomla link to stop malicious redirection
     if (strpos($expired, 'index2.php?option=com_') !== 0) {
         $expired = 'index2.php';
     }
     // clear any existing expired page data