PDA

View Full Version : API Command to read additional domains only



hostpc.com
08-10-2005, 06:19 PM
We're looking for a way to read additional domain names added by a customer.

For instance, customer is initially setup with

xyz.com <- set as master domain

then adds

123.com
321.com

I'm trying to find a way to read JUST the "non master" domains. Is that possible?

Thanks

Joe

jmstacey
08-10-2005, 10:52 PM
I don't think this can be done soley through the existing API.

Some options:
If you have a db, file, etc. of some sort that keeps track of each users primary domain you can get a list of all domains and just remove the domain from the list that corresponds to that user. Just keep in mind that users can change their default/primary domain now.

You could use the public_html link found in their home directory to determine the primary domain since it usually always points to it.

Write your own api/wrapper that would read DirectAdmin's data files and determine which domain is the default.

the public_html link would probably be the easiest dynamic way.

lapo
10-17-2005, 03:24 PM
Originally posted by jmstacey
I don't think this can be done soley through the existing API.

Some options:
.....

You could use the public_html link found in their home directory to determine the primary domain since it usually always points to it.

Write your own api/wrapper that would read DirectAdmin's data files and determine which domain is the default.

the public_html link would probably be the easiest dynamic way.

Actually, I'm pretty sure that the public_html link points to the MOST RECENT created domain in an account, NOT the default one.

jmstacey
10-17-2005, 08:27 PM
By default the default (pun?)domain is always set to the most recent domain added, however you can change the default domain from the Domain Administration page.

lapo
10-18-2005, 07:47 AM
Without falling into a discussion on semantics, I was just trying to point out that the public_html symlink is an unreliable way to determine what the original poster was trying to find out. ;)