Added external API for permissions and possible future functionality
authorBen Klang <ben@alkaloid.net>
Mon, 31 Oct 2005 12:35:22 +0000 (12:35 +0000)
committerBen Klang <ben@alkaloid.net>
Mon, 31 Oct 2005 12:35:22 +0000 (12:35 +0000)
git-svn-id: https://svn.alkaloid.net/gpl/shout/trunk@77 06cd67b6-e706-0410-b29e-9de616bca6e9

lib/api.php [new file with mode: 0644]
lib/defines.php [new file with mode: 0644]

diff --git a/lib/api.php b/lib/api.php
new file mode 100644 (file)
index 0000000..c7b6910
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Shout external API interface.
+ *
+ * $Horde: shout/lib/api.php,v 1.120.2.4 2005/01/24 11:01:27 ben Exp $
+ *
+ * This file defines Shout's external API interface. Other
+ * applications can interact with Shout through this API.
+ *
+ * @package Shout
+ */
+@define('SHOUT_BASE', dirname(__FILE__) . "/..");
+require_once SHOUT_BASE . "/lib/defines.php";
+
+$_services['perms'] = array(
+    'args' => array(),
+    'type' => '{urn:horde}stringArray'
+);
+
+$_services['getUsersByDomain'] = array(
+    'args' => array('domain' => 'string', 'timestamp' => 'int'),
+    'type' => '{urn:horde}stringArray',
+);
+
+function _shout_perms()
+{
+    static $perms = array();
+    if (!empty($perms)) {
+        return $perms;
+    }
+
+    @define('SHOUT_BASE', dirname(__FILE__) . '/..');
+    require_once SHOUT_BASE . '/lib/base.php';
+
+    $perms['tree']['shout']['superadmin'] = false;
+    $perms['title']['shout:superadmin'] = _("Super Administrator");
+
+    $contexts= $shout->getContexts();
+
+    $perms['tree']['shout']['contexts'] = false;
+    $perms['title']['shout:contexts'] = _("Contexts");
+
+    // Run through every contact source.
+    foreach ($contexts as $context => $contextInfo) {
+        $perms['tree']['shout']['contexts'][$context] = false;
+        $perms['title']['shout:contexts:' . $context] = $context;
+    }
+
+
+//     function _shout_getContexts($searchfilters = SHOUT_CONTEXT_ALL,
+//                          $filterperms = null)
+
+
+}
\ No newline at end of file
diff --git a/lib/defines.php b/lib/defines.php
new file mode 100644 (file)
index 0000000..eda8834
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Shout external API interface.
+ *
+ * $Horde: shout/lib/defines.php,v 1.120.2.4 2005/01/24 11:01:27 ben Exp $
+ *
+ * This file defines Shout's constants.  Any file needing to use the
+ * driver or external API should require_once() this file.
+ *
+ * @package Shout
+ */
+@define(SHOUT_ASTERISK_BRANCH, "ou=Asterisk");
+@define(SHOUT_USERS_BRANCH, "ou=Customers");
+@define(SHOUT_USER_OBJECTCLASS, "asteriskUser");
+
+@define(SHOUT_CONTEXT_ALL, 0xF);
+@define(SHOUT_CONTEXT_NONE, 0);
+@define(SHOUT_CONTEXT_CUSTOMERS, 1 << 0);
+@define(SHOUT_CONTEXT_EXTENSIONS, 1 << 1);
+@define(SHOUT_CONTEXT_MOH, 1 << 2);
+@define(SHOUT_CONTEXT_CONFERENCE, 1 << 3);
\ No newline at end of file