<?php
/**
*
* @package ppkBB3cker
* @version $Id: tanotself1.php 1.000 2009-03-02 19:45:00 PPK $
* @copyright (c) 2008, 2009 PPK
* http://ppkbb3cker.rx22.ru, http://protoneutron.narod.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

	if(!function_exists('get_trestricts'))
	{
		include($tincludedir.'trestricts.'.$phpEx);
	}

	if (!$rights[2] && ($ppkbb_tcwait_time || $ppkbb_tcwait_time2))
	{
		if ($left > 0)
		{
			$elapsed = intval(($dt - $user['added']) / 3600);
			$wait=get_trestricts($user['user_uploaded'], $user['user_downloaded'], $userratio, $ppkbb_tcwait_time, 'up');
			if ($wait > 0 && $elapsed < $wait)
			{
				err("Bad Ratio OR Upload (" . ($wait - $elapsed) . "h) - Wait Time!");
			}
			else if($wait==0)
			{
				err("Bad Ratio OR Upload, You Can't Download This Torrent");
			}
			$wait2=get_trestricts($user['user_uploaded'], $user['user_downloaded'], $userratio, $ppkbb_tcwait_time2);
			if ($wait2 > 0 && $elapsed < $wait2)
			{
				err("Bad Ratio OR Download (" . ($wait2 - $elapsed) . "h) - Wait Time!");
			}
			else if($wait2==0)
			{
				err("Bad Ratio OR Download, You Can't Download This Torrent");
			}			
		}
	}

	if(!$rights[9])
	{
		if($user['req_upload'] && ($user['user_uploaded'] < ($user['req_upload'] * 1024 * 1024 * 1024) || !$user['user_uploaded']))
		{
			err("Sorry, Bad Upload Value, Required (Gb.): ".$user['req_upload']);
		}
	}

	if(!$rights[10])
	{
		if($user['req_ratio']!=0.000 && $userratio!='None.' && ($userratio < $user['req_ratio'] || $userratio=='Leech.' || $userratio=='Inf.'))
		{
			err("Sorry, Bad Ratio Value, Required: ".$user['req_ratio']);
		}
	}
?>