Get domain in plugin

AE86

Verified User
Joined
Apr 10, 2011
Messages
22
I'm working at a plugin but having trouble to get the domainname of the current user level.
I tried two different syntaxes but they didn't work. I tried:
- <?=$domain;?>
- |DOMAIN|

The <?=$domain;?> syntax is a syntax that I also saw in another plugin, so I'm a little bit questioned why it doesn't work.

Can someone explain this to me or redirect me to some FAQ or external URL with information about the possible internal commands when developing plugins?

Thank you in advance.
 
Last edited:
Thank you both for the answers.
The domain stored in session solved my problem. :)
 
I still don't fully get it. This variable is not always set so I run into some trouble on other servers where I can't get the domain from the session.

Is there a possibility to use tokens like "|SESSION_SELECTED_DOMAIN|" in plugin development? I can't seem to get it to work

For example I have got the file pluginname/hooks/user_txt.html with the following code:
<a href="/CMD_PLUGINS/pluginname&domain=|SESSION_SELECTED_DOMAIN|">Pluginname</a>

But that doesn't work. How can I get the tokens to work outside of the skins?

I'm sorry for all the questions, but I'm new to plugin development and can't seem to figure it out.
 
This variable is not always set so I run into some trouble on other servers where I can't get the domain from the session.

Are they all have an actual version of Directadmin?

By the way why don't get the current selected domain from a query request via $_SERVER?
 
I thought it was the latests Directadmin version, but it was not... I updated it and will test it tonight.
How can I get the current selected domain from a query request via $_SERVER? I'm not familiar with that.

Thank you for your replies.
 
Back
Top