doc/sample-insert-hosted-user_types.php

Torsten Grote grote at kolabsys.com
Tue Jul 10 11:35:57 CEST 2012


 doc/sample-insert-hosted-user_types.php |  107 +++++++++++++++++++++++++++++---
 1 file changed, 99 insertions(+), 8 deletions(-)

New commits:
commit a8a302d4cf03dd8a1af410ecbb51712ed17c42e5
Author: Torsten Grote <grote at kolabsys.com>
Date:   Tue Jul 10 09:34:24 2012 +0200

    added 'professional user' user type

diff --git a/doc/sample-insert-hosted-user_types.php b/doc/sample-insert-hosted-user_types.php
index 8361c5f..823f0c5 100644
--- a/doc/sample-insert-hosted-user_types.php
+++ b/doc/sample-insert-hosted-user_types.php
@@ -14,14 +14,12 @@
     $attributes = Array(
 
             /*
-             *
              * The form fields for which the values can be
              * generated automatically, using the existing
              * values of form_fields
              */
             "auto_form_fields" => Array(
                     /*
-                     *
                      * The 'cn' attribute is required for
                      * the LDAP objectclasses we use, but
                      * can be composed from a 'givenname'
@@ -36,7 +34,6 @@
                                 ),
                         ),
                     /*
-                     *
                      * The 'mail' attribute is supposed to 
                      * contain the email address this user
                      * will use for this environment, and
@@ -86,16 +83,107 @@
                      * for the user.
                      */
                     "mailalternateaddress" => Array(
-                            "type" => "list",
+                        ),
+                    "sn" => Array(),
+                    "uid" => Array(),
+                    "userpassword" => Array(
                             "optional" => true,
                         ),
-                    "mailquota" => Array(
+                ),
+            "fields" => Array(
+                    "mailquota" => "131072",
+                    "nsroledn" => "cn=personal-user,dc=notifytest,dc=tld",
+                    "objectclass" => Array(
+                            "top",
+                            "inetorgperson",
+                            "kolabinetorgperson",
+                            "mailrecipient",
+                            "organizationalperson",
+                            "person",
+                        ),
+                ),
+        );
+
+    $result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`) " .
+                "VALUES ('personal','Personal', 'A user with a personal hosted plan'," .
+                "'" . json_encode($attributes) . "')");
+
+    $attributes = Array(
+            /*
+             * The form fields for which the values can be
+             * generated automatically, using the existing
+             * values of form_fields
+             */
+            "auto_form_fields" => Array(
+                    /*
+                     * The 'cn' attribute is required for
+                     * the LDAP objectclasses we use, but
+                     * can be composed from a 'givenname'
+                     * and 'sn' attribute form_field (of
+                     * which 'sn' is also a required
+                     * attribute.
+                     */
+                    "cn" => Array(
+                            "data" => Array(
+                                    "givenname",
+                                    "sn",
+                                ),
+                        ),
+                    /*
+                     * The 'mail' attribute is supposed to 
+                     * contain the email address this user
+                     * will use for this environment, and
+                     * is (supposed?) to match the 'uid'
+                     * for the user account.
+                     *
+                     * Disable this auto_form_field if
+                     * the API is not capable of making
+                     * a 'uid' become a 'uid'@'domain',
+                     * where 'domain' is not a valid
+                     * LDAP attribute for a user entry.
+                     */
+                    "mail" => Array(
+                            "data" => Array(
+                                    "uid",
+                                ),
+                        ),
+                ),
+            "form_fields" => Array(
+                    "alias" => Array(
+                            "type" => "list",
                             "optional" => true,
+                            "max_count" => 2,
                         ),
-                    "nsroledn" => Array(
+                    "givenname" => Array(),
+                    "kolabdelegate" => Array(
                             "type" => "list",
                             "autocomplete" => true,
-                            "optional" => true
+                            "optional" => true,
+                        ),
+                    "kolabinvitationpolicy" => Array(
+                            "type" => "select",
+                            "values" => Array(
+                                    "",
+                                    "ACT_MANUAL",
+                                    "ACT_REJECT",
+                                ),
+                            "optional" => true,
+                        ),
+                    "kolaballowsmtprecipient" => Array(
+                            "type" => "list",
+                            "optional" => true,
+                        ),
+                    "kolaballowsmtpsender" => Array(
+                            "type" => "list",
+                            "optional" => true,
+                        ),
+                    /*
+                     * The 'mailalternateaddress' is supposed
+                     * to contain the original email address
+                     * for the user.
+                     */
+                    "mailalternateaddress" => Array(
+                            "optional" => true,
                         ),
                     "sn" => Array(),
                     "uid" => Array(),
@@ -104,6 +192,8 @@
                         ),
                 ),
             "fields" => Array(
+                    "mailquota" => "1048576",
+                    "nsroledn" => "cn=professional-user,dc=notifytest,dc=tld",
                     "objectclass" => Array(
                             "top",
                             "inetorgperson",
@@ -116,6 +206,7 @@
         );
 
     $result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`) " .
-                "VALUES ('personal','Personal', 'A user with a personal hosted plan'," .
+                "VALUES ('professional','Professional', 'A user with a professional hosted plan'," .
                 "'" . json_encode($attributes) . "')");
+
 ?>





More information about the commits mailing list