#1 (permalink)  
Old 05-04-2009, 07:12 PM
Registered User
 
Join Date: Mar 2009
Posts: 11
k_shehadeh is on a distinguished road
Question Email::listpopswithdisk and multiple domains

I'm trying to understand why my primary user on a WHM server is unable to get a listing of a domain in a separate account. I think I don't understand the different relationships between users and WHM accounts. Here's the situation:

I have a WHM account with a user "user1". In this WHM account there are two cPanel accounts (sorry if I'm using the wrong words here). The first is for domain "mydomain1.com" and the second is for "mydomain2.com". The primary user for the "mydomain1.com" account is "user1" and the primary user for the "mydomain2.com" account is "user2".

So:

WHM Account >> "user1"
"mydomain1.com" >> "user1"
"mydomain2.com" >> "user2"

Now, I'm using the Email::listpopswithdisk to try and retrieve email accounts for a domain. The problem is when I login as "user1" with the API and try to retrieve email accounts for "mydomain2.com", I get nothing back. This kind of makes since that account is owned by "user2". But what confuses me then is why one of the arguments for this API call is "domain" when the logged in user can apparently only access the domain of their own account (even if the user is the WHM account holder).

I know this is a convoluted question but I can't think of a better way to ask it. Any help getting me to understand would be very much appreciated.

Thanks,
Karim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-05-2009, 09:51 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by k_shehadeh View Post
I'm trying to understand why my primary user on a WHM server is unable to get a listing of a domain in a separate account. I think I don't understand the different relationships between users and WHM accounts. Here's the situation:

I have a WHM account with a user "user1". In this WHM account there are two cPanel accounts (sorry if I'm using the wrong words here). The first is for domain "mydomain1.com" and the second is for "mydomain2.com". The primary user for the "mydomain1.com" account is "user1" and the primary user for the "mydomain2.com" account is "user2".

So:

WHM Account >> "user1"
"mydomain1.com" >> "user1"
"mydomain2.com" >> "user2"

Now, I'm using the Email::listpopswithdisk to try and retrieve email accounts for a domain. The problem is when I login as "user1" with the API and try to retrieve email accounts for "mydomain2.com", I get nothing back. This kind of makes since that account is owned by "user2". But what confuses me then is why one of the arguments for this API call is "domain" when the logged in user can apparently only access the domain of their own account (even if the user is the WHM account holder).

I know this is a convoluted question but I can't think of a better way to ask it. Any help getting me to understand would be very much appreciated.

Thanks,
Karim
Even though you are logging in as the reseller user (user1), which cPanel user are you passing to the XML API (via the user= URL parameter) when attempting to retrieve the email accounts for user2?
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-05-2009, 10:57 AM
Registered User
 
Join Date: Mar 2009
Posts: 11
k_shehadeh is on a distinguished road
Thanks for the response. To answer your question, it doesn't seem to matter what the "user" parameter is - I don't even have to supply a user and I still get back the email accounts associated with the authenticated user (as opposed to the one in the url parameter list).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-05-2009, 11:07 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by k_shehadeh View Post
Thanks for the response. To answer your question, it doesn't seem to matter what the "user" parameter is - I don't even have to supply a user and I still get back the email accounts associated with the authenticated user (as opposed to the one in the url parameter list).
Are you using the XML API over a WHM port (2087 or 2086) or a cPanel port (2083 or 2082)?
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-05-2009, 11:08 AM
Registered User
 
Join Date: Mar 2009
Posts: 11
k_shehadeh is on a distinguished road
Over a cPanel port. I thought i had to since I'm using an API2 call. No?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-05-2009, 11:23 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by k_shehadeh View Post
Over a cPanel port. I thought i had to since I'm using an API2 call. No?
The XML API can be used over the WHM ports even for API2 calls.

When you use the cPanel ports, you will only be able to access things for the cPanel user you are logged in as. However, with using the WHM ports, you can login as a reseller and then get information about the cPanel accounts that are under your reseller account.
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-05-2009, 12:15 PM
Registered User
 
Join Date: Mar 2009
Posts: 11
k_shehadeh is on a distinguished road
Okay, that worked. Thanks! When using the WHM port, I *had* to specify a user as a URL parameter. Is there a way to retrieve all email accounts across all WHM accounts with a single call?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-05-2009, 12:24 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by k_shehadeh View Post
Okay, that worked. Thanks! When using the WHM port, I *had* to specify a user as a URL parameter. Is there a way to retrieve all email accounts across all WHM accounts with a single call?
As this is an API1/API2 call, this needs to be done for each individual cPanel user. However you could probably use the XML API's listaccts function to get a list of all cPanel accounts for that reseller and then loop through each account to get the information you need for every WHM account owned by that reseller.
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-05-2009, 12:26 PM
Registered User
 
Join Date: Mar 2009
Posts: 11
k_shehadeh is on a distinguished road
Okay, yeah. That's what I figured. Thanks again!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
api2

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 11:44 AM.


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