User Tools

Site Tools


plugins:demo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
plugins:demo [2012/02/04 15:51]
nuxwin Created documentation for i-MSCP demo plugin
plugins:demo [2014/02/23 09:44] (current)
nuxwin
Line 1: Line 1:
-=====i-MSCP ​Demo Plugin =====+=====Demo Plugin=====
  
-====== ​Version Info ====== +======REQUIREMENTS======
-^Plugin Version | 0.0.5| +
-^i-MSCP compatibility version | >= 1.0.2.0| +
-^Last Update ​  ​|03.02.2012|+
  
-======Introduction======+  * i-MSCP >1.1.0
  
-The demo plugin ​for i-MSCP ​allow to setup an i-MSCP demo server in few minutes.+======INTRODUCTION====== 
 + 
 +The demo plugin allow to setup an i-MSCP demo server in few minutes.
 It allow to: It allow to:
  
Line 15: Line 14:
   - Provide an actions list that must be disabled   - Provide an actions list that must be disabled
  
-=====I. Plugin configuration=====+=====CONFIGURATION=====
  
-====A. Modal dialog box on login page====+====Modal dialog box on login page====
  
-The dialog box is only displayed ​if you provide a set of configuration that describes ​user accounts. The plugin configuration file format is a simple PHP associative array (//See the sample below//).+The dialog box is only shown 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 section like below in the configuration file: +To describe an user account, you must add a new section like below in the configuration file:
-<code php> +
-... +
- '​user_accounts'​ => array( +
- array( +
- '​label'​ => '​Administrator 1', +
- '​username'​ => '​admin1',​ +
- '​password'​ => '​admin1',​ +
- '​protected'​ => true +
-+
-+
-... +
-</​code>​+
  
-**Note:** User accounts are show in dialog box only if they exists in the i-MSCP database.+  ... 
 +  '​user_accounts'​ => array( 
 +  array( 
 +  '​label'​ => '​Administrator 1', 
 +  '​username'​ => '​admin1',​ 
 +  '​password'​ => '​admin1',​ 
 +  '​protected'​ => true 
 +  ) 
 +  ) 
 +  ...
  
-====BProtection against deletion and password modification (Demo users)====+**Note:** User accounts are shown 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 deletionand password modification.+====Protection ​against deletion and password modification ​(Demo users)====
  
-====CDisabled actions====+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 [[https://​github.com/​i-MSCP/​imscp/​blob/​master/​gui/​library/​iMSCP/​Events.php|iMSCP_Events]] class.+====Disabled actions==== 
 + 
 +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 [[https://​github.com/​i-MSCP/​imscp/​blob/​master/​gui/​library/​iMSCP/​Events.php|iMSCP_Events]] class.
  
 To disable one or more actions, you must add a new section like below in the plugin configuration file: To disable one or more actions, you must add a new section like below in the plugin configuration file:
  
-<code php+  ... 
-... +  '​disabled_actions'​ =array( 
- '​disabled_actions'​ => array( +  ​ '​onBeforeAddFtp',​ 
- '​onBeforeAddFtp',​ +  '​onBeforeEditFtp',​ 
- '​onBeforeEditFtp',​ +  '​onBeforeDeleteFtp',​ 
- '​onBeforeDeleteFtp',​ +  '​onBeforeAddSqlUser',​ 
- '​onBeforeAddSqlUser',​ +  '​onBeforeEditSqlUser',​ 
- '​onBeforeEditSqlUser',​ +  '​onBeforeDeleteSqlUser',​ 
- '​onBeforeDeleteSqlUser',​ +  '​onBeforeAddSqlDb',​ 
- '​onBeforeAddSqlDb',​ +  '​onBeforeDeleteSqlDb'​ 
- '​onBeforeDeleteSqlDb'​ +  ) 
-+  ​... 
-... + 
-</code>+ 
 +====Configuration file sample==== 
 + 
 +A configuration file for the demo plugin can be: 
 + 
 +  // Configuration file sample for the demo plugin 
 +   
 +  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'​ => '​Administrator 2', 
 +  '​username'​ => '​admin2',​ 
 +  '​password'​ => '​admin2',​ 
 +  '​protected'​ => true 
 +  ), 
 +  array( 
 +  '​label'​ => '​Administrator 3', 
 +  '​username'​ => '​admin3',​ 
 +  '​password'​ => '​admin3',​ 
 +  '​protected'​ => true 
 +  ), 
 +  array( 
 +  '​label'​ => '​Reseller 1', 
 +  '​username'​ => '​reseller1',​ 
 +  '​password'​ => '​reseller1',​ 
 +  '​protected'​ => true 
 +  ), 
 +  array( 
 +  '​label'​ => '​Reseller 2', 
 +  '​username'​ => '​reseller2',​ 
 +  '​password'​ => '​reseller2',​ 
 +  '​protected'​ => true 
 +  ), 
 +  array( 
 +  '​label'​ => '​Reseller 3', 
 +  '​username'​ => '​reseller3',​ 
 +  '​password'​ => '​reseller3',​ 
 +  '​protected'​ => true 
 +  ), 
 +  array( 
 +  '​label'​ => '​Customer 1', 
 +  '​username'​ => '​domain1.tld',​ 
 +  '​password'​ => '​domain1',​ 
 +  '​protected'​ => true 
 +  ), 
 +  array( 
 +  '​label'​ => '​Customer 2', 
 +  '​username'​ => '​domain2.tld',​ 
 +  '​password'​ => '​domain2',​ 
 +  '​protected'​ => true 
 +  ), 
 +  array( 
 +  '​label'​ => '​Customer 3', 
 +  '​username'​ => '​domain3.tld',​ 
 +  '​password'​ => '​domain3',​ 
 +  '​protected'​ => true 
 +  ) 
 +  ), 
 +   
 +  // List of actions that must be totally disabled. Each action must be prefixed by '​onBefore'​ 
 +  // 
 +  // Important consideration:​ 
 +  // Even if you add the '​onBeforeDeactivatePlugin'​ in the list below, you'll still able to deactivate this plugin. 
 +  // The only way to protect this plugin against deactivation is to protect it using the plugin protection feature. 
 +  '​disabled_actions'​ => array( 
 +  ​ '​onBeforeEditAdminGeneralSettings',​ 
 +  '​onBeforeAddUser',​ 
 +  '​onBeforeEditUser',​ 
 +  '​onBeforeDeleteUser',​ 
 +  '​onBeforeDeleteCustomer',​ 
 +  '​onBeforeAddFtp',​ 
 +   '​onBeforeEditFtp',​ 
 +   '​onBeforeDeleteFtp',​ 
 +   '​onBeforeAddSqlUser',​ 
 +   '​onBeforeEditSqlUser',​ 
 +   '​onBeforeDeleteSqlUser',​ 
 +   '​onBeforeAddSqlDb',​ 
 +   '​onBeforeDeleteSqlDb', 
 +  '​onBeforeUpdatePluginList',​ 
 +  '​onBeforeInstallPlugin',​ 
 +  '​onBeforeUninstallPlugin',​ 
 +  '​onBeforeEnablePlugin',​ 
 +  '​onBeforeDisablePlugin',​ 
 +  '​onBeforeUpdatePlugin',​ 
 +  '​onBeforeDeletePlugin',​ 
 +  '​onBeforeProtectPlugin',​ 
 +  '​onBeforeAddDomain',​ 
 +  '​onBeforeEditDomain',​ 
 +  '​onBeforeAddSubdomain',​ 
 +  '​onBeforeEditSubdomain',​ 
 +  '​onBeforeDeleteSubdomain',​ 
 +  '​onBeforeAddDomainAlias',​ 
 +  '​onBeforeEditDomainAlias',​ 
 +  '​onBeforeDeleteDomainAlias',​ 
 +  '​onBeforeAddMail',​ 
 +  '​onBeforeEditMail',​ 
 +  '​onBeforeDeleteMail',​ 
 +  '​onBeforeAddExternalMailServer',​ 
 +  '​onBeforeChangeDomainStatus
 +  
 +  ); 
 + 
 +This file live in the [[https://​github.com/​i-MSCP/​imscp/​tree/​master/​gui/​plugins/​Demo|gui/​plugins/​Demo]] directory and is named [[https://​github.com/​i-MSCP/​imscp/​blob/​master/​gui/​plugins/​Demo/​config.php|config.php]]
 + 
 +=====ACTIVATION===== 
 + 
 +To activate the plugin, you must in order: 
 + 
 +  - configure it by editing the plugins/Demo/​config.php configuration file 
 +  - go to the plugin management interface 
 +  - cick on the **Update Plugins** button 
 +  - click on the activate icone.  
 + 
 +**Important**
  
-To resumea configuration file for the demo plugin ​can be:+In production environmentthis plugin ​must be protected against deactivation. For this, you must protect it by clicking on the **protect** icone in the plugin management interface.
  
-<code php> +=====DEACTIVATION=====
-<?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 +
-+
- ),+
  
- /* +First, if the plugin is protected, you must edit the **gui/data/​persistent/​protected_plugins.php*file to remove it from the list of protected pluginsAfter, you will be able to deactivate it by clicking on the **deactivate** icone in the plugin management interface.
- List ​of actions that must be totally disabledEach action must be prefixed ​by '​onBefore'​ +
- *+
- '​disabled_actions'​ => array( +
- '​onBeforeAddFtp',​ +
- '​onBeforeEditFtp',​ +
- '​onBeforeDeleteFtp',​ +
- '​onBeforeAddSqlUser',​ +
- '​onBeforeEditSqlUser',​ +
- '​onBeforeDeleteSqlUser',​ +
- '​onBeforeAddSqlDb',​ +
- '​onBeforeDeleteSqlDb'​ +
-+
-); +
-</​code>​+
  
-This file live in the [[https://​github.com/​i-MSCP/​imscp/​tree/​master/​gui/​plugins/​Demo|gui/​plugins/​Demo]] directory and is named [[https://​github.com/​i-MSCP/​imscp/​blob/​master/​gui/​plugins/​Demo/​demo_config.php|demo_config.php]].+=====LICENSE=====
  
-=====IIPlugin activation=====+  Copyright (C) 2010-2014 by Laurent Declercq [email protected] 
 +   
 +  This program is free software; you can redistribute it and/or modify it under 
 +  the terms of the GNU General Public License as published by the Free Software  
 +  Foundation; version 2 of the License 
 +   
 +  This program is distributed in the hope that it will be useful, but WITHOUT 
 +  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 +  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  
-To activate the plugin, you must just configure it and edit the **/​etc/​imscp.conf** and set the '​**DEMO_SERVER**'​ variable to **1**.+=====AUTHORS=====
  
-Feel free to test it and report any bugs or suggestions for improvement.+  * Laurent Declercq <l.[email protected]>​
/var/www/virtual/i-mscp.net/wiki/htdocs/data/attic/plugins/demo.1328370677.txt.gz · Last modified: 2012/02/04 15:51 by nuxwin