@@ -23,8 +22,7 @@ LAM is distributed with a copy of the GPL license.
Module names are usually named after the object class they manage.
However, you can use any name you want, it should be short and
containing only a-z and 0-9. The module name is only shown in the
-configuration dialog, on all other pages LAM will show a provided alias name.
+configuration dialog, on all other pages LAM will show a provided alias name.
All account modules are stored in lib/modules.
The filename must end with .inc
and the file must have the same name as its inside class.
@@ -32,9 +30,7 @@ and the file must have the same name as its inside class. Example:
Our example module will provide the class
ieee802Device,
-therefore the file will be called lib/modules/ieee802Device.inc.
+therefore the file will be called lib/modules/ieee802Device.inc.
3. Defining the class
@@ -44,8 +40,7 @@ for all required class functions.
Example:
-
+
/**
@@ -54,8 +49,7 @@ for all required class functions.
* @package modules
*/
classieee802Device
- extends baseModule {
+ extends baseModule {
}
@@ -72,14 +66,11 @@ will do the rest.
Providing meta data is
optional, you can implement the required functions in your class, too.
-The baseModule reads the meta data by calling get_metaData() in your class.
+The baseModule reads the meta data by calling get_metaData() in your class.
-
-
+
\ No newline at end of file
diff --git a/lam/docs/devel/mod_general.htm b/lam/docs/devel/mod_general.htm
index aa19ec2b..d2b57563 100644
--- a/lam/docs/devel/mod_general.htm
+++ b/lam/docs/devel/mod_general.htm
@@ -2,9 +2,10 @@
Module HowTo - General module options
+
-
-
+
+
Module HowTo - General module options
@@ -13,11 +14,10 @@
1. Account types
-LAM currently provides three account types: users, groups, hosts
+LAM provides multiple account types (e.g. users, groups, hosts). A module can manage one or more account types.
-The types are specified with can_manage()
-or meta['account_types'].
+The types are specified with can_manage().
Example:
@@ -28,18 +28,12 @@ module will be used only for host accounts.
/**
- * Returns meta data that is interpreted by parent
-class
- *
- * @return array array with meta data
+ * Returns true if this module can manage accounts of the current type, otherwise false.
+ *
+ * @return boolean true if module fits
*/
- function
-get_metaData() {
- $return = array();
- // manages host accounts
-
- $return["account_types"] = array("host");
- return $return;
+ public function can_manage() {
+ return $this->get_scope() == 'host';
}