*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$perm_templ = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
    $perm_templ = $_GET['id'];
}
$confirm = "-1";
if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
    $confirm = $_GET['confirm'];
}
if ($perm_templ == "-1") {
    error(ERR_INV_INPUT);
} else {
    if (!verify_permission('user_edit_templ_perm')) {
        error(ERR_PERM_DEL_PERM_TEMPL);
    } else {
        $templ_details = get_permission_template_details($perm_templ);
        echo "     <h2>" . _('Delete permission template') . " \"" . $templ_details['name'] . "\"</h2>\n";
        if (isset($_GET['confirm']) && $_GET["confirm"] == '1') {
            delete_perm_templ($perm_templ);
            success(SUC_PERM_TEMPL_DEL);
        } else {
            echo "     <p>" . _('Are you sure?') . "</p>\n";
            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_perm_templ.php?id=" . $perm_templ . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
        }
    }
}
include_once "inc/footer.inc.php";
コード例 #2
0
ファイル: edit_perm_templ.php プロジェクト: kitpz2/grupappz
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$id = "-1";
if (isset($_GET['id']) || v_num($_GET['id'])) {
    $id = $_GET['id'];
}
if ($id == "-1") {
    error(ERR_INV_INPUT);
} elseif (!verify_permission('templ_perm_edit')) {
    error(ERR_PERM_EDIT_PERM_TEMPL);
} else {
    $id = $_GET['id'];
    if (isset($_POST['commit'])) {
        update_perm_templ_details($_POST);
    }
    $templ = get_permission_template_details($id);
    $perms_templ = get_permissions_by_template_id($id);
    $perms_avail = get_permissions_by_template_id();
    echo "    <h2>" . _('Edit permission template') . "</h2>\n";
    echo "    <form method=\"post\">\n";
    echo "    <input type=\"hidden\" name=\"templ_id\" value=\"" . $id . "\">\n";
    echo "     <table>\n";
    echo "      <tr>\n";
    echo "       <th>" . _('Name') . "</th>\n";
    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"" . $templ['name'] . "\"></td>\n";
    echo "      </tr>\n";
    echo "      <tr>\n";
    echo "       <th>" . _('Description') . "</th>\n";
    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"" . $templ['descr'] . "\"></td>\n";
    echo "      </tr>\n";
    echo "     </table>\n";