[dev] Patch for Applications Permissions

Joel Vandal jvandal at infoteck.qc.ca
Tue Sep 30 20:40:56 PDT 2003


Hi,

Yesterday, I've begin to work on an Application Permission system for Horde
Framework. After a few hours, I've come with a patch (see attachment) that
allow me to control some permissions on each applications (ex. Gollem,
Kronolith, Mnemo, ...)

This patch apply to the latest CVS version ...

Currently, you can set if the application will be accessible or not
(_PERMS_SHOW) by Users and/or Groups. If the application is  added to the
Application Permissions system and the user don't have permission to show
the application, the app will not be visible on the menu (menu.php).

In a future version, the system will be able to set permission by function
and preferences setting.

Here is an example for Gollem of the modification to apply for deny access
IF and ONLY IF the application is set on the Application Permissions and
that the user have no right to this.:

Index: lib/base.php
===================================================================
RCS file: /repository/gollem/lib/base.php,v
retrieving revision 1.37
diff -r1.37 base.php
30a31,39
> // Application Permissions system.
> require_once HORDE_BASE . '/lib/Perms.php';
> $appPerms = &Perms::singleton('horde.apps');
> if ($appPerms->exists($registry->getApp())) {
>     if (!$appPerms->hasPermission($registry->getApp(), Auth::GetAuth(),
_PERMS_SHOW)) {
>       Horde::authenticationFailureRedirect();
>     }
> }
>

--
Joel Vandal
Infoteck Internet
-------------- next part --------------
Index: menu.php
===================================================================
RCS file: /repository/horde/menu.php,v
retrieving revision 2.44
diff -r2.44 menu.php
18c18
<     global $registry;
---
>     global $registry, $appPerms;
39a40,43
>               if ($appPerms->exists($capp) &&
>                   !$appPerms->hasPermission($capp, Auth::GetAuth(), _PERMS_SHOW)) {
>                   $active = false;
>               }
66a71,75
> // Application Permissions system.
> require_once HORDE_BASE . '/lib/Perms.php';
> $appPerms = &Perms::singleton('horde.apps');
>
>
77a87,91
>
>     if ($appPerms->exists($app) && !$appPerms->hasPermission($app, Auth::GetAuth(), _PERMS_SHOW)) {
>       $params['status'] = 'inactive';
>     }
>

Index: Perms.php
===================================================================
RCS file: /repository/horde/lib/Perms.php,v
retrieving revision 1.46
diff -r1.46 Perms.php
45c45
<     function Perms()
---
>     function Perms($group = 'horde.perms')
55c55
<                                                          array('group' => 'horde.perms')));
---
>                                                          array('group' => $group)));
64a65,67
>      * @param string $group  (optional) The Permission Group to use.
>      *                       Defaults to horde.perms.
>      *
68c71
<     function &singleton()
---
>     function &singleton($group = 'horde.perms')
73c76
<             $perm = &new Perms();
---
>             $perm = &new Perms($group);

Index: api.php
===================================================================
RCS file: /repository/horde/lib/api.php,v
retrieving revision 1.14
diff -r1.14 api.php
72a73,77
>                  'apps' => array(
>                      'link' => '%application%/admin/application.php',
>                      'name' => _("Applications"),
>                      'icon' => 'group.gif'),
>

