예제 #1
0
        if (!empty($LANG['banned_edit_subtitle'])) {
            echo '<span>' . $LANG['banned_edit_subtitle'] . '</span>';
        }
        echo '</div>';
        if ($banned_exists) {
            if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['csrf']) && check_csrf($_POST['csrf'], 'banned_csrf')) {
                if (isset($_POST['ip']) && valid_ip($_POST['ip'])) {
                    if (actions::edit_banned($_GET['id'], array('ipaddr' => $_POST['ip'], 'registration' => isset($_POST['register']) ? 1 : 0, 'login' => isset($_POST['login']) ? 1 : 0, 'site' => isset($_POST['shn-site']) ? 1 : 0, 'redirect' => isset($_POST['redirect']) ? $_POST['redirect'] : '', 'expiration' => !isset($_POST['shn-expiration']) ? 1 : 0, 'expiration_date' => !isset($_POST['shn-expiration']) && isset($_POST['expiration']) ? $_POST['expiration']['date'] . ', ' . $_POST['expiration']['hour'] : ''))) {
                        echo '<div class="a-success">' . $LANG['msg_saved'] . '</div>';
                    } else {
                        echo '<div class="a-error">' . $LANG['msg_error'] . '</div>';
                    }
                }
            }
            $_SESSION['banned_csrf'] = $csrf;
            $info = admin_query::banned_infos($_GET['id']);
            echo '<div class="form-table">

<form action="#" method="POST" enctype="multipart/form-data">

<div class="row"><span>' . $LANG['form_ip'] . ':</span><div><input type="text" name="ip" value="' . $info->IP . '" required /></div></div>
<div class="row"><span>' . $LANG['bann_form_block'] . ':</span><div>
<input type="checkbox" name="register" id="register"' . ($info->registration ? ' checked' : '') . ' /> <label for="register">' . $LANG['bann_registrations'] . '</label> <br />
<input type="checkbox" name="login" id="login"' . ($info->login ? ' checked' : '') . ' /> <label for="login">' . $LANG['bann_login'] . '</label> <br />
<input type="checkbox" name="shn-site" id="site"' . ($info->site ? ' checked' : '') . ' /> <label for="site">' . $LANG['bann_site'] . '</label>
</div></div>
<div class="row"' . (!$info->site ? ' style="display: none;"' : '') . '><span>' . $LANG['bann_form_redirect'] . ':</span><div><input type="text" name="redirect" value="' . $info->redirect_to . '" /></div></div>
<div class="row" style="display: none;"><span>' . $LANG['bann_form_redirect'] . ':</span><div><input type="text" name="redirect" value="http://" /></div></div>
<div class="row"><span>' . $LANG['bann_form_expiration'] . ':</span><div>
<input type="checkbox" name="shn-expiration" id="expiration" ' . (!$info->expiration ? ' checked' : '') . ' /> <label for="expiration">' . $LANG['bann_neverexp'] . '</label>
</div></div>