Convert to Horde 4
authorBen Klang <ben@alkaloid.net>
Sun, 20 Dec 2009 18:31:15 +0000 (18:31 +0000)
committerBen Klang <ben@alkaloid.net>
Sun, 20 Dec 2009 18:31:15 +0000 (18:31 +0000)
git-svn-id: https://svn.alkaloid.net/gpl/shout/trunk@488 06cd67b6-e706-0410-b29e-9de616bca6e9

config/conf.xml
dialplan.php
lib/Shout.php
lib/base.php
templates/common-header.inc
templates/menu.inc
templates/usermgr/list.inc
usermgr.php
usermgr/delete.php

index 9162f71..4ba17f0 100644 (file)
@@ -1,39 +1,13 @@
 <?xml version="1.0"?>
 <!-- $Id$ -->
 <configuration>
-  <configtab name="storage" desc="Storage Backend">
+  <configtab name="devices" desc="VoIP Devices">
     <configsection name="storage">
-      <configheader>Shout Storage</configheader>
+      <configheader>Device Storage</configheader>
       <configswitch name="driver" desc="What backend should we use for
         storing Asterisk phone user configuration?">ldap
         <case name="ldap" desc="LDAP">
-          <configsection name="params">
-            <configstring name="hostspec" desc="The hostname of the LDAP
-              server">localhost</configstring>
-            <configstring name="basedn" desc="The base DN for the LDAP server"/>
-            <configstring name="binddn" required="false" desc="The DN used to
-              bind to the LDAP server"/>
-            <configstring name="password" required="false" desc="The password
-              used to bind to the LDAP server"/>
-            <configenum name="version" desc="LDAP Protocol Version">3
-              <values>
-                <value desc="LDAPv2 (Deprecated)">2</value>
-                <value desc="LDAPv3">3</value>
-              </values>
-            </configenum>
-            <configstring name="uid" desc="The username search key"/>
-            <configswitch name="filter_type" desc="How to specify a filter for
-              the user lists">objectclass
-              <case name="objectclass" desc="One or more objectclass filters">
-                <configlist name="objectclass" desc="The objectclass filter used
-                  to search for users. Can be a single objectclass or a list."/>
-              </case>
-              <case name="free" desc="A complete LDAP filter expression">
-                <configstring name="filter" desc="The LDAP RFC formatted filter
-                  used to search for users."/>
-              </case>
-            </configswitch>
-          </configsection>
+          <configldap name="params" />
         </case>
       </configswitch>
     </configsection>
index 196fbc3..883d2c1 100644 (file)
@@ -21,7 +21,7 @@ $dialplan = &$shout->getDialplan($context);
 // Set up the tree.
 $dpgui = Shout_Dialplan::singleton('x', $dialplan);
 
-//$action = Util::getFormData("action");
+//$action = Horde_Util::getFormData("action");
 // $action = 'manager';
 
 $title = _("Dialplan Manager");
index 199a035..fcafdef 100644 (file)
@@ -33,14 +33,14 @@ class Shout
 
         require_once 'Horde/Menu.php';
 
