User Tools

Site Tools


de:plugins:demo

HINWEIS:
Einige Texte wurden möglicherweise noch nicht vollständig ins Deutsche Übersetzt oder könnten Übersetzungsfehler enthalten. Bitte helfen Sie bei der Übersetzung mit. Vielen Dank.

i-MSCP Demo-Plugin

Versionsinformationen

Plugin-Version0.0.7
AutorLaurent Declercq l.declercq@nuxwin.com
LizenzGPLv2
i-MSCP Kompatibilitäts-Version>= 1.0.2.1
Letzte Änderung16.02.2012

Einleitung

Das Demo-Plugin für i-MSCP erlaubt eine Installation für einen Demo-Server in wenigen Minuten. Es ermöglicht:

  1. Display a dialog box on the login page to allow the users to choose the account they want use to login
  2. Protect some users accounts against deletion and password modification
  3. Provide an actions list that must be disabled

I. Plugin-Konfiguration

A. Modales Dialogfeld auf Login-Seite

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: Um ein Benutzerkonto darzustellen, müssen Sie einen neuen Abschnitt wie unten in der Konfigurationsdatei hinzufügen:

...
	'user_accounts' => array(
		array(
			'label' => 'Administrator 1',
			'username' => 'admin1',
			'password' => 'admin1',
			'protected' => true
		)
	)
...

Hinweis: Benutzerkonten werden im Dialog nur angezeigt, wenn diese bereits in der i-MSCP-Datenbank vorhanden sind.

B. Schutz vor Löschen und Passwortveränderungen (Demo-Benutzer)

If an user account has the protected option set to TRUE (as above), it will be protected against deletion, and password modification.

C. Deaktivierte Aktionen

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.

Um eine oder mehrere Aktionen zu deaktivieren, müssen Sie einen neuen Abschnitt wie unten in der Plugin-Konfigurationsdatei hinzufügen:

...
	'disabled_actions' => array(
		'onBeforeAddFtp',
		'onBeforeEditFtp',
		'onBeforeDeleteFtp',
		'onBeforeAddSqlUser',
		'onBeforeEditSqlUser',
		'onBeforeDeleteSqlUser',
		'onBeforeAddSqlDb',
		'onBeforeDeleteSqlDb'
	)
...

D. Konfigurationsdatei Beispiel

Eine Konfigurationsdatei für das Demo-Plugin kann folgendermaßen aufgebaut sein:

<?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.

II. Plugin Aktivierung

To activate the plugin, you must configure it and update the plugin list via the i-MSCP plugin management interface. After you must activate it by clicking on the activate link into the plugin management interface.

Important

In production, this plugin must be protected against deactivation. For this, you must protect it by clicking on the protect link in the plugin management interface.

III. Plugin Deaktivierung

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 plugins. After, you will be able to deactivate it by clicking on the deactivate link into the plugin management interface.

Fühlen Sie sich frei, testen Sie es und berichten Sie uns über Fehler oder für Verbesserungsvorschläge.

/var/www/virtual/i-mscp.net/wiki/htdocs/data/pages/de/plugins/demo.txt · Last modified: 2012/03/16 03:38 by nuxwin