User Tools

Site Tools


plugins:demo

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
plugins:demo [2014/02/23 09:26]
nuxwin [i-MSCP Demo Plugin]
plugins:demo [2014/02/23 09:35]
nuxwin [Disabled actions]
Line 1: Line 1:
-=====i-MSCP ​Demo=====+=====Demo ​Plugin=====
  
 ======Introduction====== ======Introduction======
  
-The demo plugin ​for i-MSCP ​allow to setup an i-MSCP demo server in few minutes.+The demo plugin allow to setup an i-MSCP demo server in few minutes.
 It allow to: It allow to:
  
Line 14: Line 14:
 ====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 parameters that describe user accounts. The plugin configuration file contains 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 new 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( +   '​user_accounts'​ => array( 
- array( +   array( 
- '​label'​ => '​Administrator 1', +   '​label'​ => '​Administrator 1', 
- '​username'​ => '​admin1',​ +   '​username'​ => '​admin1',​ 
- '​password'​ => '​admin1',​ +   '​password'​ => '​admin1',​ 
- '​protected'​ => true +   '​protected'​ => true 
- +  
-+  
-... +  ...
-</​code>​+
  
 **Note:** User accounts are shown in dialog box only if they exists in the i-MSCP database. **Note:** User accounts are shown in dialog box only if they exists in the i-MSCP database.
Line 34: Line 33:
 ====Protection against deletion and password modification (Demo users)==== ====Protection against deletion and password modification (Demo users)====
  
-If an user account has the protected option set to TRUE (as above), it will be protected against deletion, and password modification.+If an user account has the protected option set to TRUE (//as above//), it will be protected against deletion, and password modification.
  
 ====Disabled actions==== ====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.+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==== ====Configuration file sample====
Line 61: Line 59:
 A configuration file for the demo plugin can be: A configuration file for the demo plugin can be:
  
-<code php> +  ​// Configuration file sample for the demo plugin 
-<?php +   
-// 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 
-return array( +   // will be imposible to remove it. Also, its password will be protected ​ against modification. 
- // List of user accounts that will be available via select box on login page. If an user account is protected, it +   '​user_accounts'​ => array( 
- // will be imposible to remove it. Also, its password will be protected against modification. +   array( 
- '​user_accounts'​ => array( +   '​label'​ => '​Administrator 1', 
- array( +   '​username'​ => '​admin1',​ 
- '​label'​ => '​Administrator 1', +   '​password'​ => '​admin1',​ 
- '​username'​ => '​admin1',​ +   '​protected'​ => true 
- '​password'​ => '​admin1',​ +   ), 
- '​protected'​ => true +   array( 
- ), +   '​label'​ => '​Administrator 2', 
- array( +   '​username'​ => '​admin2',​ 
- '​label'​ => '​Administrator 2', +   '​password'​ => '​admin2',​ 
- '​username'​ => '​admin2',​ +   '​protected'​ => true 
- '​password'​ => '​admin2',​ +   ), 
- '​protected'​ => true +   array( 
- ), +   '​label'​ => '​Administrator 3', 
- array( +   '​username'​ => '​admin3',​ 
- '​label'​ => '​Administrator 3', +   '​password'​ => '​admin3',​ 
- '​username'​ => '​admin3',​ +   '​protected'​ => true 
- '​password'​ => '​admin3',​ +   ), 
- '​protected'​ => true +   array( 
- ), +   '​label'​ => '​Reseller 1', 
- array( +   '​username'​ => '​reseller1',​ 
- '​label'​ => '​Reseller 1', +   '​password'​ => '​reseller1',​ 
- '​username'​ => '​reseller1',​ +   '​protected'​ => true 
- '​password'​ => '​reseller1',​ +   ), 
- '​protected'​ => true +   array( 
- ), +   '​label'​ => '​Reseller 2', 
- array( +   '​username'​ => '​reseller2',​ 
- '​label'​ => '​Reseller 2', +   '​password'​ => '​reseller2',​ 
- '​username'​ => '​reseller2',​ +   '​protected'​ => true 
- '​password'​ => '​reseller2',​ +   ), 
- '​protected'​ => true +   array( 
- ), +   '​label'​ => '​Reseller 3', 
- array( +   '​username'​ => '​reseller3',​ 
- '​label'​ => '​Reseller 3', +   '​password'​ => '​reseller3',​ 
- '​username'​ => '​reseller3',​ +   '​protected'​ => true 
- '​password'​ => '​reseller3',​ +   ), 
- '​protected'​ => true +   array( 
- ), +   '​label'​ => '​Customer 1', 
- array( +   '​username'​ => '​domain1.tld',​ 
- '​label'​ => '​Customer 1', +   '​password'​ => '​domain1',​ 
- '​username'​ => '​domain1.tld',​ +   '​protected'​ => true 
- '​password'​ => '​domain1',​ +   ), 
- '​protected'​ => true +   array( 
- ), +   '​label'​ => '​Customer 2', 
- array( +   '​username'​ => '​domain2.tld',​ 
- '​label'​ => '​Customer 2', +   '​password'​ => '​domain2',​ 
- '​username'​ => '​domain2.tld',​ +   '​protected'​ => true 
- '​password'​ => '​domain2',​ +   ), 
- '​protected'​ => true +   array( 
- ), +   '​label'​ => '​Customer 3', 
- array( +   '​username'​ => '​domain3.tld',​ 
- '​label'​ => '​Customer 3', +   '​password'​ => '​domain3',​ 
- '​username'​ => '​domain3.tld',​ +   '​protected'​ => true 
- '​password'​ => '​domain3',​ +  
- '​protected'​ => true +   ), 
- +   
- ), +   // List of actions that must be totally disabled. Each action must be prefixed by '​onBefore'​ 
- +   // 
- // 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. 
- // Important consideration:​ +   // The only way to protect this plugin against deactivation is to protect it using the plugin protection feature. 
- // Even if you add the '​onBeforeDeactivatePlugin'​ in the list below, you'll still able to deactivate this plugin. +   '​disabled_actions'​ => array( 
- // The only way to protect this plugin against deactivation is to protect it using the plugin protection feature. +   '​onBeforeEditAdminGeneralSettings',​ 
- '​disabled_actions'​ => array( +   '​onBeforeAddUser',​ 
- '​onBeforeEditAdminGeneralSettings',​ +   '​onBeforeEditUser',​ 
- '​onBeforeAddUser',​ +   '​onBeforeDeleteUser',​ 
- '​onBeforeEditUser',​ +   '​onBeforeDeleteCustomer',​ 
- '​onBeforeDeleteUser',​ +   '​onBeforeAddFtp',​ 
- '​onBeforeDeleteCustomer',​ +   '​onBeforeEditFtp',​ 
- '​onBeforeAddFtp',​ +   '​onBeforeDeleteFtp',​ 
- '​onBeforeEditFtp',​ +   '​onBeforeAddSqlUser',​ 
- '​onBeforeDeleteFtp',​ +   '​onBeforeEditSqlUser',​ 
- '​onBeforeAddSqlUser',​ +   '​onBeforeDeleteSqlUser',​ 
- '​onBeforeEditSqlUser',​ +   '​onBeforeAddSqlDb',​ 
- '​onBeforeDeleteSqlUser',​ +   '​onBeforeDeleteSqlDb',​ 
- '​onBeforeAddSqlDb',​ +   '​onBeforeUpdatePluginList',​ 
- '​onBeforeDeleteSqlDb',​ +   '​onBeforeInstallPlugin',​ 
- '​onBeforeUpdatePluginList',​ +   '​onBeforeUninstallPlugin',​ 
- '​onBeforeInstallPlugin',​ +   '​onBeforeEnablePlugin',​ 
- '​onBeforeUninstallPlugin',​ +   '​onBeforeDisablePlugin',​ 
- '​onBeforeEnablePlugin',​ +   '​onBeforeUpdatePlugin',​ 
- '​onBeforeDisablePlugin',​ +   '​onBeforeDeletePlugin',​ 
- '​onBeforeUpdatePlugin',​ +   '​onBeforeProtectPlugin',​ 
- '​onBeforeDeletePlugin',​ +   '​onBeforeAddDomain',​ 
- '​onBeforeProtectPlugin',​ +   '​onBeforeEditDomain',​ 
- '​onBeforeAddDomain',​ +   '​onBeforeAddSubdomain',​ 
- '​onBeforeEditDomain',​ +   '​onBeforeEditSubdomain',​ 
- '​onBeforeAddSubdomain',​ +   '​onBeforeDeleteSubdomain',​ 
- '​onBeforeEditSubdomain',​ +   '​onBeforeAddDomainAlias',​ 
- '​onBeforeDeleteSubdomain',​ +   '​onBeforeEditDomainAlias',​ 
- '​onBeforeAddDomainAlias',​ +   '​onBeforeDeleteDomainAlias',​ 
- '​onBeforeEditDomainAlias',​ +   '​onBeforeAddMail',​ 
- '​onBeforeDeleteDomainAlias',​ +   '​onBeforeEditMail',​ 
- '​onBeforeAddMail',​ +   '​onBeforeDeleteMail',​ 
- '​onBeforeEditMail',​ +   '​onBeforeAddExternalMailServer',​ 
- '​onBeforeDeleteMail',​ +   '​onBeforeChangeDomainStatus'​ 
- '​onBeforeAddExternalMailServer',​ +  
- '​onBeforeChangeDomainStatus'​ +  );
-+
-); +
-</​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/​config.php|config.php]]. 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]].
/var/www/virtual/i-mscp.net/wiki/htdocs/data/pages/plugins/demo.txt · Last modified: 2014/02/23 09:44 by nuxwin