list_perm_templ.php
author rejo
Thu, 24 Apr 2008 22:33:28 +0000
changeset 141 1ede5203910d
parent 126 cb06e3e29ed8
permissions -rw-r--r--
[feladat @ 247] If the user was listing the details of a zone that did not exist, all kinds of error messages were given. Now we first determine if the ID is valid and if not, immediately return the correct error message.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
82
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
     1
<?php
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
     2
119
f74e4f88b680 [feladat @ 222]
rejo
parents: 110
diff changeset
     3
/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
82
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
     4
 *  See <https://rejo.zenger.nl/poweradmin> for more details.
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
     5
 *
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
     6
 *  Copyright 2007, 2008  Rejo Zenger <rejo@zenger.nl>
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
     7
 *
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
     8
 *  This program is free software: you can redistribute it and/or modify
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
     9
 *  it under the terms of the GNU General Public License as published by
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    10
 *  the Free Software Foundation, either version 3 of the License, or
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    11
 *  (at your option) any later version.
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    12
 *
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    13
 *  This program is distributed in the hope that it will be useful,
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    16
 *  GNU General Public License for more details.
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    17
 *
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    18
 *  You should have received a copy of the GNU General Public License
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    20
 */
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    21
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    22
require_once("inc/toolkit.inc.php");
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    23
include_once("inc/header.inc.php");
126
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    24
verify_permission('templ_perm_edit') ? $perm_templ_perm_edit = "1" : $perm_templ_perm_edit = "0" ;
82
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    25
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    26
$permission_templates = get_list_permission_templates() ;
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    27
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    28
if ($perm_templ_perm_edit == "0") {
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    29
	error(ERR_PERM_EDIT_PERM_TEMPL);
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    30
} else {
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    31
	echo "    <h2>" . _('Permission templates') . "</h2>\n"; 
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    32
	echo "     <table>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    33
	echo "      <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    34
	echo "       <th>&nbsp;</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    35
	echo "       <th>" . _('Name') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    36
	echo "       <th>" . _('Description') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    37
	echo "      </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    38
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    39
	foreach ($permission_templates as $template) {
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    40
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    41
		$perm_item_list = get_permissions_by_template_id($template['id'], true);
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    42
		$perm_items = implode(', ', $perm_item_list);
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    43
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    44
		echo "      <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    45
		if ($perm_templ_perm_edit == "1") {
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    46
			echo "       <td>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    47
			echo "        <a href=\"edit_perm_templ.php?id=" . $template["id"] . "\"><img src=\"images/edit.gif\" alt=\"[ " . _('Edit template') . "\" ]></a>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    48
			echo "        <a href=\"delete_perm_templ.php?id=" . $template["id"] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete template') . "\" ]></a>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    49
			echo "       </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    50
		} else {
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    51
			echo "       <td>&nbsp;</td>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    52
		}
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    53
		echo "       <td class=\"y\">" . $template['name'] . "</td>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    54
		echo "       <td class=\"y\">" . $template['descr'] . "</td>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    55
		echo "      </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    56
	}
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    57
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    58
	echo "     </table>\n";
110
455405c757e1 [feladat @ 210]
rejo
parents: 85
diff changeset
    59
	echo "     <ul>\n";
455405c757e1 [feladat @ 210]
rejo
parents: 85
diff changeset
    60
        echo "      <li><a href=\"add_perm_templ.php\">" . _('Add permission template') . "</a>.</li>\n";
455405c757e1 [feladat @ 210]
rejo
parents: 85
diff changeset
    61
	echo "     </ul>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    62
}
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    63
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    64
include_once("inc/footer.inc.php");
c255196bc447 [feladat @ 182]
rejo
parents:
diff changeset
    65
?>