<?php
function only_reg($link = NULL){
	global $user;

if(!isset($user)){

if($link==NULL){
	$link=H.'aut.php?'.SID;
	}

header("Location: $link");
exit;
}
}

function only_unreg($link = NULL){
	global $user;

if(isset($user)){

if($link==NULL){
	$link=H.'index.php?'.SID;
	}

header("Location: $link");
exit;
}
}

function only_level($level=0,$link = NULL){
	global $user;

if(!isset($user) || $user['level']<$level){

if($link==NULL){
	$link='/index.php?'.SID;
	}

header("Location: $link");
exit;
}
}
?>