Jump to content

Get user resource limits?


MarkEliasen

Recommended Posts

Hi Everyone

 

I have been searching around but without luck (most likely because I am not sure exactly what to search for), but I am looking for a way to get the resource limits (space + bandwidth) from the user who's running WHMCS (eg. their reseller account limits).

 

Any way this is possible either via WHMCS or the WHM API?

 

Any directions on how to achieve this would be greatly appreciated!

 

Thanks :)

Link to comment
Share on other sites

Theres a disklimit and bwlimit database field in tblhosting. That may be what you need. Otherwise, its fairly easy to grab these values using the WHM API.

 

It is not for the individual users but for the admin/owner of the WHMCS.

I have been looking at the WHM API, but I am just staring myself bind, any directions on which API calls to make?

 

Thanks :)!

Link to comment
Share on other sites

This should be what you're looking for, assuming you're trying to get the values for a specific reseller:

 

http://etwiki.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/ListResellersAccountsInformation

 

Oh, I believe that is exactly what I am after.. not sure how I could have missed it.

 

This now leads me to my second question, can I use the WHM API through WHMCS or do I need to do it "myself" in the module I am trying to make?

 

Sorry I have only just started WHMCS module development, am I am just interested in what could be considered "best practise" hehe :).

 

I really appreciate you help!

Edited by MarkEliasen
Link to comment
Share on other sites

Well, that all depends on what you want to do with the information. Where are you trying to display it? Are you looking to just have some kind of dashboard widget to display their limits/usage?

 

I want to display my limits and current usage on the admin font page as a widget, just so I can keep an eye on when to expand :).

Edited by MarkEliasen
Link to comment
Share on other sites

I'd like to see this info also, just like the account stats available in 4x versions of WHMCS. In each resellers WHMCS info, on the package page (Usage Statistics). Currently for resellers it shows:

 

Disk Usage: 0 MB, Disk Limit: Unlimited MB, BW Usage: 0 MB, BW Limit: Unlimited MB

That isn't right, obviously.

 

For hosted accounts, these values are pulled from Cpanel/WHM and helps see issues sooner.

Link to comment
Share on other sites

I'm feeling charitable today, See attached.

 

Like any other widget, you'll need to enable it in the Administrator Roles.

 

You. Are. A. Star!

 

Thank you very much! :), I really appreciate you help!

Will give this a swing in an hour when I get a little time off :)

Edited by MarkEliasen
Link to comment
Share on other sites

I'd like to see this info also, just like the account stats available in 4x versions of WHMCS. In each resellers WHMCS info, on the package page (Usage Statistics). Currently for resellers it shows:

 

Disk Usage: 0 MB, Disk Limit: Unlimited MB, BW Usage: 0 MB, BW Limit: Unlimited MB

That isn't right, obviously.

 

For hosted accounts, these values are pulled from Cpanel/WHM and helps see issues sooner.

 

Yeah, for accounts, I believe its updated daily via cron (which updates the database fields), but there is no global usage statistic for the reseller (or root user, even).

 

The widget I attached I was only able to test with root credentials, but I believe it should work fine for resellers as well. When viewing as root it displays "0" for both BW and storage limits for obvious reasons, but for resellers it should show the actual values.

 

Maybe Matt can include this (or something like it) in a future version of WHMCS?

Link to comment
Share on other sites

Yeah, for accounts, I believe its updated daily via cron (which updates the database fields), but there is no global usage statistic for the reseller (or root user, even).

 

The widget I attached I was only able to test with root credentials, but I believe it should work fine for resellers as well. When viewing as root it displays "0" for both BW and storage limits for obvious reasons, but for resellers it should show the actual values.

 

Maybe Matt can include this (or something like it) in a future version of WHMCS?

 

It does not seem to work on my installation of WHMCS for some reason... I'll give it a few more tests and see what is happening.

 

This is the result I get back: object(SimpleXMLElement)[3]

nothing more than that.

 

Anyway, will let you know what happens - Appreciate the help !

Link to comment
Share on other sites

It does not seem to work on my installation of WHMCS for some reason... I'll give it a few more tests and see what is happening.

 

This is the result I get back: object(SimpleXMLElement)[3]

nothing more than that.

 

Anyway, will let you know what happens - Appreciate the help !

 

weird, it should work. You copied the includes/cpanel_xmlapi.php file right?

 

You might want to add a var_dump on the api call variable to see what its actually returning.

Link to comment
Share on other sites

I'd like to see this info also, just like the account stats available in 4x versions of WHMCS. In each resellers WHMCS info, on the package page (Usage Statistics). Currently for resellers it shows:

 

Disk Usage: 0 MB, Disk Limit: Unlimited MB, BW Usage: 0 MB, BW Limit: Unlimited MB

That isn't right, obviously.

Its showing the assigments to "their" account (rather than for their whole reseller a/c)

- a known/reported bug to WHMCS which still isnt fixed :(

Link to comment
Share on other sites

weird, it should work. You copied the includes/cpanel_xmlapi.php file right?

 

You might want to add a var_dump on the api call variable to see what its actually returning.

 

I did yes, the var_dump() just output: object(SimpleXMLElement)[3]

 

However I do believe it is something to do with my WHM account, and not the script itself as even WHMCS cannot create new accounts apparently.

 

I'll let you know what happens :)

Link to comment
Share on other sites

Its showing the assigments to "their" account (rather than for their whole reseller a/c)

In my case that doesn't seem to be what it's doing. No reseller has those specs and usage. They definitely have an account on the server they're installed on, and it uses space and bandwidth, just no stats are shown about it. Maybe just how mine is set up...

Link to comment
Share on other sites

It also depends on who "owns" their account (root, reseller, a-n-other-user) - the way we have it setup is that WHMCS by default shows the resellers own account, and then we cron overwriting that with the right values for the "whole" reseller

They do own their own, and it shows as above. I'd be interested in learning how you're getting it to show the reseller values via cron.

Link to comment
Share on other sites

The reason it didn't work for me was because I am not allowed to use that API with my current host, oh well :). I will be moving to my own dedicated hopefully soon, so that should take care of things (though then it obviously wouldn't be useful for me to use that call... oh well)

 

Thanks :)

 

Well that would certainly explain things. :)

Link to comment
Share on other sites

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