list_perm_templ.php
changeset 82 c255196bc447
child 85 1687c1b107fa
equal deleted inserted replaced
81:c72d6d51f3d3 82:c255196bc447
       
     1 <?php
       
     2 
       
     3 /*  PowerAdmin, a friendly web-based admin tool for PowerDNS.
       
     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>&nbsp;</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>&nbsp;</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";
       
    59 }
       
    60 
       
    61 include_once("inc/footer.inc.php");
       
    62 ?>