<?php
session_start();
include_once 'includes/inter.php';

if(!isConnected()){
	header('Location:403.php');
	goto end;
}else if(!discutExists()){	header ( 'Location:40A.php' );	goto end;}else if(preg_match("#^p$#",$disc['autorized']) || (preg_match("#^a[0-9]+$#",$disc['autorized']))?substr($disc['autorized'],1)<=$adminLevel:FALSE || preg_match('#^x([0-9];)*' . $_SESSION['session_id'] . '(;[0-9])*$#',$disc['autorized']) || $adminLevel>=14){
	header('Location:401.php');
	goto end;
}

sendMessage();

header('Location:discut.php?d='.$_GET['d']);
end: