Get current active domain and all domains

Maniak

Verified User
Joined
Aug 25, 2004
Messages
220
Location
Switzerland
I am working on a template plugin (not a third-party but a replacement) to integrate Zimbra within DirectAdmin skin.

I am looking for a way to:

  • List current active domain
  • List the whole list of domains within one account

This will be necessary to susbtitute the current email system.
So far, my only guess is to parse /home/{USERNAME}/domains for the whole list, but this seems to me like a dirty hack.

Somebody got a more elegant way of doing so?
However, this won't tell me the current active domains (if the account has more than 1 domain).

Gregory
 

Maniak

Verified User
Joined
Aug 25, 2004
Messages
220
Location
Switzerland
Thanks.
Calling CMD_API_SHOW_USER_DOMAINS / CMD_API_SHOW_DOMAINS would indeed allow me to make an array to check if the domain is valid.

However, I cannot find a solution to get the "currently selected domain" if a user has got more than one. That for sure needs to be taken from the DirectAdmin session, but it seems like there's no such option available http://help.directadmin.com/item.php?id=289 here..
 

Maniak

Verified User
Joined
Aug 25, 2004
Messages
220
Location
Switzerland
Hello,

As per http://www.directadmin.com/features.php?id=1410, you should be able to grab the "currently selected domain" with this token:
Code:
|SESSION_SELECTED_DOMAIN|
But before DA 1.43.0, the domain variable is just passed around between all URLs via "GET".

John
Thanks John, works brilliantly.
I cannot seem to get hold the whole list of tokens, is there an up-to-date list somewhere?
Last but not least, is there a way to get the whole list of domains within one account other than using the DirectAdmin API?

Thanks.

Gregory
 
Top