DennisHermannsen Posted July 31, 2020 Share Posted July 31, 2020 Hi. I'm currently building a module for WHMCS that allows clients to see a list of all logins and a list of unique logins. In the table that shows unique logins, the client has an option to prevent a certain IP from logging in to the client's account. I just need a way to force WHMCS to prevent the user from logging in. Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
0 brian! Posted July 31, 2020 Share Posted July 31, 2020 7 minutes ago, DennisHermannsen said: I just need a way to force WHMCS to prevent the user from logging in. Any ideas? I assume adding that IP to the Banned IP list is too global a solution and might cause issues as this check needs to be on a per client basis. can you use a ClientLogin hook, get the user details, e.g whether it's a client/contact, get their IP and then check a table for this client/contact and IP address combination? if found, then redirect them to logout.php ?? 0 Quote Link to comment Share on other sites More sharing options...
0 DennisHermannsen Posted July 31, 2020 Author Share Posted July 31, 2020 I figured it out after some googling: Session::delete("uid"); Session::delete("cid"); Session::delete("upw"); Cookie::delete("User"); Source: shhhhhhh Oddly enough, there's no official documentation on this 😛 0 Quote Link to comment Share on other sites More sharing options...
0 brian! Posted July 31, 2020 Share Posted July 31, 2020 9 minutes ago, DennisHermannsen said: Source: shhhhhhh oh I know the resource of which you speak - it can often be an enlightening source. 💡 0 Quote Link to comment Share on other sites More sharing options...
0 bear Posted July 31, 2020 Share Posted July 31, 2020 34 minutes ago, brian! said: oh I know the resource of which you speak - it can often be an enlightening source Dang it. I'm clueless, as usual. 0 Quote Link to comment Share on other sites More sharing options...
0 string Posted July 31, 2020 Share Posted July 31, 2020 You could also just delete the session content: add_hook('ClientLogin', 1, function($vars) { // if... then: $_SESSION = array (); }); 3 hours ago, DennisHermannsen said: Source: shhhhhhh 😂 0 Quote Link to comment Share on other sites More sharing options...
0 Kian Posted August 1, 2020 Share Posted August 1, 2020 17 hours ago, string said: You could also just delete the session content Exactly, just unset($_SESSION['uid']); 0 Quote Link to comment Share on other sites More sharing options...
Question
DennisHermannsen
Hi.
I'm currently building a module for WHMCS that allows clients to see a list of all logins and a list of unique logins.
In the table that shows unique logins, the client has an option to prevent a certain IP from logging in to the client's account.
I just need a way to force WHMCS to prevent the user from logging in. Any ideas?
Link to comment
Share on other sites
6 answers to this question
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.