Index: application.php
===================================================================
RCS file: /repository/horde/admin/application.php,v
retrieving revision 1.01
diff -r1.01 application.php
0a1,283
> <?php
> /**
>  * $Horde: horde/admin/application.php,v 1.01 2003/09/30 23:15:31 jrv Exp $
>  *
>  * Copyright 2003 Joel Vandal <jvandal at infoteck.qc.ca>
>  * Copyright 1999, 2000, 2001 Chuck Hagenbuch <chuck at horde.org>
>  *
>  * See the enclosed file COPYING for license information (LGPL). If you
>  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
>  */
>
> define('HORDE_BASE', dirname(__FILE__) . '/..');
> require_once HORDE_BASE . '/lib/base.php';
> require_once HORDE_BASE . '/lib/Menu.php';
> require_once HORDE_BASE . '/lib/Perms.php';
> require_once HORDE_BASE . '/lib/Group.php';
> require_once HORDE_BASE . '/lib/Tree.php';
>
> if (!Auth::isAdmin()) {
>     Horde::authenticationFailureRedirect();
> }
>
> Horde::compressOutput();
>
> $apps = &Perms::singleton('horde.apps');
> $groups = &Group::singleton();
> $auth = &Auth::singleton($conf['auth']['driver']);
>
> $form = null;
> $reload = false;
> $actionID = Util::getFormData('actionID');
> switch ($actionID) {
>
> case 'addchild':
>     if (Util::getFormData('cid') == '-1') {
>         $form = 'addchild.inc';
>         $pname = _("All Permissions");
>     } else {
>         $_app = &$apps->getPermissionById(Util::getFormData('cid'));
>         if (!is_a($_app, 'PEAR_Error')) {
>             $pname = $_app->getShortName();
>             $form = 'addchild.inc';
>         }
>     }
>     break;
>
> case 'addchildform':
>     $parent = Util::getFormData('cid');
>     if ($parent == '-1') {
>         $child = &$apps->newPermission(Util::getFormData('child'));
>         $result = $apps->addPermission($child);
>     } else {
>         $pOb = &$apps->getPermissionById($parent);
>         $name = $pOb->getName() . ':' . Category::encodeName(Util::getFormData('child'));
>         $child = &$apps->newPermission($name);
>         $result = $apps->addPermission($child);
>     }
>     if (is_a($result, 'PEAR_Error')) {
>         $notification->push(sprintf(_("'%s' was not created: %s."), $child->getShortName(), $result->getMessage()), 'horde.error');
>     } else {
>         $notification->push(sprintf(_("'%s' was added to the permissions system."), $child->getShortName()), 'horde.success');
>         $_app = &$child;
>         $form = 'edit.inc';
>         $reload = true;
>     }
>     break;
>
> case 'delete':
>     $_app = &$apps->getPermissionById(Util::getFormData('cid'));
>     if (!is_a($_app, 'PEAR_Error')) {
>         $form = 'delete.inc';
>     }
>     break;
>
> case 'deleteform':
>     if (Util::getFormData('confirm') == _("Delete")) {
>         $_app = &$apps->getPermissionById(Util::getFormData('cid'));
>         if (is_a($_app, 'PEAR_Error')) {
>             $notification->push(_("Attempt to delete a non-existent permission."), 'horde.error');
>         } else {
>             $result = $apps->removePermission($_app, true);
>             if (is_a($result, 'PEAR_Error')) {
>                 $notification->push(sprintf(_("Unable to delete '%s': %s."), $_app->getShortName(), $result->getMessage()), 'horde.error');
>             } else {
>                 $notification->push(sprintf(_("Successfully deleted '%s'."), $_app->getShortName()), 'horde.success');
>                 $reload = true;
>             }
>         }
>     }
>     break;
>
> case 'edit':
>     $_app = &$apps->getPermissionById(Util::getFormData('cid'));
>     if (!is_a($_app, 'PEAR_Error')) {
>         $form = 'edit.inc';
>     } elseif (($category = Util::getFormData('category')) !== null) {
>         $_app = &$apps->getPermission($category);
>         if (!is_a($_app, 'PEAR_Error')) {
>             $form = 'edit.inc';
>         } elseif (Util::getFormData('autocreate')) {
>             $parent = Util::getFormData('parent');
>             $_app = &$apps->newPermission($category);
>             $result = $apps->addPermission($_app, $parent);
>             if (!is_a($result, 'PEAR_Error')) {
>                 $form = 'edit.inc';
>             }
>         }
>     }
>     break;
>
> case 'editform':
>     $_app = &$apps->getPermissionById(Util::getFormData('cid'));
>     if (is_a($_app, 'PEAR_Error')) {
>         $notification->push(_("Attempt to edit a non-existent permission."), 'horde.error');
>     } else {
>         // Process default permissions.
>         if (Util::getFormData('default_show')) {
>             $_app->addDefaultPermission(_PERMS_SHOW, false);
>         } else {
>             $_app->removeDefaultPermission(_PERMS_SHOW, false);
>         }
>         if (Util::getFormData('default_read')) {
>             $_app->addDefaultPermission(_PERMS_READ, false);
>         } else {
>             $_app->removeDefaultPermission(_PERMS_READ, false);
>         }
>         if (Util::getFormData('default_edit')) {
>             $_app->addDefaultPermission(_PERMS_EDIT, false);
>         } else {
>             $_app->removeDefaultPermission(_PERMS_EDIT, false);
>         }
>         if (Util::getFormData('default_delete')) {
>             $_app->addDefaultPermission(_PERMS_DELETE, false);
>         } else {
>             $_app->removeDefaultPermission(_PERMS_DELETE, false);
>         }
>
>         // Process guest permissions.
>         if (Util::getFormData('guest_show')) {
>             $_app->addGuestPermission(_PERMS_SHOW, false);
>         } else {
>             $_app->removeGuestPermission(_PERMS_SHOW, false);
>         }
>         if (Util::getFormData('guest_read')) {
>             $_app->addGuestPermission(_PERMS_READ, false);
>         } else {
>             $_app->removeGuestPermission(_PERMS_READ, false);
>         }
>         if (Util::getFormData('guest_edit')) {
>             $_app->addGuestPermission(_PERMS_EDIT, false);
>         } else {
>             $_app->removeGuestPermission(_PERMS_EDIT, false);
>         }
>         if (Util::getFormData('guest_delete')) {
>             $_app->addGuestPermission(_PERMS_DELETE, false);
>         } else {
>             $_app->removeGuestPermission(_PERMS_DELETE, false);
>         }
>
>         // Process user permissions.
>         $u_names = Util::getFormData('u_names');
>         $u_show = Util::getFormData('u_show');
>         $u_read = Util::getFormData('u_read');
>         $u_edit = Util::getFormData('u_edit');
>         $u_delete = Util::getFormData('u_delete');
>
>         foreach ($u_names as $key => $user) {
>             if (empty($user)) {
>                 continue;
>             }
>
>             if (!empty($u_show[$key])) {
>                 $_app->addUserPermission($user, _PERMS_SHOW, false);
>             } else {
>                 $_app->removeUserPermission($user, _PERMS_SHOW, false);
>             }
>             if (!empty($u_read[$key])) {
>                 $_app->addUserPermission($user, _PERMS_READ, false);
>             } else {
>                 $_app->removeUserPermission($user, _PERMS_READ, false);
>             }
>             if (!empty($u_edit[$key])) {
>                 $_app->addUserPermission($user, _PERMS_EDIT, false);
>             } else {
>                 $_app->removeUserPermission($user, _PERMS_EDIT, false);
>             }
>             if (!empty($u_delete[$key])) {
>                 $_app->addUserPermission($user, _PERMS_DELETE, false);
>             } else {
>                 $_app->removeUserPermission($user, _PERMS_DELETE, false);
>             }
>         }
>
>         // Process group permissions.
>         $g_names = Util::getFormData('g_names');
>         $g_show = Util::getFormData('g_show');
>         $g_read = Util::getFormData('g_read');
>         $g_edit = Util::getFormData('g_edit');
>         $g_delete = Util::getFormData('g_delete');
>
>         foreach ($g_names as $key => $group) {
>             if (empty($group)) {
>                 continue;
>             }
>
>             if (!empty($g_show[$key])) {
>                 $_app->addGroupPermission($group, _PERMS_SHOW, false);
>             } else {
>                 $_app->removeGroupPermission($group, _PERMS_SHOW, false);
>             }
>             if (!empty($g_read[$key])) {
>                 $_app->addGroupPermission($group, _PERMS_READ, false);
>             } else {
>                 $_app->removeGroupPermission($group, _PERMS_READ, false);
>             }
>             if (!empty($g_edit[$key])) {
>                 $_app->addGroupPermission($group, _PERMS_EDIT, false);
>             } else {
>                 $_app->removeGroupPermission($group, _PERMS_EDIT, false);
>             }
>             if (!empty($g_delete[$key])) {
>                 $_app->addGroupPermission($group, _PERMS_DELETE, false);
>             } else {
>                 $_app->removeGroupPermission($group, _PERMS_DELETE, false);
>             }
>         }
>
>         $_app->save();
>         $notification->push(sprintf(_("Updated '%s'."), $_app->getShortName()), 'horde.success');
>         $reload = true;
>     }
>     break;
> }
>
> $title = _("Applications Administration");
> require HORDE_TEMPLATES . '/common-header.inc';
> require HORDE_TEMPLATES . '/admin/common-header.inc';
> $notification->notify();
> if (!empty($form)) {
>     require HORDE_TEMPLATES . '/admin/application/' . $form;
> }
>
> /* Get the perms tree. */
> $nodes = $apps->_perms->get(CATEGORY_FORMAT_FLAT, -1, true);
>
> /* Set up some node params. */
> $current = Util::getFormData('cid');
> $icondir = array('icondir' => $registry->getParam('graphics'));
> $apps_node = $icondir + array('icon' => 'perms.gif');
> $add = Horde::applicationUrl('admin/application.php?actionID=addchild');
> $edit = Horde::applicationUrl('admin/application.php?actionID=edit');
> $delete = Horde::applicationUrl('admin/application.php?actionID=delete');
> $edit_img = Horde::img('edit.gif', _("Edit Application"));
> $delete_img = Horde::img('delete.gif', _("Delete Application"));
>
> /* Set up the tree. */
> $tree = &Horde_Tree::singleton('category_tree', 'javascript');
> $tree->setOption(array('border' => '0', 'class' => 'item', 'cellpadding' => '0', 'cellspacing' => '0', 'alternate' => true));
>
> foreach ($nodes as $cid => $node) {
>
>     $node_class = ($current == $cid) ? array('class' => 'selected') : array();
>     if ($cid == -1) {
>         $add_img = Horde::img('perms.gif', _("Add New Application"));
>         $add_link = Horde::link(Util::addParameter($add, 'cid', $cid), _("Add New Application")) . $add_img . '</a>';
>
>         $base_node_params = $icondir + array('icon' => 'administration.gif');
>         $tree->addNode($cid, null, _("All Applications"), 0, true, $base_node_params + $node_class, array($add_link));
>     } else {
>       // $add_img = Horde::img('perms.gif', _("Add Child Application"));
>       // $add_link = Horde::link(Util::addParameter($add, 'cid', $cid), _("Add Child Application")) . $add_img . '</a>';
>         $edit_link = Horde::link(Util::addParameter($edit, 'cid', $cid), _("Edit Application")) . $edit_img . '</a>';
>         $delete_link = Horde::link(Util::addParameter($delete, 'cid', $cid), _("Delete Application")) . $delete_img . '</a>';
>
>         $parent_id = $apps->_perms->getParent($node);
>         $apps_extra = array($edit_link, $delete_link);
>       $apps_name = $registry->getParam('name', Category::getShortName($node)) . ' (' . Category::getShortName($node) . ')';
>         $tree->addNode($cid, $parent_id, $apps_name, substr_count($node, ':') + 1, false, $apps_node + $node_class, $apps_extra);
>     }
> }
>
> $tree->renderTree();
> require HORDE_TEMPLATES . '/common-footer.inc';


