Jump to content

Changing client's status from Inactive to Active through hooks


notdonski

Recommended Posts

I've been trying to find a way to change client's status from Inactive to Active without going through the admin panel. I looked through the API and there doesn't seem to be a way to do it. Is it safe to just update the status in tblclients? Anything else I should do/consider?

 

Thank you.

Link to comment
Share on other sites

Anything else I should do/consider?

remember to check your automation settings too - otherwise the cron might undo what you are changing the next time it runs.

 

http://docs.whmcs.com/Automation_Settings#Client_Status_Update

 

WHMCS automatically sets clients with no active products/services to Inactive status, this helps you to distinguish and filter clients effectively. However you can stop WHMCS from doing this by changing this setting. More information on this feature is available in Client Management.

 

Disabled - The status of a client will not be changed automatically

Change client status based on active/inactive products - If a client has no active or suspended products/services then their account will automatically be set to Inactive status when the cron job next runs.

Change client status based on active/inactive products and not logged in for longer than 3 months - In addition to the above option, a client's account will only be set to inactive when their last login date was over 3 months ago.

Link to comment
Share on other sites

Thank you for your replies.

 

- - - Updated - - -

 

remember to check your automation settings too - otherwise the cron might undo what you are changing the next time it runs.

 

http://docs.whmcs.com/Automation_Settings#Client_Status_Update

 

Thanks, I'm aware of this. What I'm trying to achieve is actually to counter this, without waiting for next cron run to re-enable the client.

Link to comment
Share on other sites

  • 2 weeks later...
What's the best way to tell if a client's status has been changed to Inactive by the cron job? It doesn't seem to trigger the ClientEdit event/hook unfortunately.

I would have thought one way would be to check the 'updated_at' value in the tblclients table and see if the time is close to when your cron would run, or perhaps easier to query the activity log as that will likely show a change in client status.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated