#1 (permalink)  
Old 06-25-2008, 06:35 AM
Registered User
 
Join Date: Jan 2004
Posts: 51
monaghan
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-25-2008, 10:49 AM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
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).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-25-2008, 11:27 AM
Registered User
 
Join Date: Jan 2004
Posts: 51
monaghan
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-25-2008, 04:20 PM
cpanelnick's Avatar
cPanel Staff
 
Join Date: Feb 2003
Location: Houston, TX
Posts: 4,303
cpanelnick is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-25-2008, 04:57 PM
Registered User
 
Join Date: Jan 2004
Posts: 51
monaghan
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:35 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc