#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "proto.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif

#define WEBPORT 7003
#define MOBILPORT 7012
#define MOBILPORTT 7033

DLLFUNC int m_portkoru(aClient *acptr);

ModuleHeader MOD_HEADER(m_portkoruma)
  = {
	"Modul: m_portkoruma.c",
	"Port Koruma Modulu",
	"QBilisim.Com",
	"3.2-b8-1",
	NULL 
    };

DLLFUNC int MOD_INIT(m_portkoruma)(ModuleInfo *modinfo)
{	
	HookAddEx(modinfo->handle, HOOKTYPE_PRE_LOCAL_CONNECT, m_portkoru);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}

DLLFUNC int MOD_LOAD(m_portkoruma)(int module_load)
{
	return MOD_SUCCESS;
}

DLLFUNC int MOD_UNLOAD(m_portkoruma)(int module_unload)
{
	return MOD_SUCCESS;
}

DLLFUNC int m_portkoru(aClient *acptr)
{
	if (WEBPORT == acptr->listener->port && !IsCGIIRC(acptr))
	return exit_client(acptr, acptr, acptr, "Lutfen web sohbet sayfamizdan giris yapiniz.");
		if (MOBILPORTT == acptr->listener->port && !IsCGIIRC(acptr))
	return exit_client(acptr, acptr, acptr, "Lutfen mobil sohbet sayfamizdan giris yapiniz.");
	if (MOBILPORT == acptr->listener->port && !IsCGIIRC(acptr))
	return exit_client(acptr, acptr, acptr, "Lutfen mobil sohbet sayfamizdan giris yapiniz.");

	return 0;
}
