Beispiel #1
0
} else {
    $permission =& $perms->getPermissionById($cid);
}
/* If the permission fetched is an error return to the permissions
 * list. */
if (is_a($permission, 'PEAR_Error')) {
    $notification->push(_("Attempt to edit a non-existent permission."), 'horde.error');
    $url = Horde::applicationUrl('admin/perms/index.php', true);
    header('Location: ' . $url);
    exit;
}
$form =& Horde_Form::singleton('', $vars);
$form->setButtons(_("Update"), true);
$form->addHidden('', 'cid', 'text', false);
/* Set up the columns for the permissions matrix. */
$cols = Perms::getPermsArray();
/* Default permissions. */
$perm_val = $permission->getDefaultPermissions();
/* Define a single matrix row for default perms. */
$matrix = array();
$matrix[0] = Perms::integerToArray($perm_val);
$form->setSection('default', Horde::img('perms.gif') . ' ' . _("Default Permissions"), false);
$form->addVariable(_("Default permissions"), 'default', 'matrix', false, false, null, array($cols, array(0 => ''), $matrix));
/* Guest permissions. */
$perm_val = $permission->getGuestPermissions();
/* Define a single matrix row for guest perms. */
$matrix = array();
$matrix[0] = Perms::integerToArray($perm_val);
$form->setSection('guest', Horde::img('guest.gif') . ' ' . _("Guest Permissions"), false);
$form->addVariable(_("Guest permissions"), 'guest', 'matrix', false, false, null, array($cols, array(0 => ''), $matrix));
/* Object creator permissions. */