summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-06-25 09:03:47 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-06-25 09:04:40 +0200
commitb864c7e4c9de3e40f03aeb19576da4a1d6736e19 (patch)
tree3c9264fa0689f51146f2fdc3fd28e2835ff4c202
parent9c3649a550fa896cdbe8673d039292ad89332143 (diff)
downloadwebadmin-b864c7e4c9de3e40f03aeb19576da4a1d6736e19.tar.gz
Update inserted hosted user types
Summary: These are the working hosted user types for T30. Test Plan: None. Reviewers: #hkccp_developers, machniak Reviewed By: #hkccp_developers, machniak Projects: #web_administration_panel Maniphest Tasks: T30 Differential Revision: https://git.kolab.org/D26
-rw-r--r--doc/sample-insert-hosted-user_types.php313
1 files changed, 223 insertions, 90 deletions
diff --git a/doc/sample-insert-hosted-user_types.php b/doc/sample-insert-hosted-user_types.php
index 3485865..19251e4 100644
--- a/doc/sample-insert-hosted-user_types.php
+++ b/doc/sample-insert-hosted-user_types.php
@@ -1,7 +1,11 @@
#!/usr/bin/php
<?php
+ /*
+ To configure the Kolab Webadmin user types database.
+ Execute it on the Kolab server from /usr/share/kolab-webadmin/
+ */
- if (isset($_SERVER["REQUEST_METHOD"]) && !empty($SERVER["REQUEST_METHOD"])) {
+ if (php_sapi_name() != 'cli') {
die("Not intended for execution through the webserver, sorry!");
}
@@ -9,159 +13,219 @@
$db = SQL::get_instance();
- $result = $db->query("TRUNCATE TABLE `user_types`");
+ $result = $db->query("TRUNCATE `user_types`");
$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",
),
),
+ "nsroledn" => Array(
+ "optional" => true,
+ ),
),
"form_fields" => Array(
- /*
- * Givenname is a requirement, but could
- * be filled with random data if not
- * wanted.
- */
+ "title" => Array(
+ "optional" => true,
+ ),
"givenname" => Array(),
- /*
- * The 'mailalternateaddress' is supposed
- * to contain the original email address
- * for the user.
- */
+ "sn" => Array(),
+ "o" => Array(
+ "optional" => true,
+ ),
+ "street" => Array(
+ "optional" => true,
+ ),
+ "postalcode" => Array(
+ "optional" => true,
+ ),
+ "l" => Array(
+ "optional" => true,
+ ),
+ "c" => Array(
+ "type" => "select",
+ "value" => "normal",
+ ),
+ "telephonenumber" => Array(
+ "optional" => true,
+ ),
+ "mobile" => Array(
+ "optional" => true,
+ ),
"mailalternateaddress" => Array(
+ "optional" => false,
+ ),
+ "alias" => Array(
+ "type" => "list",
+ "optional" => true,
+ ),
+ "uid" => Array(
"optional" => true,
),
+ "userpassword" => Array(
+ "type" => "password",
+ "optional" => true,
+ ),
+ "nsroledn" => Array(
+ "optional" => true,
+ ),
+ ),
+ "fields" => Array(
+ "mailquota" => Array(),
+ "objectclass" => Array(
+ "top",
+ "inetorgperson",
+ "kolabinetorgperson",
+ "mailrecipient",
+ "organizationalperson",
+ "country",
+ "person",
+ ),
+ ),
+ );
+
+ $result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`, `used_for`) " .
+ "VALUES ('individual','individual', 'individual'," .
+ "'" . json_encode($attributes) . "', 'hosted')");
+
+ $attributes = Array(
+ "auto_form_fields" => Array(
+ "cn" => Array(
+ "data" => Array(
+ "givenname",
+ "sn",
+ ),
+ ),
+ "nsroledn" => Array(
+ "optional" => true,
+ ),
+ ),
+ "form_fields" => Array(
+ "givenname" => Array(),
"sn" => Array(),
+ "o" => Array(
+ "optional" => true,
+ ),
+ "street" => Array(
+ "optional" => true,
+ ),
+ "postalcode" => Array(
+ "optional" => true,
+ ),
+ "l" => Array(
+ "optional" => true,
+ ),
+ "c" => Array(
+ "type" => "select",
+ "value" => "normal",
+ ),
+ "telephonenumber" => Array(
+ "optional" => true,
+ ),
+ "mobile" => Array(
+ "optional" => true,
+ ),
+ "mail" => Array(
+ "validate" => false,
+ ),
+ "mailalternateaddress" => Array(),
+ "nsroledn" => Array(
+ "optional" => true,
+ ),
"uid" => Array(),
"userpassword" => Array(
+ "optional" => true,
"type" => "password",
-// "optional" => true,
),
),
"fields" => Array(
- "mailquota" => "131072",
- "nsroledn" => "cn=personal-user,dc=notifytest,dc=tld",
+ "mailquota" => Array(),
+ "nsroledn" => Array(
+ "cn=admin-user,%(base_dn)s",
+ ),
"objectclass" => Array(
"top",
"inetorgperson",
"kolabinetorgperson",
- "mailrecipient",
"organizationalperson",
+ "mailrecipient",
+ "country",
"person",
),
),
);
+
$result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`, `used_for`) " .
- "VALUES ('personal','Personal', 'A user with a personal hosted plan'," .
+ "VALUES ('organization','organization', 'organization'," .
"'" . json_encode($attributes) . "', 'hosted')");
$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",
),
),
+ "nsroledn" => Array(
+ "optional" => true,
+ ),
),
"form_fields" => Array(
- "alias" => Array(
- "type" => "list",
+ "title" => Array(
"optional" => true,
- "maxcount" => 2,
),
- /*
- * Givenname is a requirement, but could
- * be filled with random data if not
- * wanted.
- */
"givenname" => Array(),
- /*
- * The 'mailalternateaddress' is supposed
- * to contain the original email address
- * for the user.
- */
- "mailalternateaddress" => Array(
+ "sn" => Array(),
+ "o" => Array(
+ "optional" => true,
+ ),
+ "street" => Array(
+ "optional" => true,
+ ),
+ "postalcode" => Array(
+ "optional" => true,
+ ),
+ "l" => Array(
+ "optional" => true,
+ ),
+ "telephonenumber" => Array(
+ "optional" => true,
+ ),
+ "mobile" => Array(
+ "optional" => true,
+ ),
+ "alias" => Array(
+ "type" => "list",
"optional" => true,
),
- "sn" => Array(),
- "uid" => Array(),
"userpassword" => Array(
"type" => "password",
-// "optional" => true,
+ "optional" => true,
+ ),
+ "uid" => Array(
+ "optional" => true,
+ ),
+ "nsroledn" => Array(
+ "optional" => true,
),
),
"fields" => Array(
- "mailquota" => "1048576",
- "nsroledn" => "cn=professional-user,dc=notifytest,dc=tld",
+ "mailquota" => Array(),
"objectclass" => Array(
"top",
"inetorgperson",
@@ -174,7 +238,76 @@
);
$result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`, `used_for`) " .
- "VALUES ('professional','Professional', 'A user with a professional hosted plan'," .
+ "VALUES ('organization-user','organization-user', 'organization-user'," .
"'" . json_encode($attributes) . "', 'hosted')");
+ $attributes = Array(
+ "auto_form_fields" => Array(
+ "cn" => Array(
+ "data" => Array(
+ "givenname",
+ "sn",
+ ),
+ ),
+ "mail" => Array(
+ "data" => Array(
+ "uid",
+ ),
+ ),
+ "nsroledn" => Array(
+ "optional" => true,
+ ),
+ ),
+ "form_fields" => Array(
+ "title" => Array(
+ "optional" => true,
+ ),
+ "givenname" => Array(),
+ "sn" => Array(),
+ "o" => Array(
+ "optional" => true,
+ ),
+ "street" => Array(
+ "optional" => true,
+ ),
+ "postalcode" => Array(
+ "optional" => true,
+ ),
+ "l" => Array(
+ "optional" => true,
+ ),
+ "telephonenumber" => Array(
+ "optional" => true,
+ ),
+ "mobile" => Array(
+ "optional" => true,
+ ),
+ "nsroledn" => Array(
+ "optional" => true,
+ ),
+ "userpassword" => Array(
+ "type" => "password",
+ "optional" => true,
+ ),
+ "uid" => Array(
+ "optional" => true,
+ ),
+ ),
+ "fields" => Array(
+ "objectclass" => Array(
+ "top",
+ "inetorgperson",
+ "kolabinetorgperson",
+ "organizationalperson",
+ "person",
+ ),
+ ),
+ );
+
+ $result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`, `used_for`) " .
+ "VALUES ('tenant-admin','tenant-admin', 'tenant-admin'," .
+ "'" . json_encode($attributes) . "', '')");
+
+
+
?>