--- /dev/null
+<?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
--- /dev/null
+<?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
--- /dev/null
+<?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
--- /dev/null
+<?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);
--- /dev/null
+<?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();
+}
+++ /dev/null
-<?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
+++ /dev/null
-<?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
+++ /dev/null
-<?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
+++ /dev/null
-<?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);
+++ /dev/null
-<?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();
-}