<?php
    
	if(!$dprotect) die ('Access Denied!');
	
	if($link[1] == 'logout' && $core->logoutUser()) {
		header('Location: '.$config['url'].'admin');
		exit();
	}
	
	if($core->checkLogedIn()) {
		if($link[1] && file_exists('modules/admin/'.$link[1].'.php')) {
			include('modules/admin/'.$link[1].'.php');
		} else {
			include('modules/admin/index.php');
		}
	} else {
		if($_POST['action'] == 'login' && $core->loginUser($_POST['login'], $_POST['password'])) {
			header('Location: '.$config['url'].'admin');
			exit();
		}
	}
	
?>