Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > dca483b59ba61f3fa092de932ddd570e > files > 216

nuface-2.0.14-2mdv2009.1.i586.rpm

<?php
# Copyright(C) 2008 INL http://www.inl.fr/
# Written by Victor Stinner <victor.stinner AT inl.fr>
#
# $Id: edit_acl.php 12484 2008-01-23 16:34:24Z haypo $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
#  This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.

require_once('function.php');    // formSeparator()

$LOG_LIMITS = Array(
    '1/s' => _('1 connection/sec'),
    '5/s' => _('5 connections/sec'),
    '25/s' => _('25 connections/sec'),
    '100/s' => _('100 connections/sec'),
    'unlimited' => _('Unlimited log'),
);

function aclGetLog()
{
    global $LOG_LIMITS, $NO_LOG;

    $log = getHttpCheckbox('log');
    if ($log) {
        $log = getHttp('log_limit');
        if (!in_array($log, array_keys($LOG_LIMITS))) {
            $log = 'unlimited';
        }
    } else {
        $log = $NO_LOG;
    }
    return $log;
}

function editAclLog($acl)
{
    global $LOG_LIMITS, $NO_LOG;

    print "<tr><td class=\"rowtitle\">"._('Log')."</td>";
    print '<td colspan="2">';
    if ($acl->log != $NO_LOG) {
        $use_log = true;
        $limit = $acl->log;
    } else {
        $use_log = false;
        $limit = 'unlimited';
    }
    $js = "log_checkbox();";
    html_checkbox('log', $use_log, null, Array('id'=>'log', 'onchange' => $js));
    echo ' '._('Limit:').' ';
    select_array('log_limit', $LOG_LIMITS, $limit, $default=null, $attr=Array('id'=>'log_limit'));
    html_javascript($js, true);
    print "</td></tr>";

    print "<tr><td class=\"rowtitle\">"._('Log message')."</td>";
    print '<td colspan="2">';
    $attr = Array('id' => 'log_prefix', 'max_length' => 30, 'size' => 30);
    html_input_text("log_prefix", $acl->log_prefix, $attr);
    print "</td></tr>";
}

function editAclTitle($acl, $support_copy)
{
    global $title;
    print "<h3>";
    echo sprintf(_('Edit %s (%s)'), $acl->str(), $acl->modified);
    if ($support_copy) {
        copyIcon("$title.php?copy=".$acl->ID, _("Copy the ACL"));
    }
    $msg = sprintf(_('Are you sure that you want to delete %s?'), $acl->str());
    deleteIcon("$title.php?delete=".$acl->ID, _("Delete the ACL"), $msg);
    echo "</h3>\n";
}

?>