Index: edit.inc
===================================================================
RCS file: /repository/horde/templates/admin/edit.inc,v
retrieving revision 1.01
diff -r1.01 edit.inc
0a1,134
> <form name="edit_permissions" method="post" action="application.php">
> <input type="hidden" name="actionID" value="editform" />
> <input type="hidden" name="cid" value="<?php echo $_app->getId() ?>" />
> <?php Util::pformInput() ?>
> <table border="0" width="100%" cellpadding="1" cellspacing="0">
> <tr valign="middle">
>   <td class="header" align="left" width="100%" colspan="5">
>     <?php Horde::pimg('perms.gif') ?>&nbsp;<b><?php echo sprintf(_("Edit permissions for '%s'"), $_app->getShortName()) ?></b>
>   </td>
> </tr>
> <tr><td>&nbsp;</td></tr>
>
> <!-- Default Applications -->
> <tr valign="middle">
>   <td class="header" align="left" width="25%">
>     <?php echo Horde::img('perms.gif') . '&nbsp;' . _("Default Permissions") ?>
>   </td>
>   <td class="header" align="center" width="1%"><?php echo _("Show") ?></td>
>   <td class="header" align="center" width="1%"><?php echo _("Read") ?></td>
>   <td class="header" align="center" width="1%"><?php echo _("Edit") ?></td>
>   <td class="header" align="right" width="70%"></td>
> </tr>
> <?php $perm = $_app->getDefaultPermissions(); ?>
> <tr>
>   <td class="light">&nbsp;</td>
>   <td align="center"><input type="checkbox" name="default_show"<?php echo ($perm & _PERMS_SHOW) ? ' checked="checked"' : '' ?> /></td>
>   <td align="center"><input type="checkbox" name="default_read"<?php echo ($perm & _PERMS_READ) ? ' checked="checked"' : '' ?> /></td>
>   <td align="center"><input type="checkbox" name="default_edit"<?php echo ($perm & _PERMS_EDIT) ? ' checked="checked"' : '' ?> /></td>
> </tr>
>
> <!-- Spacer -->
> <tr><td>&nbsp;</td></tr>
>
> <!-- Guest Permissions -->
> <tr valign="middle">
>   <td class="header" align="left" width="25%">
>     <?php echo Horde::img('guest.gif') . '&nbsp;' . _("Guest Permissions") ?>
>   </td>
>   <td class="header" align="center" width="1%"><?php echo _("Show") ?></td>
>   <td class="header" align="center" width="1%"><?php echo _("Read") ?></td>
>   <td class="header" align="center" width="1%"><?php echo _("Edit") ?></td>
>   <td class="header" align="right" width="70%"></td>
> </tr>
> <?php $perm = $_app->getGuestPermissions(); ?>
> <tr>
>   <td class="light">&nbsp;</td>
>   <td align="center"><input type="checkbox" name="guest_show"<?php echo ($perm & _PERMS_SHOW) ? ' checked="checked"' : '' ?> /></td>
>   <td align="center"><input type="checkbox" name="guest_read"<?php echo ($perm & _PERMS_READ) ? ' checked="checked"' : '' ?> /></td>
>   <td align="center"><input type="checkbox" name="guest_edit"<?php echo ($perm & _PERMS_EDIT) ? ' checked="checked"' : '' ?> /></td>
> </tr>
>
> <!-- Spacer -->
> <tr><td>&nbsp;</td></tr>
>
> <!-- User Permissions -->
> <tr valign="middle">
>   <td class="header" align="left" width="25%">
>     <?php echo Horde::img('user.gif') . '&nbsp;' . _("Users") ?>
>   </td>
>   <td class="header" align="center" width="1%"><?php echo _("Show") ?></td>
>   <td class="header" align="center" width="1%"><?php echo _("Read") ?></td>
>   <td class="header" align="center" width="1%"><?php echo _("Edit") ?></td>
>   <td class="header" align="right" width="70%"></td>
> </tr>
> <?php $userperms = $_app->getUserPermissions(); foreach ($userperms as $user => $perm): ?>
> <tr>
>   <td class="light"><?php echo $user ?><input type="hidden" name="u_names[<?php echo $user ?>]" value="<?php echo $user ?>" /></td>
>   <td align="center"><input type="checkbox" name="u_show[<?php echo $user ?>]"<?php echo ($perm & _PERMS_SHOW) ? ' checked="checked"' : '' ?> /></td>
>   <td align="center"><input type="checkbox" name="u_read[<?php echo $user ?>]"<?php echo ($perm & _PERMS_READ) ? ' checked="checked"' : '' ?> /></td>
>   <td align="center"><input type="checkbox" name="u_edit[<?php echo $user ?>]"<?php echo ($perm & _PERMS_EDIT) ? ' checked="checked"' : '' ?> /></td>
> </tr>
> <?php endforeach; ?>
> <!-- New user row -->
> <tr>
> <?php if ($auth->hasCapability('list')): ?>
>   <td class="light">
>     <select name="u_names[||new]">
>       <option value=""><?php echo _("Select") . ':'; ?></option>
>     <?php foreach ($auth->listUsers() as $user) { if (!isset($userperms[$user])) { ?>
>       <option value="<?php echo $user ?>"><?php echo $user ?></option>
>     <?php } } ?>
>     </select>
>   </td>
> <?php else: ?>
>   <td class="light"><input type="text" name="u_names[||new]" /></td>
> <?php endif; ?>
>   <td align="center"><input type="checkbox" name="u_show[||new]" /></td>
>   <td align="center"><input type="checkbox" name="u_read[||new]" /></td>
>   <td align="center"><input type="checkbox" name="u_edit[||new]" /></td>
> </tr>
>
> <!-- Spacer -->
> <tr><td>&nbsp;</td></tr>
>
> <!-- Group Permissions -->
> <tr valign="middle">
>   <td class="header" align="left" width="25%">
>     <?php echo Horde::img('group.gif') . '&nbsp;' . _("Groups") ?>
>   </td>
>   <td class="header" align="center" width="1%"><?php echo _("Show") ?></td>
>   <td class="header" align="center" width="1%"><?php echo _("Read") ?></td>
>   <td class="header" align="center" width="1%"><?php echo _("Edit") ?></td>
>   <td class="header" align="right" width="70%"></td>
> </tr>
> <?php $groupperms = $_app->getGroupPermissions(); foreach ($groupperms as $group => $perm): ?>
> <tr>
>   <td class="light"><?php echo $groups->getGroupName($group) ?><input type="hidden" name="g_names[<?php echo $group ?>]" value="<?php echo $group ?>" /></td>
>   <td align="center"><input type="checkbox" name="g_show[<?php echo $group ?>]"<?php echo ($perm & _PERMS_SHOW) ? ' checked="checked"' : '' ?> /></td>
>   <td align="center"><input type="checkbox" name="g_read[<?php echo $group ?>]"<?php echo ($perm & _PERMS_READ) ? ' checked="checked"' : '' ?> /></td>
>   <td align="center"><input type="checkbox" name="g_edit[<?php echo $group ?>]"<?php echo ($perm & _PERMS_EDIT) ? ' checked="checked"' : '' ?> /></td>
> </tr>
> <?php endforeach; ?>
> <!-- New group row -->
> <tr>
>   <td class="light">
>     <select name="g_names[||new]">
>       <option value=""><?php echo _("Select") . ':'; ?></option>
>     <?php $groupList = $groups->listGroups(); foreach ($groupList as $gid => $group) { if (!isset($groupperms[$gid])) { ?>
>       <option value="<?php echo htmlspecialchars($gid) ?>"><?php echo htmlspecialchars($group) ?></option>
>     <?php } } ?>
>     </select>
>       </td>
>   <td align="center"><input type="checkbox" name="g_show[||new]" /></td>
>   <td align="center"><input type="checkbox" name="g_read[||new]" /></td>
>   <td align="center"><input type="checkbox" name="g_edit[||new]" /></td>
> </tr>
>
> <tr>
>   <td><input type="submit" class="button" value="<?php printf(_("Save '%s'"), $_app->getShortName()) ?>" /></td>
> </tr>
>
> </table>
> </form>
> <br />

Index: addchild.inc
===================================================================
RCS file: /repository/horde/templates/admin/addchild.inc,v
retrieving revision 1.01
diff -r1.01 addchild.inc
0a1,44
> <form name="add_child" method="post" action="application.php">
> <input type="hidden" name="actionID" value="addchildform" />
> <input type="hidden" name="cid" value="<?php echo (int)Util::getFormData('cid') ?>" />
> <?php Util::pformInput() ?>
>
> <table border="0" width="100%" cellpadding="1" cellspacing="1">
> <tr valign="middle" class="menu">
>   <td class="smallheader" align="left" width="100%" colspan="7">
>     <?php Horde::pimg('perms.gif') ?>&nbsp;<b><?php echo sprintf(_("Add a child permission to '%s'"), $pname) ?></b>
>   </td>
> </tr>
> <tr>
>   <td>
>   <?php
> require_once HORDE_BASE . '/lib/Form.php';
> require_once HORDE_BASE . '/lib/Form/Action.php';
> require_once HORDE_BASE . '/lib/Form/Renderer.php';
>
>   global $registry;
>     $a = $registry->listApps(array('inactive', 'hidden', 'notoolbar', 'active', 'acl'));
>     $_apps = array();
>     foreach ($a as $app) {
>         if (@file_exists($registry->getParam('fileroot', $app) . '/config/conf.xml')) {
>            if (!$apps->exists($app)) {
>                   $_apps[$app] = $registry->getParam('name', $app) . ' (' . $app . ')';
>            }
>         }
>     }
>     asort($_apps);
>     ?>
> <form method="post" action="setup.php" name="appselect">
>      <?php Util::pformInput() ?>
> <select name="child" onchange="document.appselect.submit()">
>      <?php echo Horde_Form_Renderer::_selectOptions($_apps) ?>
> </select>
>   </td>
> </tr>
> <tr>
>   <td><input type="submit" class="button" value="<?php echo _("Add") ?>" /></td>
> </tr>
>
> </table>
> </form>
> <br />

Index: delete.inc
===================================================================
RCS file: /repository/horde/templates/admin/delete.inc,v
retrieving revision 1.01
diff -r1.01 delete.inc
0a1,44
0a1,19
> <form name="delete" method="post" action="application.php">
> <input type="hidden" name="actionID" value="deleteform" />
> <input type="hidden" name="cid" value="<?php echo $_app->getId() ?>" />
> <?php Util::pformInput() ?>
>
> <table border="0" width="100%" cellpadding="1" cellspacing="1">
> <tr valign="middle" class="menu">
>   <td class="smallheader" align="left" width="100%" colspan="7">
>     <?php Horde::pimg('perms.gif') ?>&nbsp;<b><?php echo sprintf(_("Are you sure you wish to delete '%s' and any sub-applications?"), $_app->getShortName()) ?></b>
>   </td>
> </tr>
> <tr>
>   <td><input type="submit" class="button" name="confirm" value="<?php echo _("Delete") ?>" />
>       <input type="submit" class="button" name="confirm" value="<?php echo _("Cancel") ?>" /></td>
> </tr>
>
> </table>
> </form>
> <br />


More information about the dev mailing list