diff --git a/README.md b/README.md index cbf0236..10a941c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,71 @@ # Whmcs-Force-Email-Verify -Simple Script to Force your Clients To Verify Emails and Prevent Spam Orders. +Simple Script For Whmcs to Force your Clients To Verify Emails and Prevent Spam Orders. (Whmcs V8 Compatible) + +## Preview +Force-Email-Verification + +## Steps to Install: + +1. Download the Script +2. Edit the Script as Per Your Need. +3. Now Go to /includes/hooks , Then Upload the Script there. + +## Code: + +``` +isEmailAddressVerified()==false) + { + // message + return array("You must first verify your email address before completing any order"); + } + } + } +}); + +# Deactivate unverified account after x days +add_hook("DailyCronJob", 1, function($vars){ + if (intval(DEACTIVATEACCOUNTAFTERXDAYS)!==0){ + $dateCreated = date("Y-m-d", strtotime("now - ".intval(DEACTIVATEACCOUNTAFTERXDAYS)." days")); + $getAccounts = Capsule::table("tblclients")->where("datecreated", "=", $dateCreated)->where("email_verified", "=", 0); + foreach ($getAccounts->get() as $account){ + Capsule::table("tblclients")->where("id", $account->id)->update(array("status" => "Inactive")); + } + } +}); + +# Close unverified accounts after X days +add_hook("DailyCronJob", 1, function($vars){ + if (intval(CLOSEACCOUNTAFTERXDAYS)!==0){ + $dateCreated = date("Y-m-d", strtotime("now - ".intval(CLOSEACCOUNTAFTERXDAYS)." days")); + $getAccounts = Capsule::table("tblclients")->where("datecreated", "=", $dateCreated)->where("email_verified", "=", 0); + foreach ($getAccounts->get() as $account){ + Capsule::table("tblclients")->where("id", $account->id)->update(array("status" => "Closed")); + } + } +}); + +``` + +Note : This Script will Work Only if you Enabled Email verification in WHMCS Settings.