DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

Ability to add plugins since 1.22

| 18:56:40 21.11.2010
Ability to add plugins without needing to change the skin for each update.  

http://www.directadmin.com/forum/showthread.php?s=&postid=18334#post18334

Plugins will be placed in:
/usr/local/directadmin/plugins

Each plugin will have a name (go figure :) ) ... inside that:  (eg. plug_name)

/usr/local/directadmin/plugins/plug_name

inside the plug_name directory, we'll have a plugin.conf file with the following (example):

name=Hello World
id=hello_world
author=JBMC-Software
version=1.0
update_url=http://www.directadmin.com/hello_world.tar.gz
active=yes
installed=yes

Most of it is self explanatory, but the update_url, if you have it in that file will allow DA to update the script when the admin clicks an "update" button in the plugins manager page.  active=yes or no would be to turn it on and off.installed=yes or no would be to figure out if it's been installed yet.(or uninstalled)

inside the plug_name directory will be 4 directories:

user
reseller
admin
images

inside those directories will store the actual files to be viewed.  The output of those files should only be html snippets as they will be inserted into an |OUTPUT| token on a plugins.html page in the skin.    Users will only be able to access the files that are available at their level.  user, reseller, and admin must have an index.html file with the html snippet code for DA to start with when viewing the plugin at the respective access level.  The images directory will store images.

The files for the plugin (index.html etc).. but be executable (755) by the user calling it (user logged into da).  They must be scripts with the proper interpreter lines at the top, eg:
#!/usr/local/bin/php

DA will not tokenize these scripts so all data is passed via the environment.

All output on the stdout is inserted into the |OUTPUT| token on the skins page.   No data from the strerr will be retrieved.  The return value of the script isn't not checked, so errors should be directed to the stdout.

There are no file_user.conf files like in the skins. The plugins system will allow files to be accessed directly, eg:

domain.com:2222/CMD_PLUGINS/plug_name/index.html

SKINS:
admin/content_main.html:
|PLUGIN_0_ADMIN_TXT|
|PLUGIN_1_ADMIN_TXT|
|PLUGIN_2_ADMIN_TXT|
|PLUGIN_3_ADMIN_TXT|
OR for image based skins with icons:
|PLUGIN_0_ADMIN_IMG|
|PLUGIN_1_ADMIN_IMG|
|PLUGIN_2_ADMIN_IMG|
|PLUGIN_3_ADMIN_IMG|

reseller/content_main.html
|PLUGIN_0_RESELLER_IMG|
...
|PLUGIN_0_RESELLER_TXT|
...

user/show_domain.html or user/show_domain_advanced.html
|PLUGIN_0_IMG|
|PLUGIN_1_IMG|
...

or

|PLUGIN_0_TXT|
|PLUGIN_1_TXT|
...

Those tokens will be added add global tokens, so you can really add them anywhere.


files_user.conf
CMD_PLUGINS=user/plugin.html

see included skins for details.. main token: |OUTPUT|
Tags: Information 
About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition