Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Recording client area logins in WHMCS

DamianDamian Member
edited May 2013 in Providers

Here's a hook to record WHMCS client area logins, along with IP address and RDNS host:

https://github.com/damianharouff/whmcshook-recordlogin

Put it into yourWHMCSdir/includes/hooks/ and it should begin showing logins under the Log tab on the client's profile. Example:

image

If you don't like the name of the file or function having "ipxcore" in it, feel free to change to whatever you'd like.

Also, thanks to @serverian for helping me with a hurr-durr problem with it before release.

Comments

  • shovenoseshovenose Member, Host Rep
    edited May 2013


    Thanks, it's useful :)

  • Awesome stuff.

    Where is that thanks button :-)

  • SpiritSpirit Barred
    edited May 2013

    Interesting (from the client point of view). So WHMCS by default don't record clients logging into billing system? I would expect something like this implemented into any online billing system since beginning.

  • @Spirit said: Interesting (from the client point of view). I would expect something like this implemented into any online billing system since beginning.

    WHMCS only logs the initial sign up IP and the last login IP. I guess this would be useful if a client account was compromised etc.

  • SpiritSpirit Barred
    edited May 2013

    @GetKVM_Ash said: I guess this would be useful if a client account was compromised etc.

    Yes, exactly. For both, host and client. Even gmail record account activity with IPs. I would really expect from WHMCS this data stored and available atleast to host by default.

  • DamianDamian Member

    @Spirit said: I would expect something like this implemented into any online billing system since beginning.

    Me too!

    @GetKVM_Ash said: I guess this would be useful if a client account was compromised etc.

    That's actually why we started doing it: a client asked for a list of all the IPs that had logged into his WHMCS account, and we didn't have it available.

  • mnpeepmnpeep Member

    This is why I love @Damian. Thanks!

    Max

  • SpiritSpirit Barred
    edited May 2013

    @Damian is this possible to enable also for clients or too complicated? Something like gmail "Activity on this account" feature do. It's one of those lists I check regulary.

  • jarjar Patron Provider, Top Host, Veteran

    I love you.

  • BoltersdriveerBoltersdriveer Member, LIR

    Thank you for this hook! :)

  • Thanks Damian.

    Tonight I will give you a reward.

  • DamianDamian Member

    @Spirit said: @Damian is this possible to enable also for clients or too complicated? Something like gmail "Activity on this account" feature do. It's one of those lists I check regulary.

    Probably... would probably be best to change the "User" field or something easily searchable, since the activity log contains a lot of information that's not really interesting. Here's an example of a new client's activity log:

    image

  • qpsqps Member, Host Rep

    @Damian - thanks!

  • SpiritSpirit Barred

    @Damian yeah, that's a lot of (for clients) irrelevant data. Anyway, useful hook - if I would be host I would want to have something like this in my whmcs for sure.

  • Thanks! Neat hook

  • SkylarMSkylarM Member

    oh I love you ;)

  • I think i have already suggested this in the Features Request of WHMCS. WHMCS should also log more information, like Domain Contacts Info changes, Nameservers Changes, etc.

  • NoermanNoerman Member

    WTFPL – Do What the Fuck You Want to Public License

    Just know this type of license

  • kbeeziekbeezie Member
    edited May 2013

    I'm just a tiny bit confused (outside of the RDNS part), doesn't WHMCS for a while have "recent client activity" on the front of the page with user name, IP address, and last access date/time?

    But as others have said, having the ability to see what their actual last activity was, would be kind of nice.

  • DamianDamian Member

    @kbeezie said: I'm just a tiny bit confused (outside of the RDNS part), doesn't WHMCS for a while have "recent client activity" on the front of the page with user name, IP address, and last access date/time?

    It does, but it only shows the last five logins, and you can't see a history of logins by a specific client. This bridges that gap.

  • @Damian: I love you.

  • fhnericfhneric Member

    If you check the logs, it tells you when clients login.

  • DamianDamian Member

    Yes, that's what's displayed in the Log tab after you add my hook, as depicted in the image above.

  • If your WHMCS is behind CloudFlare, change line 9 from:

       $ipaddress =  $_SERVER['REMOTE_ADDR'];

    to:

       $ipaddress =  $_SERVER["HTTP_CF_CONNECTING_IP"];
  • bdtechbdtech Member
    edited June 2013
  • DamianDamian Member
    edited June 2013

    You could actually extend it to work either way:

    if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $ipaddress = $_SERVER['HTTP_CF_CONNECTING_IP']; } else if (isset($_SERVER['REMOTE_ADDR'])) { $ipaddress = $_SERVER['REMOTE_ADDR']; }

    (edit) The formatting on 'new' Vanilla is brain damaged. Seriously, what kind of application thinks that newlines shouldn't be newlines?

  • bdtechbdtech Member
    edited June 2013

    @Damian I highly recommend going the nginx real_ip route ... speed, efficiency, global usage, log file IPs, and security.

Sign In or Register to comment.