<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/

if($_GET['action'] == "display") {
	if(isfileadmin($userID)) {
		echo 'currently not available';
	}
}
else {
  if($userID) $run=1;
  else {
  	$CAPCLASS = new Captcha;	
		if($CAPCLASS->check_captcha($_POST['captcha'], $_POST['captcha_hash'])) $run=1;
	}

	if($_POST['mode'] AND $run) {
		$mode = $_POST['mode'];
		$type = $_POST['type'];
		$info = $_POST['description'];
		$id = $_POST['id'];
		
		if($info) {
			$info = clearfromtags($info);
		} else $info = 'no informations available';
		$date = time();
		
		$message = '[b]There is a new '.$mode.' - Report[/b][br][br]'.$type.'-ID: '.$id.'[br]Info: '.$info.'[br]Referer: [url]index.php?site=files&file='.$id.'[/url]';
		
		//send message to file-admins
				
		$ergebnis=safe_query("SELECT userID FROM ".PREFIX."user_groups WHERE files='1'");
		while($ds=mysql_fetch_array($ergebnis)) sendmessage($ds[userID], $type.': '.$mode, $message);

		redirect("index.php?site=".$type, "Your report was recognized. Thank you.", "3");
	}
}
?>