summaryrefslogtreecommitdiff
path: root/doc/sample-insert-user_types.php
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-06 09:33:31 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-06 09:33:31 (GMT)
commit3ce1d5c270d3104756528e82df1bc9398771d4ff (patch)
treee5d255ecbf741f40911ca391804b4955918d8f3a /doc/sample-insert-user_types.php
parent5e322f5e22f50f3a7418f70ebb2c7ef44bf18926 (diff)
downloadkolab-wap-3ce1d5c270d3104756528e82df1bc9398771d4ff.tar.gz
Add 3.0.0 initialization SQL file.
Add samples to insert custom group_types, options and user_types
Diffstat (limited to 'doc/sample-insert-user_types.php')
-rw-r--r--doc/sample-insert-user_types.php395
1 files changed, 395 insertions, 0 deletions
diff --git a/doc/sample-insert-user_types.php b/doc/sample-insert-user_types.php
new file mode 100644
index 0000000..7470aec
--- /dev/null
+++ b/doc/sample-insert-user_types.php
@@ -0,0 +1,395 @@
+#!/usr/bin/php
+<?php
+
+ if (isset($_SERVER["REQUEST_METHOD"]) && !empty($SERVER["REQUEST_METHOD"])) {
+ die("Not intended for execution through the webserver, sorry!");
+ }
+
+ require_once("lib/functions.php");
+
+ $db = SQL::get_instance();
+
+ $result = $db->query("TRUNCATE `user_types`");
+
+ $attributes = Array(
+ "auto_form_fields" => Array(
+ "cn" => Array(
+ "data" => Array(
+ "givenname",
+ "sn",
+ ),
+ ),
+ "displayname" => Array(
+ "data" => Array(
+ "givenname",
+ "sn",
+ ),
+ ),
+ "mail" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ ),
+ "mailalternateaddress" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ "optional" => true,
+ ),
+ "mailhost" => Array(
+ "optional" => true,
+ ),
+ "uid" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ ),
+ "userpassword" => Array(
+ "optional" => true,
+ ),
+ ),
+ "form_fields" => Array(
+/*
+ "c" => Array(
+ "type" => "select",
+ "optional" => true,
+ ),
+*/
+ "givenname" => Array(),
+ "initials" => Array(
+ "optional" => true,
+ ),
+ "kolabdelegate" => Array(
+ "type" => "list",
+ "autocomplete" => 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,
+ ),
+ "l" => Array(
+ "optional" => true,
+ ),
+ "mailalternateaddress" => Array(
+ "type" => "list",
+ "optional" => true,
+ ),
+ "mailquota" => Array(
+ "optional" => true,
+ ),
+ "mobile" => Array(
+ "optional" => true,
+ ),
+ "nsroledn" => Array(
+ "type" => "list",
+ "autocomplete" => true,
+ "optional" => true
+ ),
+ "o" => Array(
+ "optional" => true,
+ ),
+ "ou" => Array(
+ "type" => "select",
+ ),
+ "pager" => Array(
+ "optional" => true,
+ ),
+ "postalcode" => Array(
+ "optional" => true,
+ ),
+ "preferredlanguage" => Array(
+ "type" => "select",
+ ),
+ "sn" => Array(),
+ "street" => Array(
+ "optional" => true,
+ ),
+ "telephonenumber" => Array(
+ "optional" => true,
+ ),
+ "title" => Array(
+ "optional" => true,
+ ),
+ "userpassword" => Array(
+ "optional" => true,
+ ),
+ ),
+ "fields" => Array(
+ "objectclass" => Array(
+ "top",
+ "inetorgperson",
+ "kolabinetorgperson",
+ "mailrecipient",
+ "organizationalperson",
+ "person",
+ ),
+ ),
+ );
+
+ $result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('kolab','Kolab User', 'A Kolab User'," .
+ "'" . json_encode($attributes) . "')");
+
+ $attributes = Array(
+ "auto_form_fields" => Array(
+ "cn" => Array(
+ "data" => Array(
+ "givenname",
+ "sn",
+ ),
+ ),
+ "displayname" => Array(
+ "data" => Array(
+ "givenname",
+ "sn",
+ ),
+ ),
+ "gidnumber" => Array(),
+ "homedirectory" => Array(
+ "data" => Array(
+ "givenname",
+ "sn",
+ ),
+ ),
+ "uid" => Array(
+ "data" => Array(
+ "givenname",
+ "sn",
+ ),
+ ),
+ "uidnumber" => Array(),
+ "userpassword" => Array(
+ "optional" => true,
+ ),
+ ),
+ "form_fields" => Array(
+ "givenname" => Array(),
+ "initials" => Array(
+ "optional" => true,
+ ),
+ "preferredlanguage" => Array(
+ "type" => "select",
+ "values" => Array(
+ "en_US",
+ "de_DE",
+ "de_CH",
+ "en_GB",
+ "fi_FI",
+ "fr_FR",
+ "hu_HU",
+ ),
+ ),
+ "loginshell" => Array(
+ "type" => "select",
+ "values" => Array(
+ "/bin/bash",
+ "/usr/bin/git-shell",
+ "/sbin/nologin",
+ ),
+ ),
+ "ou" => Array(
+ "type" => "select",
+ ),
+ "sn" => Array(),
+ "title" => Array(
+ "optional" => true,
+ ),
+ "userpassword" => Array(
+ "optional" => true,
+ ),
+ ),
+ "fields" => Array(
+ "objectclass" => Array(
+ "top",
+ "inetorgperson",
+ "organizationalperson",
+ "person",
+ "posixaccount",
+ ),
+ ),
+ );
+
+ $result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('posix','POSIX User', 'A POSIX user (with a home directory and shell access)'," .
+ "'" . json_encode($attributes) . "')");
+
+ $attributes = Array(
+ "auto_form_fields" => Array(
+ "cn" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ ),
+ "displayname" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ ),
+ "gidnumber" => Array(),
+ "homedirectory" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ ),
+ "mail" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ ),
+ "mailalternateaddress" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ "optional" => true,
+ ),
+ "mailhost" => Array(
+ "optional" => true,
+ ),
+ "uid" => Array(
+ "data" => Array(
+ "givenname",
+ "preferredlanguage",
+ "sn",
+ ),
+ ),
+ "uidnumber" => Array(),
+ "userpassword" => Array(
+ "optional" => true,
+ ),
+ ),
+ "form_fields" => Array(
+/*
+ "c" => Array(
+ "type" => "select",
+ "optional" => true,
+ ),
+*/
+ "givenname" => Array(),
+ "initials" => Array(
+ "optional" => true,
+ ),
+ "kolabdelegate" => Array(
+ "type" => "list",
+ "autocomplete" => 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,
+ ),
+ "l" => Array(
+ "optional" => true,
+ ),
+ "loginshell" => Array(
+ "type" => "select",
+ "values" => Array(
+ "/bin/bash",
+ "/usr/bin/git-shell",
+ "/sbin/nologin",
+ ),
+ ),
+ "mailalternateaddress" => Array(
+ "type" => "list",
+ "optional" => true,
+ ),
+ "mailquota" => Array(
+ "optional" => true,
+ ),
+ "mobile" => Array(
+ "optional" => true,
+ ),
+ "nsroledn" => Array(
+ "type" => "list",
+ "autocomplete" => true,
+ "optional" => true,
+ ),
+ "o" => Array(
+ "optional" => true,
+ ),
+ "ou" => Array(
+ "type" => "select",
+ ),
+ "pager" => Array(
+ "optional" => true,
+ ),
+ "postalcode" => Array(
+ "optional" => true,
+ ),
+ "preferredlanguage" => Array(
+ "type" => "select",
+ ),
+ "sn" => Array(),
+ "street" => Array(
+ "optional" => true,
+ ),
+ "telephonenumber" => Array(
+ "optional" => true,
+ ),
+ "title" => Array(
+ "optional" => true,
+ ),
+ "userpassword" => Array(
+ "optional" => true,
+ ),
+ ),
+ "fields" => Array(
+ "objectclass" => Array(
+ "top",
+ "inetorgperson",
+ "kolabinetorgperson",
+ "mailrecipient",
+ "organizationalperson",
+ "person",
+ "posixaccount",
+ ),
+ ),
+ );
+
+ $result = $db->query("INSERT INTO `user_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('kolab_posix','Mail-enabled POSIX User', 'A mail-enabled POSIX User'," .
+ "'" . json_encode($attributes) . "')");
+
+?>