Rename to match new UI
authorBen Klang <ben@alkaloid.net>
Sun, 20 Dec 2009 22:08:18 +0000 (22:08 +0000)
committerBen Klang <ben@alkaloid.net>
Sun, 20 Dec 2009 22:08:18 +0000 (22:08 +0000)
git-svn-id: https://svn.alkaloid.net/gpl/shout/trunk@493 06cd67b6-e706-0410-b29e-9de616bca6e9

extensions/add.php [new file with mode: 0644]
extensions/delete.php [new file with mode: 0644]
extensions/edit.php [new file with mode: 0644]
extensions/list.php [new file with mode: 0644]
extensions/save.php [new file with mode: 0644]
usermgr/add.php [deleted file]
usermgr/delete.php [deleted file]
usermgr/edit.php [deleted file]
usermgr/list.php [deleted file]
usermgr/save.php [deleted file]

diff --git a/extensions/add.php b/extensions/add.php
new file mode 100644 (file)
index 0000000..16f3f3b
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+/**
+ * $Id$
+ *
+ * Copyright 2005 Ben Klang <ben@alkaloid.net>
+ *
+ * See the enclosed file LICENSE for license information (GPL). If you
+ * did not receive this file, see http://www.horde.org/licenses/gpl.php.
+ */
+@define('SHOUT_BASE', dirname(__FILE__) . '/..');
+
+require SHOUT_BASE . '/users/edit.php';
\ No newline at end of file
diff --git a/extensions/delete.php b/extensions/delete.php
new file mode 100644 (file)
index 0000000..4400c5e
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * $Id$
+ *
+ * Copyright 2005-2006 Ben Klang <ben@alkaloid.net>
+ *
+ * See the enclosed file LICENSE for license information (GPL). If you
+ * did not receive this file, see http://www.horde.org/licenses/gpl.php.
+ *
+ * @package shout
+ */
+@define('SHOUT_BASE', dirname(__FILE__) . '/..');
+//require_once 'Horde/Variables.php';
+
+$context = Horde_Util::getFormData('context');
+$extension = Horde_Util::getFormData('extension');
+
+$res = $shout->deleteUser($context, $extension);
+
+if (!$res) {
+    echo "Failed!";
+    print_r($res);
+}
+$notification->push("User Deleted.");
+$notification->notify();
+require SHOUT_TEMPLATES . '/common-footer.inc';
\ No newline at end of file
diff --git a/extensions/edit.php b/extensions/edit.php
new file mode 100644 (file)
index 0000000..3c3fe1e
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * $Id$
+ *
+ * Copyright 2005-2006 Ben Klang <ben@alkaloid.net>
+ *
+ * See the enclosed file LICENSE for license information (GPL). If you
+ * did not receive this file, see http://www.horde.org/licenses/gpl.php.
+ *
+ * @package shout
+ */
+if (!isset($SHOUT_RUNNING) || !$SHOUT_RUNNING) {
+    header('Location: /');
+    exit();
+}
+
+require_once SHOUT_BASE . '/lib/User.php';
+require_once 'Horde/Variables.php';
+
+$RENDERER = &new Horde_Form_Renderer();
+
+$empty = '';
+$beendone = 0;
+$wereerrors = 0;
+
+$vars = &Variables::getDefaultVariables($empty);
+
+$FormName = 'UserDetailsForm';
+$Form = &Horde_Form::singleton($FormName, $vars);
+if (is_a($Form, 'PEAR_Error')) {
+    $notification->push($Form);
+} else {
+    $FormValid = $Form->validate($vars, true);
+    if (is_a($FormValid, 'PEAR_Error')) {
+        $notification->push($FormValid);
+    } else {
+        $Form->fillUserForm(&$vars, $extension);
+    }
+}
+
+
+$notification->notify();
+
+if (!$FormValid || !$Form->isSubmitted()) {
+    # Display the form for editing
+    $Form->open($RENDERER, $vars, 'index.php', 'post');
+    $Form->preserveVarByPost(&$vars, 'extension');
+    $Form->preserveVarByPost(&$vars, 'context');
+    $Form->preserveVarByPost(&$vars, 'section');
+    $RENDERER->beginActive($Form->getTitle());
+    $RENDERER->renderFormActive($Form, $vars);
+    $RENDERER->submit();
+    $RENDERER->end();
+    $Form->close($RENDERER);
+} else {
+    # Process the Valid and Submitted form
+$notification->push("How did we get HERE?!", 'horde.error');
+$notification->notify();
+//     $info = array();
+//     $Form->getInfo($vars, $info);
+//
+//     $name = $info['name'];
+//     $extension = $info['extension'];
+//     $newextension = $info['newextension'];
+//     $email = $info['email'];
+//     $pin = $info['pin'];
+//
+//
+//     $limits = $shout->getLimits($context, $extension);
+//
+//     $userdetails = array("newextension" => $newextension,
+//                 "name" => $name,
+//                 "pin" => $pin,
+//                 "email" => $email);
+//
+//     $i = 1;
+//     $userdetails['telephonenumbers'] = array();
+//     while ($i <= $limits['telephonenumbersmax']) {
+//         $tmp = $info['telephone'.$i];
+//         if (!empty($tmp)) {
+//             $userdetails['telephonenumbers'][] = $tmp;
+//         }
+//         $i++;
+//     }
+//
+//     $userdetails['dialopts'] = array();
+//     if ($info['moh']) {
+//         $userdetails['dialopts'][] = 'm';
+//     }
+//     if ($info['transfer']) {
+//         $userdetails['dialopts'][] = 't';
+//     }
+}
\ No newline at end of file
diff --git a/extensions/list.php b/extensions/list.php
new file mode 100644 (file)
index 0000000..45cfc22
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * $Id$
+ *
+ * Copyright 2005-2006 Ben Klang <ben@alkaloid.net>
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @package shout
+ */
+
+if (!isset($SHOUT_RUNNING) || !$SHOUT_RUNNING) {
+    header('Location: /');
+    exit();
+}
+
+$users = &$shout->getUsers($context);
diff --git a/extensions/save.php b/extensions/save.php
new file mode 100644 (file)
index 0000000..e5a9355
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/**
+ * $Id$
+ *
+ * Copyright 2005-2006 Ben Klang <ben@alkaloid.net>
+ *
+ * See the enclosed file LICENSE for license information (GPL). If you
+ * did not receive this file, see http://www.horde.org/licenses/gpl.php.
+ *
+ * @package shout
+ */
+if (!isset($SHOUT_RUNNING) || !$SHOUT_RUNNING) {
+    header('Location: /');
+    exit();
+}
+
+require_once SHOUT_BASE . '/lib/User.php';
+require_once 'Horde/Variables.php';
+
+$RENDERER = &new Horde_Form_Renderer();
+
+$vars = &Variables::getDefaultVariables();
+$FormName = $vars->get('formname');
+
+$Form = &Horde_Form::singleton($FormName, $vars);
+
+$FormValid = $Form->validate($vars, true);
+
+if (!$FormValid || !$Form->isSubmitted()) {
+    require SHOUT_BASE . '/usermgr/edit.php';
+} else {
+    # Form is Valid and Submitted
+    $extension = $vars->get('extension');
+
+    $limits = $shout->getLimits($context, $extension);
+
+    # FIXME: Input Validation (Text::??)
+    $userdetails = array(
+        "newextension" => $vars->get('newextension'),
+        "name" => $vars->get('name'),
+        "mailboxpin" => $vars->get('mailboxpin'),
+        "email" => $vars->get('email'),
+        "uid" => $vars->get('uid'),
+    );
+
+    $userdetails['telephonenumber'] = array();
+    $telephonenumber = $vars->get("telephonenumber");
+    if (!empty($telephonenumber) && is_array($telephonenumber)) {
+        $i = 1;
+        while ($i <= $limits['telephonenumbersmax']) {
+            if (!empty($telephonenumber[$i])) {
+                $userdetails['telephonenumber'][] = $telephonenumber[$i++];
+            } else {
+                $i++;
+            }
+        }
+    }
+
+    $userdetails['dialopts'] = array();
+
+    if ($vars->get('moh')) {
+        $userdetails['dialopts'][] = 'm';
+    }
+    if ($vars->get('transfer')) {
+        $userdetails['dialopts'][] = 't';
+    }
+    if ($vars->get('eca')) {
+        $userdetails['dialopts'][] = 'e';
+    }
+    $res = $shout->saveUser($context, $extension, $userdetails);
+    if (is_a($res, 'PEAR_Error')) {
+        $notification->push($res);
+    } else {
+        $notification->push('User information updated.  '.
+            'Changes will take effect within 10 minutes',
+            'horde.success');
+    }
+
+    $notification->notify();
+}
diff --git a/usermgr/add.php b/usermgr/add.php
deleted file mode 100644 (file)
index 16f3f3b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-/**
- * $Id$
- *
- * Copyright 2005 Ben Klang <ben@alkaloid.net>
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- */
-@define('SHOUT_BASE', dirname(__FILE__) . '/..');
-
-require SHOUT_BASE . '/users/edit.php';
\ No newline at end of file
diff --git a/usermgr/delete.php b/usermgr/delete.php
deleted file mode 100644 (file)
index 4400c5e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * $Id$
- *
- * Copyright 2005-2006 Ben Klang <ben@alkaloid.net>
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @package shout
- */
-@define('SHOUT_BASE', dirname(__FILE__) . '/..');
-//require_once 'Horde/Variables.php';
-
-$context = Horde_Util::getFormData('context');
-$extension = Horde_Util::getFormData('extension');
-
-$res = $shout->deleteUser($context, $extension);
-
-if (!$res) {
-    echo "Failed!";
-    print_r($res);
-}
-$notification->push("User Deleted.");
-$notification->notify();
-require SHOUT_TEMPLATES . '/common-footer.inc';
\ No newline at end of file
diff --git a/usermgr/edit.php b/usermgr/edit.php
deleted file mode 100644 (file)
index 3c3fe1e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/**
- * $Id$
- *
- * Copyright 2005-2006 Ben Klang <ben@alkaloid.net>
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @package shout
- */
-if (!isset($SHOUT_RUNNING) || !$SHOUT_RUNNING) {
-    header('Location: /');
-    exit();
-}
-
-require_once SHOUT_BASE . '/lib/User.php';
-require_once 'Horde/Variables.php';
-
-$RENDERER = &new Horde_Form_Renderer();
-
-$empty = '';
-$beendone = 0;
-$wereerrors = 0;
-
-$vars = &Variables::getDefaultVariables($empty);
-
-$FormName = 'UserDetailsForm';
-$Form = &Horde_Form::singleton($FormName, $vars);
-if (is_a($Form, 'PEAR_Error')) {
-    $notification->push($Form);
-} else {
-    $FormValid = $Form->validate($vars, true);
-    if (is_a($FormValid, 'PEAR_Error')) {
-        $notification->push($FormValid);
-    } else {
-        $Form->fillUserForm(&$vars, $extension);
-    }
-}
-
-
-$notification->notify();
-
-if (!$FormValid || !$Form->isSubmitted()) {
-    # Display the form for editing
-    $Form->open($RENDERER, $vars, 'index.php', 'post');
-    $Form->preserveVarByPost(&$vars, 'extension');
-    $Form->preserveVarByPost(&$vars, 'context');
-    $Form->preserveVarByPost(&$vars, 'section');
-    $RENDERER->beginActive($Form->getTitle());
-    $RENDERER->renderFormActive($Form, $vars);
-    $RENDERER->submit();
-    $RENDERER->end();
-    $Form->close($RENDERER);
-} else {
-    # Process the Valid and Submitted form
-$notification->push("How did we get HERE?!", 'horde.error');
-$notification->notify();
-//     $info = array();
-//     $Form->getInfo($vars, $info);
-//
-//     $name = $info['name'];
-//     $extension = $info['extension'];
-//     $newextension = $info['newextension'];
-//     $email = $info['email'];
-//     $pin = $info['pin'];
-//
-//
-//     $limits = $shout->getLimits($context, $extension);
-//
-//     $userdetails = array("newextension" => $newextension,
-//                 "name" => $name,
-//                 "pin" => $pin,
-//                 "email" => $email);
-//
-//     $i = 1;
-//     $userdetails['telephonenumbers'] = array();
-//     while ($i <= $limits['telephonenumbersmax']) {
-//         $tmp = $info['telephone'.$i];
-//         if (!empty($tmp)) {
-//             $userdetails['telephonenumbers'][] = $tmp;
-//         }
-//         $i++;
-//     }
-//
-//     $userdetails['dialopts'] = array();
-//     if ($info['moh']) {
-//         $userdetails['dialopts'][] = 'm';
-//     }
-//     if ($info['transfer']) {
-//         $userdetails['dialopts'][] = 't';
-//     }
-}
\ No newline at end of file
diff --git a/usermgr/list.php b/usermgr/list.php
deleted file mode 100644 (file)
index 45cfc22..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-/**
- * $Id$
- *
- * Copyright 2005-2006 Ben Klang <ben@alkaloid.net>
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package shout
- */
-
-if (!isset($SHOUT_RUNNING) || !$SHOUT_RUNNING) {
-    header('Location: /');
-    exit();
-}
-
-$users = &$shout->getUsers($context);
diff --git a/usermgr/save.php b/usermgr/save.php
deleted file mode 100644 (file)
index e5a9355..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-/**
- * $Id$
- *
- * Copyright 2005-2006 Ben Klang <ben@alkaloid.net>
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @package shout
- */
-if (!isset($SHOUT_RUNNING) || !$SHOUT_RUNNING) {
-    header('Location: /');
-    exit();
-}
-
-require_once SHOUT_BASE . '/lib/User.php';
-require_once 'Horde/Variables.php';
-
-$RENDERER = &new Horde_Form_Renderer();
-
-$vars = &Variables::getDefaultVariables();
-$FormName = $vars->get('formname');
-
-$Form = &Horde_Form::singleton($FormName, $vars);
-
-$FormValid = $Form->validate($vars, true);
-
-if (!$FormValid || !$Form->isSubmitted()) {
-    require SHOUT_BASE . '/usermgr/edit.php';
-} else {
-    # Form is Valid and Submitted
-    $extension = $vars->get('extension');
-
-    $limits = $shout->getLimits($context, $extension);
-
-    # FIXME: Input Validation (Text::??)
-    $userdetails = array(
-        "newextension" => $vars->get('newextension'),
-        "name" => $vars->get('name'),
-        "mailboxpin" => $vars->get('mailboxpin'),
-        "email" => $vars->get('email'),
-        "uid" => $vars->get('uid'),
-    );
-
-    $userdetails['telephonenumber'] = array();
-    $telephonenumber = $vars->get("telephonenumber");
-    if (!empty($telephonenumber) && is_array($telephonenumber)) {
-        $i = 1;
-        while ($i <= $limits['telephonenumbersmax']) {
-            if (!empty($telephonenumber[$i])) {
-                $userdetails['telephonenumber'][] = $telephonenumber[$i++];
-            } else {
-                $i++;
-            }
-        }
-    }
-
-    $userdetails['dialopts'] = array();
-
-    if ($vars->get('moh')) {
-        $userdetails['dialopts'][] = 'm';
-    }
-    if ($vars->get('transfer')) {
-        $userdetails['dialopts'][] = 't';
-    }
-    if ($vars->get('eca')) {
-        $userdetails['dialopts'][] = 'e';
-    }
-    $res = $shout->saveUser($context, $extension, $userdetails);
-    if (is_a($res, 'PEAR_Error')) {
-        $notification->push($res);
-    } else {
-        $notification->push('User information updated.  '.
-            'Changes will take effect within 10 minutes',
-            'horde.success');
-    }
-
-    $notification->notify();
-}