ACC SHELL

Path : /srv/www/vhosts/petrikov/admin/
File Upload :
Current File : /srv/www/vhosts/petrikov/admin/index.php

<?php
	require "./mysql_connect.php";
	
	$action = ( isset( $_GET[ "action" ] ) )?$_GET[ "action" ]:"index";

	require "./is_login.php";

	require "./functions.php";

	require "../smarty/Smarty.class.php";

	$smarty = new Smarty;
	$smarty->template_dir = "../smarty/templates/";
	$smarty->compile_dir = "../smarty/templates_c/";
	$smarty->config_dir = "../smarty/configs/";
	$smarty->cache_dir = "../smarty/cache/";

	function message( $message, $config = FALSE ) {
		global $smarty;
		$smarty->assign( "message", $message );
		if ( $config )
		{
			$smarty->assign( "config", "true" );
		}
		else
		{
			$smarty->assign( "config", "false" );
		}
		$smarty->display( 'admin/message.tpl' );
	}

	$smarty->assign( 'title', $action );
	$smarty->assign( 'user', $_SESSION[ 'user' ] );
	$smarty->display( 'admin/header.tpl' );
	
	if ( file_exists( "pages/". $_SESSION[ "user" ]. "/$action.php" ) ) {
		require "./pages/". $_SESSION[ "user" ]. "/$action.php";
	} elseif ( $action == "logout" ) {
		@session_destroy;
		$_SESSION = array();
		header ( "Location: index.php" );
	} elseif ( $action == "index" ) {
		echo "<p>Vítejte v administraci.</p>\n";
	} else {
		message( "Omlouváme se, ale požadovaná stránka není dostupná<br />\n"
			 ."Informujte o tom prosím systémového administrátora\n" );
	}

	$smarty->display('admin/footer.tpl');
?>

ACC SHELL 2018