summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-02-27 11:31:39 +0100
committerAleksander Machniak <machniak@kolabsys.com>2014-02-27 11:31:39 +0100
commit181e61d2d947e5487694b0b8d5a709125245db48 (patch)
treeecb14eaa1dacf525edf00c07d09803ab36e46693 /doc
parent21b6f160fdb3afec0906082767de317af43d4737 (diff)
downloadwebadmin-181e61d2d947e5487694b0b8d5a709125245db48.tar.gz
Implemented OU structure management (Request #1745)
Diffstat (limited to 'doc')
-rw-r--r--doc/kolab_wap.sql (renamed from doc/kolab_wap-3.1.sql)30
-rw-r--r--doc/sample-insert-ou_types.php35
2 files changed, 64 insertions, 1 deletions
diff --git a/doc/kolab_wap-3.1.sql b/doc/kolab_wap.sql
index b4ba825..c863883 100644
--- a/doc/kolab_wap-3.1.sql
+++ b/doc/kolab_wap.sql
@@ -67,6 +67,34 @@ INSERT INTO `options` VALUES ('preferredlanguage','[\"aa_DJ\",\"aa_ER\",\"aa_ET\
UNLOCK TABLES;
--
+-- Table structure for table `ou_types`
+--
+
+DROP TABLE IF EXISTS `ou_types`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ou_types` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `key` text NOT NULL,
+ `name` varchar(256) NOT NULL,
+ `description` text NOT NULL,
+ `attributes` longtext NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name` (`name`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `ou_types`
+--
+
+LOCK TABLES `ou_types` WRITE;
+/*!40000 ALTER TABLE `ou_types` DISABLE KEYS */;
+INSERT INTO `ou_types` VALUES (1,'unit','Standard Organizational Unit','A standard organizational unit definition','{\"auto_form_fields\":[],\"fields\":{\"objectclass\":[\"top\",\"organizationalunit\"]},\"form_fields\":{\"ou\":[],\"description\":[]}}');
+/*!40000 ALTER TABLE `ou_types` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `resource_types`
--
@@ -188,4 +216,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2013-11-15 12:19:12
+-- Dump completed on 2014-02-26 10:20:01
diff --git a/doc/sample-insert-ou_types.php b/doc/sample-insert-ou_types.php
new file mode 100644
index 0000000..9f61936
--- /dev/null
+++ b/doc/sample-insert-ou_types.php
@@ -0,0 +1,35 @@
+#!/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 `ou_types`");
+
+ $attributes = Array(
+ "auto_form_fields" => Array(
+ ),
+ "fields" => Array(
+ "objectclass" => Array(
+ "top",
+ "organizationalunit",
+ ),
+ ),
+ "form_fields" => Array(
+ "ou" => Array(),
+ "description" => Array(
+ "optional" => true,
+ ),
+ ),
+ );
+
+ $result = $db->query("INSERT INTO `ou_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('simple_managed','Standard Organizational Unit', 'A standard organizational unit definition'," .
+ "'" . json_encode($attributes) . "')");
+
+?>