gcphost Posted June 9, 2011 Share Posted June 9, 2011 Hi WHMCS users! Here is my most recent hook! It is designed to suspend packages ordered by users in certain countries, defined by an array. A user orders a product defined in an array inside the hook The users IP address and Country is validated against a list of countrys to deny activation If the users country is in the list the hook will suspend the users product & notify both the user and admin It is a very simple hook and requires minor configuration to operate correctly. $url = ""; # URL to WHMCS , no trailing slash $urlapi = ""; # URL to WHMCS API file $username = ""; # Admin username goes here $password = ""; # Admin password goes here $packagenum=array("2"); # Array of the packages to validate on $banned=array("ru", "ro" ,"us"); # Array of lower case country codes to validate on The $packagenum should contain an array of packages you want to validate, for example, package #2 for me is a Free Trial package The $banned should contain an array of country codes, lower case, that match the WHMCS profile fields & the iptolocation fields (they are standard codes), example - ru, ro, us, au, de If there are more questions about the config please reply, everything else seems standard. Installing: Download the database script @ http://gamecp.com/iptocountry.sql Import the table to your WHMCS database Configure the validate_country.php with a list of packages and countrys to ban Upload the validate_country.php file to your hooks folder Enjoy! If you find this useful send me a donation! gcphost AT gmail DOT com via PayPal - or email me - as I accept many forms of payment. validate_country.zip 0 Quote Link to comment Share on other sites More sharing options...
gcphost Posted June 10, 2011 Author Share Posted June 10, 2011 Please use the revised file here, I failed to realize some of the setting variables seem to conflict with the user login system of WHMCS (oops!) - updating the names has fixed the issue. $plug_banned=array("ru", "ro"); $plug_url = ""; # URL to WHMCS API file $plug_urlapi = ""; # URL to WHMCS API file $plug_username = ""; # Admin username goes here $plug_password = ""; # Admin password goes here $plug_packagenum=array("2"); validate_country.zip 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.