Code

Prepared statistics to print password changes over time
[gosa.git] / gosa-core / include / class_core.inc
index fea6049af9d1e388a0f8f0307d54b7d0297d35f8..6f9df0b45fcf17070a033a4d538a7f4ec65cf0b5 100644 (file)
@@ -1,5 +1,110 @@
 <?php
 
+/*
+ *   How to use plugin::plInfo()
+ *   ===================
+ *   
+ *   The function returns a descriptive array of the plugin,
+ *    which will then be used by GOsa to populate the plugin, its ACLs, 
+ *    its properties, its schema requirements aso.
+ *
+ *
+ *   The following values can be set:
+ *   ================================
+ *
+ *   plShortName    |-> The name of the plugin in short (e.g. Posix)
+ *                  |   This short-name will be shown for example in the ACL definitions.
+ *                  | 
+ *                  | 
+ *   plDescription  |-> A descriptive text for the plugin (e.g. User posix account extension)
+ *                  |   This will be shown in the ACL definitions.   
+ *                  | 
+ *                  | 
+ *   plSelfModify   |-> If set to true this plugin allows to set 'self' ACLs.
+ *                  |   For exampe to allow to change the users own password, but not the others.
+ *                  | 
+ *                  | 
+ *   plDepends      |-> The plugins dependencies to other classes (e.g. sambaAccount requires posixAccount)
+ *                  |  
+ *                  | 
+ *   plPriority     |-> The priority of the plugin, this influences the ACL listings only.
+ *                  | 
+ *                  | 
+ *   plSection      |-> The section of this plugin 'administration', 'personal', 'addons'
+ *                  | 
+ *                  | 
+ *   plCategory     |-> The plugin category this plugins belongs to (e.g. users, groups, departments) 
+ *                  | 
+ *                  | 
+ *   plRequirements |-> Plugin requirements. 
+ *                  | |
+ *                  | |-> [activePlugin]           The schame checks will only be performed if the given plugin is enabled
+ *                  | |                             in the gosa.conf definitions.
+ *                  | |                            Defaults to the current class name if empty.
+ *                  | |
+ *                  | |-> [ldapSchema]             An array of objectClass requirements.
+ *                  | |                            Syntax [[objectClass => 'version'], ... ]
+ *                  | |                            Version can be emtpy which just checks for the existence of the class.
+ *                  | |
+ *                  | |-> [onFailureDisablePlugin] A list of plugins that which will be disabled if the 
+ *                  |                               requirements couldn't be fillfulled.
+ *                  |
+ *                  |      ---------------------------------------------
+ *                  |      EXAMPLE:
+ *                  |      ---------------------------------------------
+ *                  |      "plRequirements"=> array(
+ *                  |         'activePlugin' => 'applicationManagement', 
+ *                  |         'ldapSchema' => array(
+ *                  |             'gosaObject' => '',
+ *                  |             'gosaAccount' => '>=2.7',
+ *                  |             'gosaLockEntry' => '>=2.7',
+ *                  |             'gosaDepartment' => '>=2.7',
+ *                  |             'gosaCacheEntry' => '>=2.7',
+ *                  |             'gosaProperties' => '>=2.7',
+ *                  |             'gosaConfig' => '>=2.7'
+ *                  |             ),
+ *                  |         'onFailureDisablePlugin' => array(get_class(), 'someClassName')
+ *                  |         ),
+ *                  |      ---------------------------------------------
+ *                  |
+ *                  |
+ *                  |         
+ *   plProvidedAcls |-> The ACLs provided by this plugin
+ *                  |
+ *                  |      ---------------------------------------------
+ *                  |      EXAMPLE:
+ *                  |      ---------------------------------------------
+ *                  |      "plProvidedAcls"=> array(
+ *                  |          'cn'             => _('Name'),
+ *                  |          'uid'            => _('Uid'),
+ *                  |          'phoneNumber'    => _('Phone number')
+ *                  |          ),
+ *                  |      ---------------------------------------------
+ *                  |
+ *                  |
+ *                  | 
+ *   plProperties   |-> Properties used by the plugin.
+ *                  |   Properties which are defined here will be modifyable using the property editor.
+ *                  |   To read properties you can use $config->get_cfg_value(className, propertyName)
+ *                  | 
+ *                  |      ---------------------------------------------
+ *                  |      EXAMPLE:
+ *                  |      ---------------------------------------------
+ *                  |      "plProperties"=> array(
+ *                  |         array(
+ *                  |             "name"          => "htaccessAuthentication",
+ *                  |             "type"          => "bool",
+ *                  |             "default"       => "false",
+ *                  |             "description"   => _("A description..."),
+ *                  |             "check"         => "gosaProperty::isBool",
+ *                  |             "migrate"       => "",
+ *                  |             "group"         => "authentification",
+ *                  |             "mandatory"     => TRUE
+ *                  |             ),
+ *                  |         ),
+ *                  |   See class_core.inc for a huge amount of examples.
+ */
+
 
 class all extends plugin {
     static function plInfo()
@@ -11,7 +116,7 @@ class all extends plugin {
                     "plDepends"     => array(),
                     "plPriority"    => 0,
                     "plSection"     => array("administration"),
-                    "plCategory"    => array("all" => array("objectClass" => "none", "description" => '*&nbsp;'._("All"))),
+                    "plCategory"    => array("all" => array("description" => '*&nbsp;'._("All"))),
                     "plProvidedAcls"    => array())
                );
     }
