* +------------------------------------+
*
* InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
public:
- ModuleGeoIP(InspIRCd *Me) : Module(Me)
- {
- OnRehash(NULL, "");
+ ModuleGeoIP() {
+ OnRehash(NULL);
Implementation eventlist[] = { I_OnRehash, I_OnUserRegister };
ServerInstance->Modules->Attach(eventlist, this, 2);
virtual Version GetVersion()
{
- return Version("$Id$", VF_VENDOR, API_VERSION);
+ return Version("Provides a way to restrict users by country using GeoIP lookup", VF_VENDOR, API_VERSION);
}
- virtual void OnRehash(User* user, const std::string ¶meter)
+ virtual void OnRehash(User* user)
{
GeoBans.clear();
- ConfigReader conf(ServerInstance);
+ ConfigReader conf;
banunknown = conf.ReadFlag("geoip", "banunknown", 0);
}
}
- virtual int OnUserRegister(User* user)
+ virtual ModResult OnUserRegister(User* user)
{
/* only do lookups on local users */
if (IS_LOCAL(user))
ServerInstance->Users->QuitUser(user, "Could not identify your country of origin. Access denied.");
}
}
- return 0;
+ return MOD_RES_PASSTHRU;
}
};