From: Ben Klang Date: Sun, 20 Dec 2009 22:08:18 +0000 (+0000) Subject: Rename to match new UI X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7b05837f7f60d65bf526d8bc503b847ebd304af4;p=horde.git Rename to match new UI git-svn-id: https://svn.alkaloid.net/gpl/shout/trunk@493 06cd67b6-e706-0410-b29e-9de616bca6e9 --- diff --git a/extensions/add.php b/extensions/add.php new file mode 100644 index 000000000..16f3f3b8c --- /dev/null +++ b/extensions/add.php @@ -0,0 +1,12 @@ + + * + * 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 index 000000000..4400c5e36 --- /dev/null +++ b/extensions/delete.php @@ -0,0 +1,26 @@ + + * + * 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 index 000000000..3c3fe1e9f --- /dev/null +++ b/extensions/edit.php @@ -0,0 +1,93 @@ + + * + * 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 index 000000000..45cfc22c4 --- /dev/null +++ b/extensions/list.php @@ -0,0 +1,18 @@ + + * + * 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 index 000000000..e5a935501 --- /dev/null +++ b/extensions/save.php @@ -0,0 +1,80 @@ + + * + * 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 index 16f3f3b8c..000000000 --- a/usermgr/add.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * 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 index 4400c5e36..000000000 --- a/usermgr/delete.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * 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 index 3c3fe1e9f..000000000 --- a/usermgr/edit.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * 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 index 45cfc22c4..000000000 --- a/usermgr/list.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * 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 index e5a935501..000000000 --- a/usermgr/save.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * 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(); -}