This is an old revision of the document!
Plugin Version | 0.0.6 |
---|---|
Author | Laurent Declercq l.declercq@nuxwin.com |
License | GPLv2 |
i-MSCP compatibility version | >= 1.0.2.0 (No released version) |
Last Update | 2012-02-06 |
The demo plugin for i-MSCP allow to setup an i-MSCP demo server in few minutes. It allow to:
The dialog box is only displayed if you provide a set of configuration parameters that describe user accounts. The plugin configuration file contains a simple PHP associative array (See the sample below).
To describe an user account, you must add a new section like below in the configuration file:
... 'user_accounts' => array( array( 'label' => 'Administrator 1', 'username' => 'admin1', 'password' => 'admin1', 'protected' => true ) ) ...
Note: User accounts are show in dialog box only if they exists in the i-MSCP database.
If an user account has the protected option set to TRUE (as above), it will be protected against deletion, and password modification.
The plugin allows to disable some actions such as 'addFtp', 'EditFtp', 'DeleteFtp'. The action names are same as event names dispatched in i-MSCP code. Only the onBefore* actions are supported since the others are not really relevant in the demo plugin context. You can see all integrated events by reading the iMSCP_Events class.
To disable one or more actions, you must add a new section like below in the plugin configuration file:
... 'disabled_actions' => array( 'onBeforeAddFtp', 'onBeforeEditFtp', 'onBeforeDeleteFtp', 'onBeforeAddSqlUser', 'onBeforeEditSqlUser', 'onBeforeDeleteSqlUser', 'onBeforeAddSqlDb', 'onBeforeDeleteSqlDb' ) ...
A configuration file for the demo plugin can be:
<?php return array( /* List of user accounts that will be available via select box on login page. If an user account is protected, it will be imposible to remove it. Also, its password will be protected against modification. */ 'user_accounts' => array( array( 'label' => 'Administrator 1', 'username' => 'admin1', 'password' => 'admin1', 'protected' => true ), array( 'label' => 'Reseller 1', 'username' => 'reseller1', 'password' => 'reseller1', 'protected' => true ) ), /* List of actions that must be totally disabled. Each action must be prefixed by 'onBefore' */ 'disabled_actions' => array( 'onBeforeAddFtp', 'onBeforeEditFtp', 'onBeforeDeleteFtp', 'onBeforeAddSqlUser', 'onBeforeEditSqlUser', 'onBeforeDeleteSqlUser', 'onBeforeAddSqlDb', 'onBeforeDeleteSqlDb' ) );
This file live in the gui/plugins/Demo directory and is named config.php.
To activate the plugin, you must configure it and edit the /etc/imscp.conf to set the 'DEMO_SERVER' variable to 1.
Feel free to test it and report any bugs or suggestions for improvement.