-        $menu = &new Menu(HORDE_MENU_MASK_ALL);
+        $menu = new Horde_Menu(HORDE_MENU_MASK_ALL);
         $permprefix = "shout:contexts:$context";
 
         if (isset($context) && $section == "usermgr" &&
             Shout::checkRights("$permprefix:users",
                 PERMS_EDIT, 1)) {
             $url = Horde::applicationUrl("index.php");
-            $url = Util::addParameter($url, array('context' => $context,
+            $url = Horde_Util::addParameter($url, array('context' => $context,
                                                   'section' => $section,
                                                   'action' => 'add'));
 
@@ -61,7 +61,7 @@ class Shout
             Shout::checkRights("$permprefix:dialplan",
                 PERMS_EDIT, 1)) {
             $url = Horde::applicationUrl("dialplan.php");
-            $url = Util::addParameter($url, array('context' => $context,
+            $url = Horde_Util::addParameter($url, array('context' => $context,
                                                   'section' => $section,
                                                   'action' => 'add'));
 
@@ -95,16 +95,17 @@ class Shout
     function getTabs($context, &$vars)
     {
         global $shout;
+        $perms = Horde_Perms::singleton();
 
         $permprefix = 'shout:contexts:' . $context;
 
-        $tabs = &new Horde_UI_Tabs('section', $vars);
+        $tabs = new Horde_UI_Tabs('section', $vars);
 
         if (Shout::checkRights($permprefix . ':users', null, 1) &&
             $shout->checkContextType($context, 'users')) {
 
             $url = Horde::applicationUrl('usermgr.php');
-            $url = Util::addParameter($url, 'context', $context);
+            $url = Horde_Util::addParameter($url, 'context', $context);
             $tabs->addTab(_("_User Manager"), $url, 'usermgr');
         }
 
@@ -112,7 +113,7 @@ class Shout
             $shout->checkContextType($context, 'dialplan')) {
 
             $url = Horde::applicationUrl('dialplan.php');
-            $url = Util::addParameter($url, 'context', $context);
+            $url = Horde_Util::addParameter($url, 'context', $context);
             $tabs->addTab(_("_Dial Plan"), $url, 'dialplan');
         }
 
@@ -120,7 +121,7 @@ class Shout
             $shout->checkContextType($context, 'conference')) {
 
             $url = Horde::applicationUrl('conference.php');
-            $url = Util::addParameter($url, 'context', $context);
+            $url = Horde_Util::addParameter($url, 'context', $context);
             $tabs->addTab(_("_Conference Rooms"), $url, 'conference');
         }
 
@@ -128,13 +129,13 @@ class Shout
             $shout->checkContextType($context, "moh")) {
 
             $url = Horde::applicationUrl('moh.php');
-            $url = Util::addParameter($url, 'context', $context);
+            $url = Horde_Util::addParameter($url, 'context', $context);
             $tabs->addTab(_("_Music on Hold"), $url, 'moh');
         }
 
-        if (Perms::hasPermission('shout:superadmin', Auth::getAuth(), PERMS_SHOW|PERMS_READ)) {
+        if ($perms->hasPermission('shout:superadmin', Horde_Auth::getAuth(), PERMS_SHOW|PERMS_READ)) {
             $url = Horde::applicationUrl('security.php');
-            $url = Util::addParameter($url, 'context', $context);
+            $url = Horde_Util::addParameter($url, 'context', $context);
             $tabs->addTab(_("_Security"), $url, 'security');
         }
 
@@ -157,9 +158,9 @@ class Shout
      */
     function checkRights($permname, $permmask = null, $numparents = 0)
     {
-        if (Auth::isAdmin()) { return true; }
+        if (Horde_Auth::isAdmin()) { return true; }
 
-        $perms = Perms::singleton();
+        $perms = Horde_Perms::singleton();
         if ($permmask === null) {
             $permmask = PERMS_SHOW|PERMS_READ;
         }
@@ -169,11 +170,11 @@ class Shout
         $superadmin = 0;
 
         $superadmin = $perms->hasPermission('shout:superadmin',
-            Auth::getAuth(), $permmask);
+            Horde_Auth::getAuth(), $permmask);
 
         while ($numparents >= 0) {
             $tmpuser = $perms->hasPermission($permname,
-                Auth::getAuth(), $permmask);
+                Horde_Auth::getAuth(), $permmask);
 
             $user = $user | $tmpuser;
             if ($numparents > 0) {
index bdfd9a3..3ff31aa 100644 (file)
@@ -17,8 +17,7 @@ if (!defined('HORDE_BASE')) {
 // Load the Horde Framework core, and set up inclusion paths.
 require_once HORDE_BASE . '/lib/core.php';
 
-// Registry.
-$registry = &Registry::singleton();
+$registry = &Horde_Registry::singleton();
 if (is_a(($pushed = $registry->pushApp('shout', !defined('AUTH_HANDLER'))),
 'PEAR_Error')) {
     if ($pushed->getCode() == 'permission_denied') {
@@ -44,8 +43,7 @@ if (!$shout_configured) {
         #, 'prefs.php'));
 }
 
-// Notification system.
-$notification = &Notification::singleton();
+$notification = &Horde_Notification::singleton();
 $notification->attach('status');
 
 // Shout base libraries.
@@ -68,8 +66,8 @@ $shout = Shout_Driver::singleton();
 // Horde libraries.
 require_once 'Horde/Help.php';
 
-$context = Util::getFormData('context');
-$section = Util::getFormData('section');
+$context = Horde_Util::getFormData('context');
+$section = Horde_Util::getFormData('section');
 
 $contexts = $shout->getContexts();
 
index 35f14f6..0d03352 100644 (file)
@@ -1,6 +1,6 @@
 <?php
      if (isset($language)) {
-     header('Content-type: text/html; charset=' . NLS::getCharset());
+     header('Content-type: text/html; charset=' . Horde_NLS::getCharset());
      header('Vary: Accept-Language');
      }
      ?>
@@ -25,8 +25,8 @@
 
                 ?>
                 <title><?php echo $page_title ?></title>
-                <?php echo Horde::stylesheetLink('shout') ?>
+                <?php echo Horde::includeStylesheetFiles() ?>
 </head>
 
-<body<?php if (Util::nonInputVar('bodyClass')) echo ' class="' . $bodyClass .
+<body<?php if (Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bodyClass .
 '"' ?>>
index 12de29a..1740cf1 100644 (file)
@@ -10,7 +10,7 @@ $menu_view = $prefs->getValue('menu_view');
 
  <form action="index.php" method="get" name="contextMenu">
   <span style="float:right">
-   <?php Util::pformInput() ?>
+   <?php Horde_Util::pformInput() ?>
    <label for="context" accesskey="<?php echo $accesskey ?>">
     <select id="context" name="context" onchange="contextSubmit()">
      <?php
index 4bd6dfe..dc0d89d 100644 (file)
                 $rowcolor = $line % 2;
                 $line++;
                 $url = Horde::applicationUrl("index.php");
-                $url = Util::addParameter($url,
+                $url = Horde_Util::addParameter($url,
                     array(
                         'context' => $context,
                         'extension' => $extension,
                         'section' => $section,
                     )
                 );
-                $editurl = Util::addParameter($url, "action=edit");
-                $deleteurl = Util::addParameter($url, "action=delete");
+                $editurl = Horde_Util::addParameter($url, "action=edit");
+                $deleteurl = Horde_Util::addParameter($url, "action=delete");
         ?>
         <tr class="item<?php echo $rowcolor; ?>">
             <td style="width: 20%">
index a01f94a..f4b8a42 100644 (file)
@@ -17,10 +17,10 @@ if (!isset($SHOUT_RUNNING) || !$SHOUT_RUNNING) {
     exit();
 }
 
-$action = Util::getFormData('action');
-$extension = Util::getFormData('extension');
+$action = Horde_Util::getFormData('action');
+$extension = Horde_Util::getFormData('extension');
 
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
 
 $tabs = Shout::getTabs($context, $vars);
 $tabs->preserve('context', $context);
index 5d742e4..4400c5e 100644 (file)
@@ -12,8 +12,8 @@
 @define('SHOUT_BASE', dirname(__FILE__) . '/..');
 //require_once 'Horde/Variables.php';
 
-$context = Util::getFormData('context');
-$extension = Util::getFormData('extension');
+$context = Horde_Util::getFormData('context');
+$extension = Horde_Util::getFormData('extension');
 
 $res = $shout->deleteUser($context, $extension);