@@ -67,7 +172,12 @@ class core extends plugin {
                 $list = array('mail' => 'mail','uid' => 'uid');
                 break;
             case 'mailMethod': 
-                $list = mailMethod::get_methods();
+                $tmp = mailMethod::get_methods();
+                $list =array();
+                foreach($tmp as $name => $value){
+                    $name = preg_replace('/^mailMethod/','', $name);
+                    $list[$name] = $value;
+                }
                 $list[''] = _("None");
                 break;
             case 'language':
@@ -99,6 +209,22 @@ class core extends plugin {
                     "plDepends"     => array(),
                     "plPriority"    => 0,
                     "plSection"     => array("administration"),
+
+                    "plRequirements"=> array(
+                        'ldapSchema' => array(
+                            'gosaObject' => '>=2.7',
+                            'gosaAccount' => '>=2.7',
+                            'gosaLockEntry' => '>=2.7',
+                            'gosaDepartment' => '>=2.7',
+                            'gosaCacheEntry' => '>=2.7',
+                            'gosaProperties' => '>=2.7',
+                            'gosaConfig' => '>=2.7'
+                            ),
+                        'onFailureDisablePlugin' => array(get_class())
+                        ),
+
+
+
                     "plCategory"    => array("all"),
                     "plProperties"  => array(
 
@@ -106,12 +232,32 @@ class core extends plugin {
                             "name"          => "htaccessAuthentication",
                             "type"          => "bool",
                             "default"       => "false",
-                            "description"   => _("The 'htaccessAuthentication' variable tells GOsa to use either htaccess authentication or LDAP authentication. This can be used if you want to use i.e. kerberos to authenticate the users."),
+                            "description"   => _("The 'htaccessAuthentication' variable tells GOsa to use either htaccess authentication or LDAP authentication. This can be used if you want to use i.e. Kerberos to authenticate the users."),
                             "check"         => "gosaProperty::isBool",
                             "migrate"       => "",
                             "group"         => "authentification",
                             "mandatory"     => TRUE),
 
+                        array(
+                            "name"          => "statsDatabaseEnabled",
+                            "type"          => "bool",
+                            "default"       => "false",
+                            "description"   => _("Enables/Disables GOSa usage statistics moduls."),
+                            "check"         => "gosaProperty::isBool",
+                            "migrate"       => "",
+                            "group"         => "core",
+                            "mandatory"     => TRUE),
+
+                        array(
+                                "name"          => "statsDatabaseDirectory",
+                                "type"          => "path",
+                                "default"       => "/var/spool/gosa/stats",
+                                "description"   => _("The database file for GOSa usage statistics."),
+                                "check"         => "gosaProperty::isWriteablePath",
+                                "migrate"       => "",
+                                "group"         => "core",
+                                "mandatory"     => TRUE),
+
                         array(
                             "name"          => "logging",
                             "type"          => "bool",
@@ -164,6 +310,16 @@ class core extends plugin {
                                 "group"         => "password",
                                 "mandatory"     => FALSE),
 
+                        array(
+                                "name"          => "passwordProposalHook",
+                                "type"          => "command",
+                                "default"       => "",
+                                "description"   => _("The 'passwordProposalHook' can be used to let GOsa generate password proposals for you. Whenever you change a password, you can then decide whether to use the proposal or to manually specify a password.")." "._("Here is an example command:")." /usr/bin/apg -n1",
+                                "check"         => "gosaProperty::isCommand",
+                                "migrate"       => "",
+                                "group"         => "password",
+                                "mandatory"     => FALSE),
+
                         array(
                                 "name"          => "displayErrors",
                                 "type"          => "bool",
@@ -207,7 +363,7 @@ class core extends plugin {
 
                         array(
                                 "name"          => "forceGlobals",
-                                "type"          => "bool",
+                                "type"          => "noLdap",
                                 "default"       => "false",
                                 "description"   => _("The 'forceGlobals' statement enables PHP security checks to force register_global settings to be switched off."),
                                 "check"         => "gosaProperty::isBool",
@@ -217,7 +373,7 @@ class core extends plugin {
 
                         array(
                                 "name"          => "forceSSL",
-                                "type"          => "bool",
+                                "type"          => "noLdap",
                                 "default"       => "false",
                                 "description"   => _("The 'forceSSL' statement enables PHP security checks to force encrypted access to the web interface. GOsa will try to redirect to the same URL - just with https://"),
                                 "check"         => "gosaProperty::isBool",
@@ -277,7 +433,7 @@ class core extends plugin {
 
                         array(
                                 "name"          => "warnSSL",
-                                "type"          => "bool",
+                                "type"          => "noLdap",
                                 "default"       => "true",
                                 "description"   => _("The 'warnSSL' statement enables PHP security checks to detect non encrypted access to the web interface. GOsa will display a warning in this case."),
                                 "check"         => "gosaProperty::isBool",
@@ -383,7 +539,7 @@ class core extends plugin {
                         array(
                                 "name"          => "sessionLifetime",
                                 "type"          => "integer",
-                                "default"       => 7200,
+                                "default"       => 600,
                                 "description"   => _("The 'sessionLifetime' value defines when a session will expire in seconds. For Debian systems, this will not work because the sessions will be removed by a cron job instead. Please modify the value inside of your php.ini instead."),
                                 "check"         => "gosaProperty::isInteger",
                                 "migrate"       => "",
@@ -551,6 +707,36 @@ DEBUG_SI      = 256"),
                                 "group"         => "id",
                                 "mandatory"     => FALSE),
 
+                        array(
+                                "name"          => "gosaRpcServer",
+                                "type"          => "string",
+                                "default"       => "",
+                                "description"   => "The server to use for RPC connections! (http://localhost:8080/rpc), Future GOsa-ng service! If this value is set and not empty GOsa will try to establish a connection!",
+                                "check"         => "",
+                                "migrate"       => "",
+                                "group"         => "rpc",
+                                "mandatory"     => FALSE),
+
+                        array(
+                                "name"          => "gosaRpcUser",
+                                "type"          => "string",
+                                "default"       => "admin",
+                                "description"   => "Ther username to use for RPC connections! Future GOsa-ng service!",
+                                "check"         => "",
+                                "migrate"       => "",
+                                "group"         => "rpc",
+                                "mandatory"     => FALSE),
+
+                        array(
+                                "name"          => "gosaRpcPassword",
+                                "type"          => "string",
+                                "default"       => "tester",
+                                "description"   => "Ther password to use for RPC connections! Future GOsa-ng service!",
+                                "check"         => "",
+                                "migrate"       => "",
+                                "group"         => "rpc",
+                                "mandatory"     => FALSE),
+
                         array(
                                 "name"          => "gosaSupportURI",
                                 "type"          => "string",