82
|
1 |
<?php |
|
2 |
|
119
|
3 |
/* Poweradmin, a friendly web-based admin tool for PowerDNS. |
82
|
4 |
* See <https://rejo.zenger.nl/poweradmin> for more details. |
|
5 |
* |
|
6 |
* Copyright 2007, 2008 Rejo Zenger <rejo@zenger.nl> |
|
7 |
* |
|
8 |
* This program is free software: you can redistribute it and/or modify |
|
9 |
* it under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
11 |
* (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
*/ |
|
21 |
|
|
22 |
require_once("inc/toolkit.inc.php"); |
|
23 |
include_once("inc/header.inc.php"); |
|
24 |
verify_permission(templ_perm_edit) ? $perm_templ_perm_edit = "1" : $perm_templ_perm_edit = "0" ; |
|
25 |
|
|
26 |
$permission_templates = get_list_permission_templates() ; |
|
27 |
|
|
28 |
if ($perm_templ_perm_edit == "0") { |
|
29 |
error(ERR_PERM_EDIT_PERM_TEMPL); |
|
30 |
} else { |
|
31 |
echo " <h2>" . _('Permission templates') . "</h2>\n"; |
|
32 |
echo " <table>\n"; |
|
33 |
echo " <tr>\n"; |
|
34 |
echo " <th> </th>\n"; |
|
35 |
echo " <th>" . _('Name') . "</th>\n"; |
|
36 |
echo " <th>" . _('Description') . "</th>\n"; |
|
37 |
echo " </tr>\n"; |
|
38 |
|
|
39 |
foreach ($permission_templates as $template) { |
|
40 |
|
|
41 |
$perm_item_list = get_permissions_by_template_id($template['id'], true); |
|
42 |
$perm_items = implode(', ', $perm_item_list); |
|
43 |
|
|
44 |
echo " <tr>\n"; |
|
45 |
if ($perm_templ_perm_edit == "1") { |
|
46 |
echo " <td>\n"; |
|
47 |
echo " <a href=\"edit_perm_templ.php?id=" . $template["id"] . "\"><img src=\"images/edit.gif\" alt=\"[ " . _('Edit template') . "\" ]></a>\n"; |
|
48 |
echo " <a href=\"delete_perm_templ.php?id=" . $template["id"] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete template') . "\" ]></a>\n"; |
|
49 |
echo " </td>\n"; |
|
50 |
} else { |
|
51 |
echo " <td> </td>\n"; |
|
52 |
} |
|
53 |
echo " <td class=\"y\">" . $template['name'] . "</td>\n"; |
|
54 |
echo " <td class=\"y\">" . $template['descr'] . "</td>\n"; |
|
55 |
echo " </tr>\n"; |
|
56 |
} |
|
57 |
|
|
58 |
echo " </table>\n"; |
110
|
59 |
echo " <ul>\n"; |
|
60 |
echo " <li><a href=\"add_perm_templ.php\">" . _('Add permission template') . "</a>.</li>\n"; |
|
61 |
echo " </ul>\n"; |
82
|
62 |
} |
|
63 |
|
|
64 |
include_once("inc/footer.inc.php"); |
|
65 |
?> |