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

if(!isConnected()){
	header('Location:401.php');
	goto end;
}
$messageData = getMessage();
if($messageData == -1){
	header('Location:404.php');
	goto end;
}
if(getAdminLevel()<6 && $_SESSION['session_id'] != $messageData['senderID']){
	header('Location:403.php');
	goto end;
}
removeMessage();
header('Location:discut.php?d=' . $messageData['discussion_id']);
end: