inyerface Posted February 23, 2016 Share Posted February 23, 2016 I created an action hook (almost) that will force clients to agree to new terms of service (on login) before being able to continue to client area. I created a new column under "tblclients" called "tosversion" (which is type "date" instead of a version number) and that gets updated no problem when the client logs in. The only problem is displaying a page or popup that displays the TOS before this field is updated. Sam as when there is an available update to WHMCS. the code: <?php $updateddate = "2016-02-16"; function hook_tos_clientlogin($vars) { /// CHANGE YOUR TOS VERSION $updatedtosversion="2016-02-16"; $clientid = $vars['userid']; if (!filter_var($clientid, FILTER_VALIDATE_INT)) { return; } $tbl="tblclients"; $fields = "tosversion"; $where = array("id"=>$clientid); $result = select_query($tbl,$fields,$where); $data = mysql_fetch_array($result); $ctosversion = $data['tosversion']; if ($ctosversion < $updatedtosversion) { //we don't match, do something. // make sure we update at the end of this $update = array("tosversion"=>"$updatedtosversion"); $where2 = array("id"=>"$clientid"); update_query($tbl,$update,$where2); } else { //just a courtesy else } } add_hook("ClientLogin",1,"hook_tos_clientlogin"); ?> Can someone write the rest, or quote me on a module to do this? Module interests me since we can set it so we can copy and paste the new TOS and when published, users are forced to agree to those new terms. Thanks 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 23, 2016 Share Posted February 23, 2016 Please contact me here for further discussion about your requirements and quote 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.