Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    51

    Default xml-api/accountsummary

    I use this function to query whether I can use an account name during the creation process of an external application.

    When I query as root this reports an account, however when run as a reseller, it only returns a value if the account is owned by the reseller, if the account name is taken by another reseller it returns nothing and we then get an error when attempting to create an account.

    Is it possible for this to return an indicator that the account name is in use but not give out details or is there another function I can call to validate an account name or to generate a valid one from the domain name or some other string?

    Whilst I can run as root on the servers we manage, some of our customers are resellers on other suppliers servers, so I need a solution that will work at the reseller level.

    I could just keep creating new usernames and running the createaccount function until it doesn't fail, but that's not very nice code
    Alex Monaghan, Monaghan Consultants Ltd
    www.monaghan.co.uk - IT / Database consultancy
    www.www-hoster.com - International web hosting
    www.diyhosting.co.uk - Quality budget web hosting

  2. #2
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    The XML-API uses the same functionality available within WHM. If a reseller is unable to view all accounts within WHM then likewise the reseller cannot use the XML-API to view all accounts.

    What is likely needed for this scenario is a function: usernameexists which simply returns true (1) or false (0).

  3. #3
    Member
    Join Date
    Jan 2004
    Posts
    51

    Default

    Quote Originally Posted by cpanelkenneth View Post
    What is likely needed for this scenario is a function: usernameexists which simply returns true (1) or false (0).
    That sounds ideal, as you're staff, will you pop that in the suggestion box?

    Any idea what current billing systems do? Do they just loop until they get an acceptable account name?
    Alex Monaghan, Monaghan Consultants Ltd
    www.monaghan.co.uk - IT / Database consultancy
    www.www-hoster.com - International web hosting
    www.diyhosting.co.uk - Quality budget web hosting

  4. #4
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,514

    Default

    Quote Originally Posted by monaghan View Post
    That sounds ideal, as you're staff, will you pop that in the suggestion box?

    Any idea what current billing systems do? Do they just loop until they get an acceptable account name?
    You could just call the xml-api function to listaccounts and then exclude all those usernames.
    -Nick
    cPanel Inc.

    Need support? Submit a request here. These forums are not an official support channel.

  5. #5
    Member
    Join Date
    Jan 2004
    Posts
    51

    Default

    Wouldn't the list accounts function also be limited to the reseller's view of things?
    Alex Monaghan, Monaghan Consultants Ltd
    www.monaghan.co.uk - IT / Database consultancy
    www.www-hoster.com - International web hosting
    www.diyhosting.co.uk - Quality budget web hosting

Similar Threads & Tags
Similar threads

  1. XML API 2 help
    By Dragonxito in forum cPanel Developers
    Replies: 1
    Last Post: 05-13-2011, 05:23 PM
  2. XML-API is any of these possible?
    By neo4242002 in forum cPanel Developers
    Replies: 3
    Last Post: 03-17-2008, 02:46 PM
  3. Problem whith XML API accountsummary
    By eugui in forum cPanel Developers
    Replies: 2
    Last Post: 02-13-2008, 08:46 AM
  4. XML API: always get login screen, not XML
    By sldff3ald in forum cPanel Developers
    Replies: 3
    Last Post: 09-19-2007, 10:29 AM
  5. How do I use the xml - api?
    By rhopperger in forum cPanel Developers
    Replies: 3
    Last Post: 05-19-2007, 09:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube