Files
mars-smart/settings.pl
Mario Fetka 6267ac3bf1 roleback
2026-05-21 21:12:44 +02:00

3322 lines
97 KiB
Perl

#
# SMArT
#
# Handle /settings/ requests
#
# Copyright 2001 Wilmer van der Gaast (lintux@lintux.cx)
#
#
# 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; either version 2 of the License, or
# (at your option) any later version.
#
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
sub html_escape( $ )
{
my $s = $_[0];
$s = '' unless defined $s;
$s =~ s/&/&/g;
$s =~ s/</&lt;/g;
$s =~ s/>/&gt;/g;
$s =~ s/"/&quot;/g;
return $s;
}
sub settings_nav_bar()
{
return <<'EOF_NAV';
<div class="settings-nav" style="position:sticky;top:0;z-index:20;margin:0 0 14px 0;padding:10px;background:#fffdf9;border:1px solid #ddcfba;border-radius:12px;box-shadow:0 4px 12px rgba(80,55,30,0.06);">
<a class="settings-nav-back" style="display:inline-block;margin-right:10px;padding:7px 12px;border-radius:9px;background:#6d5d53;color:#fff;text-decoration:none;font-weight:bold;" href="javascript:history.back()">Back</a>
<a class="settings-nav-main" style="display:inline-block;padding:7px 12px;border-radius:9px;background:#a32020;color:#fff;text-decoration:none;font-weight:bold;" href="/" target="_top">Main menu</a>
</div>
EOF_NAV
}
sub delete_confirm_attr( $ )
{
my $what = html_escape( $_[0] );
return ' onclick="return confirm(\'Delete ' . $what . '?\')"';
}
sub advanced_link_row( $$ )
{
my( $href, $label ) = @_;
return qq|\t<TR BGCOLOR="#d7c0a0">\n\t\t<TD COLSPAN=2><A HREF="$href"><B>$label</B></A></TD>\n\t</TR>\n|;
}
sub advanced_category()
{
my $cat = $c[2];
$cat = 'all' if ! defined( $cat ) || $cat eq '';
if( $cat =~ /^(devices|security|users|queues|configh|stations|network|all)$/ )
{
return $cat;
}
return 'all';
}
sub advanced_section_visible( $$ )
{
my( $cat, $section ) = @_;
return 1 if $cat eq 'all';
return 1 if $cat eq 'devices' && $section =~ /^(5)$/;
return 1 if $cat eq 'security' && $section =~ /^(8)$/;
return 1 if $cat eq 'users' && $section =~ /^(17)$/;
return 1 if $cat eq 'queues' && $section =~ /^(18|22)$/;
return 1 if $cat eq 'configh' && $section =~ /^(50|80)$/;
return 1 if $cat eq 'stations' && $section =~ /^(400|401|402)$/;
return 1 if $cat eq 'network' && $section =~ /^(310)$/;
return 0;
}
sub advanced_title( $ )
{
my $cat = $_[0];
return 'Advanced device settings' if $cat eq 'devices';
return 'Advanced security settings' if $cat eq 'security';
return 'Advanced user / bindery settings' if $cat eq 'users';
return 'Advanced print queue settings' if $cat eq 'queues';
return 'Advanced precompiled / path settings' if $cat eq 'configh';
return 'Advanced station access settings' if $cat eq 'stations';
return 'Advanced network watchdog settings' if $cat eq 'network';
return 'Advanced settings';
}
sub advanced_hidden_category_input( $ )
{
my $cat = $_[0];
return '' if ! defined( $cat ) || $cat eq '' || $cat eq 'all';
return '<INPUT TYPE=HIDDEN NAME="advanced_category" VALUE="' . html_escape( $cat ) . '">' . "\n";
}
sub cfg_int( $ )
{
my $v = $_[0];
$v = '' unless defined $v;
$v =~ s/^\s+//;
$v =~ s/\s+$//;
return 0 if $v eq '';
return oct( $v ) if $v =~ /^0x[0-9a-f]+$/i;
return int( $v );
}
sub cfg_checked( $$ )
{
my( $value, $mask ) = @_;
return ( cfg_int( $value ) & $mask ) ? ' CHECKED' : '';
}
sub html_selected( $$ )
{
return ( defined $_[0] && defined $_[1] && $_[0] eq $_[1] ) ? ' SELECTED' : '';
}
sub option_012( $ )
{
my $v = $_[0];
$v = '0' unless defined $v && $v ne '';
return
'<OPTION VALUE="0"' . html_selected( $v, '0' ) . '>0 - ignore station file / always allow</OPTION>' . "\n" .
'<OPTION VALUE="1"' . html_selected( $v, '1' ) . '>1 - station file is exclude list</OPTION>' . "\n" .
'<OPTION VALUE="2"' . html_selected( $v, '2' ) . '>2 - station file is include list</OPTION>' . "\n";
}
sub getconfiglines_without_section( $ )
{
my @lines = getconfig( $_[0] );
foreach my $line ( @lines )
{
$line =~ s/^\s*$_[0]\s+//;
}
return @lines;
}
$settings_nav_bar = settings_nav_bar();
sub kernel_network_interfaces()
{
my %interfaces = ();
if( opendir( my $dh, '/sys/class/net' ) )
{
foreach my $ifname ( readdir( $dh ) )
{
next if $ifname =~ /^\./;
next if $ifname =~ /[^-_\.A-Za-z0-9]/;
$interfaces{$ifname} = 1;
}
closedir( $dh );
}
return %interfaces;
}
sub ipx_enabled_interfaces()
{
my %ipx_interfaces = ();
# Modern Linux IPX procfs format:
# Network Node_Address Primary Device Frame_Type
# AC100B98 000000000001 Yes Internal None
# 00000022 508140F6AC45 No enp46s0u1u3u3 802.2
if( open( my $fh, '<', '/proc/net/ipx/interface' ) )
{
while( my $line = <$fh> )
{
chomp( $line );
$line =~ s/^\s+//;
$line =~ s/\s+$//;
next if $line eq '';
next if $line =~ /^Network\s+Node_Address\s+Primary\s+Device\s+Frame_Type/i;
my @fields = split( /\s+/, $line );
# Device is the fourth column. Do not scan all tokens, otherwise
# Network/Node/Frame_Type values can accidentally be treated as names.
next if scalar( @fields ) < 5;
my $dev = $fields[3];
next if ! defined( $dev );
next if $dev eq '';
next if lc( $dev ) eq 'internal';
next if $dev =~ /[^-_\.A-Za-z0-9]/;
# Only show real Linux network interfaces.
next if ! -e '/sys/class/net/' . $dev;
$ipx_interfaces{$dev} = 1;
}
close( $fh );
}
# Fallback for older distributions/tools, if present. This parser is kept
# deliberately conservative and still verifies /sys/class/net/<device>.
if( open( my $fh, '<', '/proc/net/ipx_interfaces' ) )
{
while( my $line = <$fh> )
{
chomp( $line );
$line =~ s/^\s+//;
$line =~ s/\s+$//;
next if $line eq '';
next if $line =~ /^(Network|Net|Address|Node|Interface|Device)\b/i;
foreach my $dev ( split( /\s+/, $line ) )
{
next if ! defined( $dev );
next if $dev eq '';
next if lc( $dev ) eq 'internal';
next if $dev =~ /[^-_\.A-Za-z0-9]/;
next if ! -e '/sys/class/net/' . $dev;
$ipx_interfaces{$dev} = 1;
}
}
close( $fh );
}
return sort keys %ipx_interfaces;
}
sub network_interface_options( $ )
{
my $current = $_[0];
my @interfaces = ();
my %seen = ();
my $html = '';
$current = '' unless defined $current;
# Only show interfaces where IPX is currently active. The current value is
# still preserved below, so an existing config entry is not lost if the
# interface is temporarily down or IPX is not loaded at display time.
foreach my $ifname ( ipx_enabled_interfaces() )
{
next if $seen{$ifname};
push( @interfaces, $ifname );
$seen{$ifname} = 1;
}
# Keep special/manual values usable even if they are not real kernel interfaces.
foreach my $ifname ( '*', 'auto', $current )
{
next if !defined( $ifname ) || $ifname eq '';
next if $seen{$ifname};
push( @interfaces, $ifname );
$seen{$ifname} = 1;
}
foreach my $ifname ( @interfaces )
{
my $selected = ( $ifname eq $current ) ? ' SELECTED' : '';
my $label = $ifname;
$label = '* (all IPX interfaces)' if $ifname eq '*';
$label = 'auto' if $ifname eq 'auto';
$html .= '\t\t\t\t<OPTION VALUE="' . html_escape( $ifname ) . '"' . $selected . '>' . html_escape( $label ) . '</OPTION>\n';
}
return $html;
}
sub url_escape( $ )
{
my $s = $_[0];
$s = '' unless defined $s;
$s =~ s/([^A-Za-z0-9_\.\-])/sprintf("%%%02X", ord($1))/eg;
return $s;
}
sub js_escape( $ )
{
my $s = $_[0];
$s = '' unless defined $s;
$s =~ s/\\/\\\\/g;
$s =~ s/'/\\'/g;
$s =~ s/\r/\\r/g;
$s =~ s/\n/\\n/g;
return $s;
}
sub smart_find_executable( @ )
{
foreach my $p ( @_ )
{
next if ! defined( $p ) || $p eq '';
return $p if -x $p;
}
return '';
}
sub sanitize_cups_printer_name( $ )
{
my $s = $_[0];
$s = '' unless defined $s;
$s =~ s/[^-_\.A-Za-z0-9]//g;
return $s;
}
sub cups_queue_name( $ )
{
my $s = sanitize_cups_printer_name( $_[0] );
$s = uc( $s );
$s =~ s/[^A-Z0-9_\-]/_/g;
$s = 'PRINTQ' if $s eq '';
$s = substr( $s, 0, 47 );
return $s;
}
sub cups_print_command( $ )
{
my $printer = sanitize_cups_printer_name( $_[0] );
my $template = $smart_cups_print_command_template;
$template = '/usr/bin/lp -d %p -' unless defined( $template ) && $template ne '';
$template =~ s/%p/$printer/g;
return $template;
}
sub cups_add_printer( $$$ )
{
my( $printers, $seen, $name ) = @_;
return if ! defined( $name );
$name =~ s/^\s+//;
$name =~ s/\s+$//;
return if $name eq '';
return if $name =~ /[^-_\.A-Za-z0-9]/;
my $queue = cups_queue_name( $name );
my $name_key = lc( $name );
my $queue_key = lc( $queue );
# Deduplicate by both the original CUPS name and the generated MARS_NWE
# queue name. This avoids duplicates when the same printer is discovered
# through lpstat -e and a localized lpstat -p fallback.
return if $seen->{'name:' . $name_key};
return if $seen->{'queue:' . $queue_key};
push( @$printers, {
name => $name,
queue => $queue,
command => cups_print_command( $name ),
} );
$seen->{'name:' . $name_key} = 1;
$seen->{'queue:' . $queue_key} = 1;
}
sub cups_printers()
{
my @printers = ();
my %seen = ();
return @printers if ! defined( $smart_cups_enable ) || !$smart_cups_enable;
return @printers if ! defined( $smart_cups_lpstat_path ) || $smart_cups_lpstat_path eq '';
return @printers if ! -x $smart_cups_lpstat_path;
# Prefer "lpstat -e": it prints only destination names and is language
# independent. If it returns at least one printer, do not run fallback
# parsers, because some CUPS versions/locales can expose aliases there.
if( open( my $fh, '-|', $smart_cups_lpstat_path, '-e' ) )
{
while( my $line = <$fh> )
{
chomp( $line );
$line =~ s/^\s+//;
$line =~ s/\s+$//;
next if $line eq '';
next if $line =~ /[\r\n]/;
cups_add_printer( \@printers, \%seen, $line );
}
close( $fh );
}
return @printers if scalar( @printers ) > 0;
# Fallback: "lpstat -v" is also mostly language independent because the
# destination name follows "for <name>:" on many systems.
if( open( my $fh, '-|', $smart_cups_lpstat_path, '-v' ) )
{
while( my $line = <$fh> )
{
chomp( $line );
if( $line =~ /\bfor\s+([^:\s]+)\s*:/i )
{
cups_add_printer( \@printers, \%seen, $1 );
}
}
close( $fh );
}
return @printers if scalar( @printers ) > 0;
# Last fallback: parse localized "lpstat -p" output. English starts with
# "printer <name>", German starts with "Drucker <name>".
if( open( my $fh, '-|', $smart_cups_lpstat_path, '-p' ) )
{
while( my $line = <$fh> )
{
chomp( $line );
if( $line =~ /^(?:printer|Drucker)\s+(\S+)/i )
{
cups_add_printer( \@printers, \%seen, $1 );
}
}
close( $fh );
}
return @printers;
}
sub cups_import_rows()
{
my $html = '';
my @printers = cups_printers();
if( scalar( @printers ) == 0 )
{
return qq|\t<TR BGCOLOR="#ece0cf">\n\t\t<TD COLSPAN=2><B>CUPS printers detected on host</B></TD>\n\t</TR>\n\t<TR BGCOLOR="#fbf7f1">\n\t\t<TD COLSPAN=2><SMALL>CUPS support is enabled, but no printers were returned by lpstat.</SMALL></TD>\n\t</TR>\n|;
}
$html .= qq|\t<TR BGCOLOR="#ece0cf">\n\t\t<TD COLSPAN=2><B>CUPS printers detected on host</B></TD>\n\t</TR>\n|;
foreach my $printer ( @printers )
{
my $name = ref( $printer ) eq 'HASH' ? $printer->{name} : $printer;
my $queue = ref( $printer ) eq 'HASH' ? $printer->{queue} : cups_queue_name( $printer );
my $cmd = ref( $printer ) eq 'HASH' ? $printer->{command} : cups_print_command( $printer );
my $href = '/settings/queues/add_new?cups_printer=' . url_escape( $name );
$html .= "\t<TR BGCOLOR=\"#fbf7f1\">\n";
$html .= "\t\t<TD><TT>" . html_escape( $name ) . "</TT><BR><SMALL>Queue: <TT>" . html_escape( $queue ) . "</TT> &nbsp; Command: <TT>" . html_escape( $cmd ) . "</TT></SMALL></TD>\n";
$html .= "\t\t<TD ALIGN=RIGHT><A HREF=\"" . html_escape( $href ) . "\">Add as print queue</A></TD>\n";
$html .= "\t</TR>\n";
}
return $html;
}
sub cups_select_html( $ )
{
my $current = sanitize_cups_printer_name( $_[0] );
my @printers = cups_printers();
my $html = '';
my $js = '';
return ( '', '' ) if scalar( @printers ) == 0;
$html .= qq|<SELECT NAME="cups_printer" ID="cups_printer" ONCHANGE="smartUseCupsPrinter(this.value)">\n|;
$html .= qq|\t\t\t\t<OPTION VALUE="">-- choose CUPS printer --</OPTION>\n|;
foreach my $printer ( @printers )
{
my $name = ref( $printer ) eq 'HASH' ? $printer->{name} : $printer;
my $queue = ref( $printer ) eq 'HASH' ? $printer->{queue} : cups_queue_name( $printer );
my $cmd = ref( $printer ) eq 'HASH' ? $printer->{command} : cups_print_command( $printer );
my $sel = ( $name eq $current ) ? ' SELECTED' : '';
$html .= qq|\t\t\t\t<OPTION VALUE="| . html_escape( $name ) . qq|"| . $sel . qq|>| . html_escape( $name ) . qq|</OPTION>\n|;
$js .= "smartCupsCommands['" . js_escape( $name ) . "'] = '" . js_escape( $cmd ) . "';\n";
$js .= "smartCupsQueues['" . js_escape( $name ) . "'] = '" . js_escape( $queue ) . "';\n";
}
$html .= qq|\t\t\t</SELECT>|;
return ( $html, $js );
}
sub ipx_interface_info( $ )
{
my $want = $_[0];
my %info = ();
return %info if ! defined( $want ) || $want eq '';
if( open( my $fh, '<', '/proc/net/ipx/interface' ) )
{
while( my $line = <$fh> )
{
chomp( $line );
$line =~ s/^\s+//;
$line =~ s/\s+$//;
next if $line eq '';
next if $line =~ /^Network\s+Node_Address\s+Primary\s+Device\s+Frame_Type/i;
my @fields = split( /\s+/, $line );
next if scalar( @fields ) < 5;
my $network = $fields[0];
my $dev = $fields[3];
my $frame = $fields[4];
next if ! defined( $dev ) || $dev ne $want;
next if lc( $dev ) eq 'internal';
$info{network} = $network;
$info{frame} = $frame;
last;
}
close( $fh );
}
return %info;
}
sub ipx_device_import_rows()
{
my $html = '';
my @ifaces = ipx_enabled_interfaces();
if( scalar( @ifaces ) == 0 )
{
return qq|\t<TR BGCOLOR="#ece0cf">\n\t\t<TD COLSPAN=2><B>IPX interfaces detected on host</B></TD>\n\t</TR>\n\t<TR BGCOLOR="#fbf7f1">\n\t\t<TD COLSPAN=2><SMALL>No active IPX interfaces were found in <TT>/proc/net/ipx/interface</TT>.</SMALL></TD>\n\t</TR>\n|;
}
$html .= qq|\t<TR BGCOLOR="#ece0cf">\n\t\t<TD COLSPAN=2><B>IPX interfaces detected on host</B></TD>\n\t</TR>\n|;
foreach my $iface ( @ifaces )
{
my %info = ipx_interface_info( $iface );
my $net = $info{network};
my $frame = $info{frame};
my $delay = 1;
$net = '0x0' if ! defined( $net ) || $net eq '';
$frame = '802.2' if ! defined( $frame ) || $frame eq '' || lc( $frame ) eq 'none';
my $href = '/settings/devices/add_new?ipx_iface=' . url_escape( $iface );
$html .= "\t<TR BGCOLOR=\"#fbf7f1\">\n";
$html .= "\t\t<TD><TT>" . html_escape( $iface ) . "</TT><BR><SMALL>Config line: <TT>4 " . html_escape( $net ) . " " . html_escape( $iface ) . " " . html_escape( $frame ) . " " . html_escape( $delay ) . "</TT></SMALL></TD>\n";
$html .= "\t\t<TD ALIGN=RIGHT><A HREF=\"" . html_escape( $href ) . "\">Add as device</A></TD>\n";
$html .= "\t</TR>\n";
}
return $html;
}
sub ipx_device_defaults_from_query()
{
my %defaults = ();
$defaults{number} = '';
$defaults{interface} = '';
$defaults{frametype} = '802.2';
$defaults{delay} = 1;
if( defined( $p{ipx_iface} ) && $p{ipx_iface} ne '' )
{
my $iface = $p{ipx_iface};
$iface =~ s/[^-_\.A-Za-z0-9]//g;
my %info = ipx_interface_info( $iface );
$defaults{interface} = $iface;
$defaults{number} = defined( $info{network} ) && $info{network} ne '' ? $info{network} : '0x0';
$defaults{frametype} = defined( $info{frame} ) && $info{frame} ne '' && lc( $info{frame} ) ne 'none' ? $info{frame} : '802.2';
$defaults{delay} = 1;
}
return %defaults;
}
sub smart_bindery_values()
{
my( $bind_server, $bind_user, $bind_pass ) = ( '', '', '' );
if( open( my $fh, '<' . $smart_nwclient_path ) )
{
my $line = <$fh>;
close( $fh );
chomp( $line ) if defined( $line );
( $bind_server, $bind_user, $bind_pass ) = split( '[/ ]', $line ) if defined( $line );
}
$bind_server = '' unless defined( $bind_server );
$bind_user = '' unless defined( $bind_user );
$bind_pass = '' unless defined( $bind_pass );
return( $bind_server, $bind_user, $bind_pass );
}
sub sync_server_hint_row( $$$$ )
{
my( $checkbox_name, $current_name, $other_name, $direction ) = @_;
$current_name = '' unless defined( $current_name );
$other_name = '' unless defined( $other_name );
my $msg = '';
if( $direction eq 'general_to_smart' )
{
$msg = 'Also update the SMArT bindery server when saving. Current SMArT bindery server: ';
$msg .= $other_name ne '' ? '<TT>' . html_escape( $other_name ) . '</TT>' : '<I>not set</I>';
}
else
{
$msg = 'Also update the MARS_NWE server name when saving. Current MARS_NWE server name: ';
$msg .= $other_name ne '' ? '<TT>' . html_escape( $other_name ) . '</TT>' : '<I>not set</I>';
}
return qq|\t<TR BGCOLOR="#fff8ea">\n\t\t<TD><B>Keep server names in sync:</B><BR><SMALL>$msg</SMALL></TD>\n\t\t<TD ALIGN=RIGHT>Yes <INPUT NAME="$checkbox_name" TYPE=CHECKBOX VALUE="on" CHECKED></TD>\n\t</TR>\n|;
}
sub unix_user_import_rows()
{
my $html = '';
my @users = unix_userlist();
my %existing = ();
my @candidates = ();
foreach my $line ( getconfig( 13 ) )
{
my @f = split( ' ', $line );
$existing{lc( $f[1] )} = 1 if defined( $f[1] ) && $f[1] ne '';
}
foreach my $u ( @users )
{
next if ! defined( $u->{name} ) || $u->{name} eq '';
next if defined( $u->{uid} ) && $u->{uid} < 1000;
next if lc( $u->{name} ) eq 'nobody';
next if lc( $u->{name} ) eq 'root';
next if $existing{lc( $u->{name} )};
push( @candidates, $u );
}
if( scalar( @candidates ) == 0 )
{
return qq|\t<TR BGCOLOR="#ece0cf">\n\t\t<TD COLSPAN=2><B>Unix users detected on host</B></TD>\n\t</TR>\n\t<TR BGCOLOR="#fbf7f1">\n\t\t<TD COLSPAN=2><SMALL>No additional local Unix users were found for import.</SMALL></TD>\n\t</TR>\n|;
}
$html .= qq|\t<TR BGCOLOR="#ece0cf">\n\t\t<TD COLSPAN=2><B>Unix users detected on host</B></TD>\n\t</TR>\n|;
foreach my $u ( @candidates )
{
my $name = $u->{name};
my $uid = $u->{uid};
my $gecos = defined( $u->{gecos} ) ? $u->{gecos} : '';
$gecos =~ s/,.*$//;
my $href = '/settings/users_import/' . url_escape( $name );
$html .= "\t<TR BGCOLOR=\"#fbf7f1\">\n";
$html .= "\t\t<TD><TT>" . html_escape( $name ) . "</TT><BR><SMALL>UID: <TT>" . html_escape( $uid ) . "</TT>";
$html .= " &nbsp; " . html_escape( $gecos ) if $gecos ne '';
$html .= "</SMALL></TD>\n";
$html .= "\t\t<TD ALIGN=RIGHT><A HREF=\"" . html_escape( $href ) . "\">Add as MARS_NWE user</A></TD>\n";
$html .= "\t</TR>\n";
}
return $html;
}
sub unix_user_defaults_from_query()
{
my %defaults = ();
$defaults{name} = '';
$defaults{unix_user} = '';
$defaults{fullname} = '';
my $want = '';
# Preferred import route:
# /settings/users_import/<unixuser>
if( defined( $c[1] ) && $c[1] eq 'users_import' && defined( $c[2] ) && $c[2] ne '' )
{
$want = $c[2];
}
# Compatibility route:
# /settings/users/add_new/<unixuser>
elsif( defined( $c[3] ) && $c[3] ne '' )
{
$want = $c[3];
}
elsif( defined( $p{unix_user} ) && $p{unix_user} ne '' )
{
$want = $p{unix_user};
}
if( $want ne '' )
{
$want =~ s/[^-_\.A-Za-z0-9]//g;
foreach my $u ( unix_userlist() )
{
next if ! defined( $u->{name} ) || $u->{name} ne $want;
my $gecos = defined( $u->{gecos} ) ? $u->{gecos} : '';
$gecos =~ s/,.*$//;
$defaults{name} = uc( $u->{name} );
$defaults{name} =~ s/[^-_\.A-Za-z0-9]//g;
$defaults{unix_user} = $u->{name};
$defaults{fullname} = $gecos;
last;
}
}
return %defaults;
}
sub selected_attr( $$ )
{
my( $a, $b ) = @_;
$a = '' unless defined( $a );
$b = '' unless defined( $b );
return $a eq $b ? ' SELECTED' : '';
}
sub smart_group_checkbox_rows( $ )
{
my $server = $_[0];
my $html = '';
my @groups = ();
my $cmd = 'nwbols -t 2 -S ' . $server;
@groups = sort( split( "\n", `$cmd` ) );
foreach my $g ( @groups )
{
my @f = split( ' ', $g );
my $group = $f[0];
next if ! defined( $group ) || $group eq '';
next if $group =~ /[^-_\.A-Za-z0-9]/;
$html .= html_escape( $group ) . ' <INPUT NAME="group_' . html_escape( $group ) . '" TYPE=CHECKBOX><BR>' . "\n";
}
if( $html eq '' )
{
$html = '<SMALL>No bindery groups found. Save the user first, then add groups later.</SMALL><BR>' . "\n";
}
return $html;
}
sub handle_request()
{
if( $c[1] eq 'general' )
{
$server_name = getconfigline( 2 );
$internal_net = getconfigline( 3 );
my( $smart_bind_server_for_general, $smart_bind_user_for_general, $smart_bind_pass_for_general ) = smart_bindery_values();
my $general_sync_server_row = sync_server_hint_row( 'sync_smart_bind_server', $server_name, $smart_bind_server_for_general, 'general_to_smart' );
( $burst_read, $burst_write ) = split( ' ', getconfigline( 30 ) );
$timing_down = getconfigline( 210 );
$timing_warn = getconfigline( 211 );
eval( '$test_' . getconfigline( 16 ) . ' = " CHECKED";' );
eval( '$version_' . ( split( ' ', getconfigline( 6 ) ) )[0] . ' = " CHECKED";' );
if( ( split( ' ', getconfigline( 6 ) ) )[1] == 1 )
{
$burst_enabled_0 = ' CHECKED';
}
else
{
$burst_enabled_0 = '';
}
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/general" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>General settings</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Server name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="server_name" TYPE=TEXT SIZE=20 VALUE="$server_name"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Internal network:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="internal_net" TYPE=TEXT SIZE=20 VALUE="$internal_net"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Tests at startup:</B>
</TD>
<TD ALIGN=RIGHT>
None<INPUT NAME="test" TYPE=RADIO VALUE=0$test_0><BR>
Some<INPUT NAME="test" TYPE=RADIO VALUE=1$test_1><BR>
Check/compress bindery<INPUT NAME="test" TYPE=RADIO VALUE=2$test_2><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Server version:</B>
</TD>
<TD ALIGN=RIGHT>
2.15<INPUT NAME="version" TYPE=RADIO VALUE=0$version_0><BR>
3.11<INPUT NAME="version" TYPE=RADIO VALUE=1$version_1><BR>
3.12<INPUT NAME="version" TYPE=RADIO VALUE=2$version_2><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Burst mode</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Burst mode:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="burst_enabled" TYPE=CHECKBOX$burst_enabled_0><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>MAX_BURST_READ_BUF:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="burst_read" TYPE=TEXT SIZE=20 VALUE="$burst_read"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>MAX_BURST_WRITE_BUF:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="burst_write" TYPE=TEXT SIZE=20 VALUE="$burst_write"><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Timing</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Wait for <I>x</I> seconds before shutdown:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="timing_down" TYPE=TEXT SIZE=20 VALUE="$timing_down"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Warn users every <I>x</I> seconds:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="timing_warn" TYPE=TEXT SIZE=20 VALUE="$timing_warn"><BR>
</TD>
</TR>
$general_sync_server_row
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
elsif( $c[1] eq 'dirs' )
{
$path_cache = getconfigline( 40 );
$share_lock = getconfigline( 41 );
$spool = getconfigline( 42 );
$bindery = getconfigline( 45 );
$attribute = getconfigline( 46 );
$trustee = getconfigline( 47 );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/dirs" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Directories</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Path cache directory:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="path_cache" TYPE=TEXT SIZE=32 VALUE="$path_cache"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Share and lock files:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="share_lock" TYPE=TEXT SIZE=32 VALUE="$share_lock"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Spool directory:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="spool" TYPE=TEXT SIZE=32 VALUE="$spool"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Bindery files:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="bindery" TYPE=TEXT SIZE=32 VALUE="$bindery"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Attribute handling files:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="attribute" TYPE=TEXT SIZE=32 VALUE="$attribute"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Trustee handling files:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="trustee" TYPE=TEXT SIZE=32 VALUE="$trustee"><BR>
</TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
elsif( $c[1] eq 'configh' )
{
$net_serial = getconfigline( 70 );
$net_app = getconfigline( 71 );
if( getconfigline( 68 ) eq '1' )
{
$mmap_0 = ' CHECKED';
}
else
{
$mmap_0 = '';
}
eval( '$sap_' . getconfigline( 69 ) . ' = " CHECKED";' );
$max_conn = getconfigline( 60 );
$max_vol = getconfigline( 61 );
$max_dirbase = getconfigline( 63 );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/configh" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Precompiled settings</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Network serial number:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="net_serial" TYPE=TEXT SIZE=20 VALUE="$net_serial"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Network application number:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="net_app" TYPE=TEXT SIZE=20 VALUE="$net_app"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B><TT>mmap()</TT> calls:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="mmap" TYPE=CHECKBOX$mmap_0><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Handle SAP-types:</B>
</TD>
<TD ALIGN=RIGHT>
Only type 4<INPUT NAME="sap" TYPE=RADIO VALUE=0$sap_0><BR>
All<INPUT NAME="sap" TYPE=RADIO VALUE=1$sap_1><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Limits</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Maximum connection count:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="max_conn" TYPE=TEXT SIZE=20 VALUE="$max_conn"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Maximum volume count:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="max_vol" TYPE=TEXT SIZE=20 VALUE="$max_vol"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Maximum directory-base entry count:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="max_dirbase" TYPE=TEXT SIZE=20 VALUE="$max_dirbase"><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2><A HREF="/settings/advanced/configh"><B>Advanced precompiled / path settings</B></A></TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
elsif( $c[1] eq 'security' )
{
$creat_dir = ( split( ' ', getconfigline( 9 ) ) )[0];
$creat_file = ( split( ' ', getconfigline( 9 ) ) )[1];
eval( '$encrypt_' . getconfigline( 7 ) . ' = " CHECKED";' );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/security" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Security</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B><TT>creat()</TT> mode for directories:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="creat_dir" TYPE=TEXT SIZE=20 VALUE="$creat_dir"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B><TT>creat()</TT> mode for files:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="creat_file" TYPE=TEXT SIZE=20 VALUE="$creat_file"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Password encryption:</B>
</TD>
<TD ALIGN=RIGHT>
Always encrypt<INPUT NAME="encrypt" TYPE=RADIO VALUE=0$encrypt_0><BR>
Except when changing password<INPUT NAME="encrypt" TYPE=RADIO VALUE=1$encrypt_1><BR>
Disallow zero-passwords<INPUT NAME="encrypt" TYPE=RADIO VALUE=7$encrypt_7><BR>
Allow zero-passwords<INPUT NAME="encrypt" TYPE=RADIO VALUE=8$encrypt_8><BR>
Disallow encryption<INPUT NAME="encrypt" TYPE=RADIO VALUE=9$encrypt_9><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2><A HREF="/settings/advanced/security"><B>Advanced security settings</B></A></TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
elsif( $c[1] eq 'susers' )
{
$guest = getconfigline( 11 );
( $root_name, $root, $root_password ) = split( ' ', getconfigline( 12 ) );
$guest_user_list = '';
$root_list = '';
foreach $u ( unix_userlist() )
{
if( $u->{uid} eq $guest )
{ $guest_user_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{uid} . '" SELECTED>' . $u->{name} . '</OPTION>' . "\n"; }
else
{ $guest_user_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{uid} . '">' . $u->{name} . '</OPTION>' . "\n"; }
if( $u->{name} eq $root )
{ $root_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{name} . '" SELECTED>' . $u->{name} . '</OPTION>' . "\n"; }
else
{ $root_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{name} . '">' . $u->{name} . '</OPTION>' . "\n"; }
}
$guest = getconfigline( 10 );
$guest_group_list = '';
foreach $u ( unix_grouplist() )
{
if( $u->{gid} eq $guest )
{ $guest_group_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{gid} . '" SELECTED>' . $u->{name} . '</OPTION>' . "\n"; }
else
{ $guest_group_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{gid} . '">' . $u->{name} . '</OPTION>' . "\n"; }
}
eval( '$map_' . ( split( ' ', getconfigline( 15 ) ) )[0] . ' = " CHECKED";' );
$map_password = ( split( ' ', getconfigline( 15 ) ) )[1];
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/susers" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>User configuration</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Guest user</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>User:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="guest_user" SIZE=5>
$guest_user_list
</SELECT><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Group:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="guest_group" SIZE=5>
$guest_group_list
</SELECT><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Supervisor user</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Username:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="root_name" TYPE=TEXT SIZE=20 VALUE="$root_name"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Unix user:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="root_user" SIZE=5>
$root_list
</SELECT><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Password:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="root_password" TYPE=PASSWORD SIZE=20 VALUE="$root_password"><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>User mapping</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>User mapping:</B>
</TD>
<TD ALIGN=RIGHT>
Disabled<INPUT NAME="map" TYPE=RADIO VALUE=0$map_0><BR>
Enabled<INPUT NAME="map" TYPE=RADIO VALUE=1$map_1><BR>
Enabled, overwrite all users<INPUT NAME="map" TYPE=RADIO VALUE=99$map_99><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Default password:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="map_password" TYPE=PASSWORD SIZE=20 VALUE="$map_password"><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2><A HREF="/settings/advanced/users"><B>Advanced user / bindery settings</B></A></TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
elsif( $c[1] eq 'logging' )
{
eval( '$ipx_' . getconfigline( 100 ) . ' = " SELECTED";' );
eval( '$nwserv_' . getconfigline( 101 ) . ' = " SELECTED";' );
eval( '$ncpserv_' . getconfigline( 102 ) . ' = " SELECTED";' );
eval( '$nwconn_' . getconfigline( 103 ) . ' = " SELECTED";' );
eval( '$nwclient_' . getconfigline( 104 ) . ' = " SELECTED";' );
eval( '$nwbind_' . getconfigline( 105 ) . ' = " SELECTED";' );
eval( '$nwrouted_' . getconfigline( 106 ) . ' = " SELECTED";' );
eval( '$startup_' . getconfigline( 200 ) . ' = " CHECKED";' );
$general_log = getconfigline( 201 );
$routing_interval = getconfigline( 300 );
$routing_log = getconfigline( 301 );
$x = getconfigline( 202 );
eval( '$g_creat_' . ( $x & 1 ) . ' = " CHECKED";' );
eval( '$error_' . ( ( $x - $g_creat ) >> 1 ) . ' = " CHECKED";' );
$x = getconfigline( 302 );
eval( '$r_creat_' . ( $x & 1 ) . ' = " CHECKED";' );
eval( '$r_file_' . ( ( $x - $r_creat ) >> 1 ) . ' = " CHECKED";' );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/logging" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Logging</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Logfiles</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>General logfile:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="general_log" TYPE=TEXT SIZE=32 VALUE="$general_log"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Routing logfile:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="routing_log" TYPE=TEXT SIZE=32 VALUE="$routing_log"><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Parts to log</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>IPX-kernel:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="ipx">
<OPTION VALUE="0"$ipx_0>No debugging</OPTION>
<OPTION VALUE="1"$ipx_1>Normal debugging</OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>NWSERV:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="nwserv">
<OPTION VALUE="0"$nwserv_0>No debugging</OPTION>
<OPTION VALUE="1"$nwserv_1>Normal debugging</OPTION>
<OPTION VALUE="99"$nwserv_99>Maximum debugging</OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>NCPSERV:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="ncpserv">
<OPTION VALUE="0"$ncpserv_0>No debugging</OPTION>
<OPTION VALUE="1"$ncpserv_1>Normal debugging</OPTION>
<OPTION VALUE="99"$ncpserv_99>Maximum debugging</OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>NWCONN:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="nwconn">
<OPTION VALUE="0"$nwconn_0>No debugging</OPTION>
<OPTION VALUE="1"$nwconn_1>Normal debugging</OPTION>
<OPTION VALUE="99"$nwconn_99>Maximum debugging</OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>NWCLIENT:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="nwclient">
<OPTION VALUE="0"$nwclient_0>No debugging</OPTION>
<OPTION VALUE="1"$nwclient_1>Normal debugging</OPTION>
<OPTION VALUE="99"$nwclient_99>Maximum debugging</OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>NWBIND:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="nwbind">
<OPTION VALUE="0"$nwbind_0>No debugging</OPTION>
<OPTION VALUE="1"$nwbind_1>Normal debugging</OPTION>
<OPTION VALUE="99"$nwbind_99>Maximum debugging</OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>NWROUTED:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="nwrouted">
<OPTION VALUE="0"$nwrouted_0>No debugging</OPTION>
<OPTION VALUE="1"$nwrouted_1>Normal debugging</OPTION>
<OPTION VALUE="99"$nwrouted_99>Maximum debugging</OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>General logging flags</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>NWSERV behaviour:</B>
</TD>
<TD ALIGN=RIGHT>
No logging, run in foreground<INPUT NAME="startup" TYPE=RADIO VALUE="0"$startup_0><BR>
Run as daemon, enable logging<INPUT NAME="startup" TYPE=RADIO VALUE="1"$startup_1><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Logfile creation:</B>
</TD>
<TD ALIGN=RIGHT>
Append messages to logfile<INPUT NAME="g_creat" TYPE=RADIO VALUE="0"$g_creat_0><BR>
Recreate logfile at startup<INPUT NAME="g_creat" TYPE=RADIO VALUE="1"$g_creat_1><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Log error messages to:</B>
</TD>
<TD ALIGN=RIGHT>
Logfile<INPUT NAME="error" TYPE=RADIO VALUE="0"$error_0><BR>
<TT>syslog</TT><INPUT NAME="error" TYPE=RADIO VALUE="1"$error_1><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Routing logging flags</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Write to file every x minutes:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="routing_interval" TYPE=TEXT SIZE=32 VALUE="$routing_interval"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Logfile creation:</B>
</TD>
<TD ALIGN=RIGHT>
Append messages to logfile<INPUT NAME="r_creat" VALUE="0" TYPE=RADIO$r_creat_0><BR>
Recreate logfile every time<INPUT NAME="r_creat" VALUE="1" TYPE=RADIO$r_creat_1><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>File:</B>
</TD>
<TD ALIGN=RIGHT>
Keep using the same file<INPUT NAME="r_file" VALUE="0" TYPE=RADIO$r_file_0><BR>
Write to separate files (<TT>.1</TT>, <TT>.2</TT>, etc)<INPUT NAME="r_file" VALUE="1" TYPE=RADIO$r_file_1><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2><A HREF="/settings/advanced/network"><B>Advanced network watchdog settings</B></A></TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
elsif( $c[1] eq 'volumes' )
{
if( $c[2] eq '' )
{
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Volumes</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
EOF
@c = getconfig( 1 );
foreach $c ( @c )
{
my @c = split( ' ', $c );
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<A HREF="/settings/volumes/$c[1]"><TT>$c[1]</TT></A> (<TT>$c[2]</TT>) <!-- NETSCAPE RRRAAARRR -->
</TD>
<TD ALIGN=RIGHT>
<A HREF="/apply/volumes/$c[1]" onclick="return confirm('Delete volume $c[1]?')">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR="#d7c0a0">
<TD COLSPAN=2>
<B><A HREF="/settings/volumes/add_new">Add new volume</A></B>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
else
{
$c = getconfigline( '1 ' . $c[2] );
@c = split( ' ', $c );
$c = '';
$d = $c[2];
$d =~ s/[^ik]//g;
eval( '$c' . $d . ' = " CHECKED";' );
$d = $c[2];
$d =~ s/[^Tt]//g;
eval( '$t' . $d . ' = " CHECKED";' );
$m = $c[2];
$m =~ s/[^m]//g;
if( $m ne '' )
{ $m = ' CHECKED'; }
$n = $c[2];
$n =~ s/[^n]//g;
if( $n ne '' )
{ $n = ' CHECKED'; }
$o = $c[2];
$o =~ s/[^o]//g;
if( $o ne '' )
{ $o = ' CHECKED'; }
$p = $c[2];
$p =~ s/[^p]//g;
if( $p ne '' )
{ $p = ' CHECKED'; }
$r = $c[2];
$r =~ s/[^r]//g;
if( $r ne '' )
{ $r = ' CHECKED'; }
$O = $c[2];
$O =~ s/[^O]//g;
if( $O ne '' )
{ $O = ' CHECKED'; }
$N = $c[2];
$N =~ s/[^N]//g;
if( $N ne '' )
{ $N = ' CHECKED'; }
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/volumes/$c[0]" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Volume: $c[0]</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Volume name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="name" TYPE=TEXT SIZE=32 VALUE="$c[0]"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Unix path:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="path" TYPE=TEXT SIZE=32 VALUE="$c[1]"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Filename case:</B>
</TD>
<TD ALIGN=RIGHT>
All upper case<INPUT NAME="case" TYPE=RADIO VALUE=""$c><BR>
Ignore case<INPUT NAME="case" TYPE=RADIO VALUE="i"$ci><BR>
All lower case<INPUT NAME="case" TYPE=RADIO VALUE="k"$ck><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Trustees:</B>
</TD>
<TD ALIGN=RIGHT>
Disabled<INPUT NAME="trustee" TYPE=RADIO VALUE=""$t><BR>
Enabled<INPUT NAME="trustee" TYPE=RADIO VALUE="t"$tt><BR>
Enabled, unix rights disabled<INPUT NAME="trustee" TYPE=RADIO VALUE="T"$tT><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Additional options</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Removable:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="m" TYPE=CHECKBOX$m><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>No fixed i-nodes:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="n" TYPE=CHECKBOX$n><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Single filesystem:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="o" TYPE=CHECKBOX$o><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Pipe filesystem:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="p" TYPE=CHECKBOX$p><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Read-only:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="r" TYPE=CHECKBOX$r><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Additional namespaces</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>OS/2 LFN support:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="O" TYPE=CHECKBOX$O><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>NFS support:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="N" TYPE=CHECKBOX$N><BR>
</TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
}
elsif( $c[1] eq 'devices' )
{
if( $c[2] eq '' )
{
my $ipx_device_import_rows = ipx_device_import_rows();
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Devices</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
EOF
@c = getconfig( 4 );
foreach $c ( @c )
{
my @c = split( ' ', $c );
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<A HREF="/settings/devices/$c[1]"><TT>$c[1]</TT></A> ($c[2]/$c[3])
</TD>
<TD ALIGN=RIGHT>
<A HREF="/apply/devices/$c[1]" onclick="return confirm('Delete device $c[1]?')">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
$ipx_device_import_rows
<TR BGCOLOR="#d7c0a0">
<TD COLSPAN=2>
<B><A HREF="/settings/devices/add_new">Add new device manually</A></B><BR><BR>
<B><A HREF="/settings/advanced/devices">Advanced device settings</A></B>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
else
{
my $title = $c[2];
my $number = '';
my $interface = '';
my $frametype = '802.2';
my $delay = 1;
if( $c[2] eq 'add_new' )
{
my %defaults = ipx_device_defaults_from_query();
$number = $defaults{number};
$interface = $defaults{interface};
$frametype = $defaults{frametype};
$delay = $defaults{delay};
}
else
{
my $line = getconfigline( '4 ' . $c[2] );
my @dev = split( ' ', $line );
$number = $dev[0];
$interface = $dev[1];
$frametype = $dev[2];
$delay = $dev[3];
$title = $number;
}
$number = '' unless defined $number;
$interface = '' unless defined $interface;
$frametype = '802.2' unless defined $frametype && $frametype ne '';
$delay = 1 unless defined $delay && $delay ne '';
my $frametype_key = $frametype;
$frametype_key =~ s/\.//g;
eval( '$frametype_' . $frametype_key . ' = " SELECTED";' );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/devices/$title" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Device: $title</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Network number:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="number" TYPE=TEXT SIZE=20 VALUE="$number"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Network interface:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="interface" TYPE=TEXT SIZE=20 VALUE="$interface" READONLY><BR>
<SMALL>Use the IPX interfaces list on the Devices overview to prefill this value.</SMALL>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Frame type:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="frametype">
<OPTION VALUE="ethernet_ii"$frametype_ethernet_ii>Ethernet_II</OPTION>
<OPTION VALUE="802.2"$frametype_8022>IEEE 802.2</OPTION>
<OPTION VALUE="802.3"$frametype_8023>IEEE 802.3</OPTION>
<OPTION VALUE="snap"$frametype_snap>SNAP</OPTION>
<OPTION VALUE="token"$frametype_token>Token ring</OPTION>
<OPTION VALUE="auto"$frametype_auto>Automatic detection</OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Interface delay:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="delay" TYPE=TEXT SIZE=20 VALUE="$delay"><BR>
</TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
}
elsif( $c[1] eq 'smart' )
{
( $bind_server, $bind_user, $bind_pass ) = smart_bindery_values();
my $smart_general_server_name = getconfigline( 2 );
my $smart_sync_server_row = sync_server_hint_row( 'sync_general_server_name', $bind_server, $smart_general_server_name, 'smart_to_general' );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/smart" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>SMArT settings</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B><TT>nwserv.conf</TT> location:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="mars_config" TYPE=TEXT SIZE=32 VALUE="$mars_config"><BR>
</TD>
</TR>
<TR BGCOLOR="#ece0cf">
<TD COLSPAN=2>
<B><FONT>Bindery server</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Server name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="bind_server" TYPE=TEXT SIZE=20 VALUE="$bind_server"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Supervisor login name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="bind_user" TYPE=TEXT SIZE=20 VALUE="$bind_user"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Supervisor password:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="bind_pass" TYPE=PASSWORD SIZE=20 VALUE="$bind_pass"><BR>
</TD>
</TR>
$smart_sync_server_row
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
elsif( $c[1] eq 'users' || $c[1] eq 'users_import' )
{
if( $c[1] eq 'users_import' )
{
$p{unix_user} = $c[2];
$c[1] = 'users';
$c[2] = 'add_new';
}
my $unix_user_import_rows = unix_user_import_rows();
$server = get_server();
if( $c[2] eq '' )
{
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Users</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
EOF
@c = sort( split( "\n", `nwbols -t 1 -S $server` ) );
foreach $c ( @c )
{
my @c = split( ' ', $c );
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<A HREF="/settings/users/$c[0]">$c[0]</A>
</TD>
<TD ALIGN=RIGHT>
<A HREF="/apply/users/$c[0]" onclick="return confirm('Delete user $c[0]?')">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR="#d7c0a0">
<TD COLSPAN=2>
$unix_user_import_rows
<B><A HREF="/settings/users/add_new">Add new user</A></B>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
else
{
my $group_rows = smart_group_checkbox_rows( $server );
my %unix_defaults = unix_user_defaults_from_query();
my $default_name = $unix_defaults{name};
my $default_unix_user = $unix_defaults{unix_user};
my $default_fullname = $unix_defaults{fullname};
$default_name = '' unless defined( $default_name );
$default_unix_user = '' unless defined( $default_unix_user );
$default_fullname = '' unless defined( $default_fullname );
$unix_user_list = '';
$group_list = '';
@allgroups = sort( split( "\n", `nwbols -S $server -t 2` ) );
if( $c[2] ne 'add_new' )
{
$fullname = read_property_string( $c[2], 1, 'IDENTIFICATION' );
$unix_user = read_property_string( $c[2], 1, 'UNIX_USER' );
foreach $u ( unix_userlist() )
{
if( $u->{name} eq $unix_user )
{ $unix_user_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{name} . '" SELECTED>' . $u->{name} . '</OPTION>' . "\n"; }
else
{ $unix_user_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{name} . '">' . $u->{name} . '</OPTION>' . "\n"; }
}
@groups = read_property_list( $c[2], 1, 'GROUPS_I\\\'M_IN' );
foreach $g ( @allgroups )
{
$g =~ s/ .*//;
if( grep( /^$g$/, @groups ) )
{ $group_list .= "\t\t\t" . $g . '<INPUT TYPE=CHECKBOX NAME="group_' . $g . '" CHECKED><BR>' . "\n"; }
else
{ $group_list .= "\t\t\t" . $g . '<INPUT TYPE=CHECKBOX NAME="group_' . $g . '"><BR>' . "\n"; }
}
}
else
{
$fullname = $default_fullname;
foreach $u ( unix_userlist() )
{
if( defined( $default_unix_user ) && $default_unix_user ne '' && $u->{name} eq $default_unix_user )
{
$unix_user_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{name} . '" SELECTED>' . $u->{name} . '</OPTION>' . "\n";
}
else
{
$unix_user_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{name} . '">' . $u->{name} . '</OPTION>' . "\n";
}
}
if( defined( $default_unix_user ) && $default_unix_user ne '' && $unix_user_list !~ /VALUE="\Q$default_unix_user\E"/ )
{
$unix_user_list .= "\t\t\t" . '<OPTION VALUE="' . $default_unix_user . '" SELECTED>' . $default_unix_user . '</OPTION>' . "\n";
}
foreach $g ( @allgroups )
{
$g =~ s/ .*//;
next if $g eq '';
$group_list .= "\t\t\t" . $g . '<INPUT TYPE=CHECKBOX NAME="group_' . $g . '"><BR>' . "\n";
}
if( $group_list eq '' )
{
$group_list = "\t\t\t" . 'EVERYONE<INPUT TYPE=CHECKBOX NAME="group_EVERYONE"><BR>' . "\n";
}
}
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/users/$c[2]" METHOD=GET>
<INPUT TYPE=HIDDEN NAME="unix_user_import_default" VALUE="$default_unix_user">
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>User: $c[2]</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
EOF
if( $c[2] eq 'add_new' )
{
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Account name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="name" TYPE=TEXT SIZE=20 VALUE="$default_name"><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Full name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="fullname" TYPE=TEXT SIZE=20 VALUE="$fullname"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Password:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="password" TYPE=PASSWORD SIZE=20><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>UNIX user:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="unix_user" SIZE=5>
$unix_user_list </SELECT>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Groups belonged to:</B>
</TD>
<TD ALIGN=RIGHT>
$group_list </TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
<SCRIPT>
(function() {
var defaultUnixUser = "$default_unix_user";
if (!defaultUnixUser) return;
var selects = document.getElementsByName("unix_user");
if (!selects || !selects.length) return;
for (var i = 0; i < selects[0].options.length; i++) {
if (selects[0].options[i].value === defaultUnixUser) {
selects[0].selectedIndex = i;
break;
}
}
})();
</SCRIPT>
</BODY>
</HTML>
EOF
}
}
elsif( $c[1] eq 'groups' )
{
$server = get_server();
if( $c[2] eq '' )
{
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Groups</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
EOF
@c = sort( split( "\n", `nwbols -t 2 -S $server` ) );
foreach $c ( @c )
{
my @c = split( ' ', $c );
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<A HREF="/settings/groups/$c[0]">$c[0]</A>
</TD>
<TD ALIGN=RIGHT>
<A HREF="/apply/groups/$c[0]" onclick="return confirm('Delete group $c[0]?')">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR="#d7c0a0">
<TD COLSPAN=2>
<B><A HREF="/settings/groups/add_new">Add new group</A></B>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
else
{
@all = sort( split( "\n", `nwbols -S $server` ) );
$man_list = '';
if( $c[2] ne 'add_new' )
{
$fullname = read_property_string( $c[2], 2, 'IDENTIFICATION' );
@mans = read_property_list( $c[2], 2, 'OBJ_SUPERVISORS' );
foreach $g ( @all )
{
my @c = split( ' ', $g );
if( $c[2] == 1 or $c[2] == 2 )
{
if( grep( /^$c[0]$/, @mans ) )
{ $man_list .= "\t\t\t" . '(' . ( $c[2] == 1 ? 'user' : 'group' ) . ') ' . $c[0] . '<INPUT TYPE=CHECKBOX NAME="man_' . $c[2] . '_' . $c[0] . '" CHECKED><BR>' . "\n"; }
else
{ $man_list .= "\t\t\t" . '(' . ( $c[2] == 1 ? 'user' : 'group' ) . ') ' . $c[0] . '<INPUT TYPE=CHECKBOX NAME="man_' . $c[2] . '_' . $c[0] . '"><BR>' . "\n"; }
}
}
}
else
{
foreach $g ( @all )
{
my @c = split( ' ', $g );
if( $c[2] == 1 or $c[2] == 2 )
{
$man_list .= "\t\t\t" . '(' . ( $c[2] == 1 ? 'user' : 'group' ) . ') ' . $c[0] . '<INPUT TYPE=CHECKBOX NAME="man_' . $c[2] . '_' . $c[0] . '"><BR>' . "\n";
}
}
}
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/groups/$c[2]" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Group: $c[2]</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
EOF
if( $c[2] eq 'add_new' )
{
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Group name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="name" TYPE=TEXT SIZE=20 VALUE="$default_name"><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Full name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="fullname" TYPE=TEXT SIZE=20 VALUE="$fullname"><BR>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Group managers:</B>
</TD>
<TD ALIGN=RIGHT>
$man_list </TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
}
elsif( $c[1] eq 'queues' )
{
$server = get_server();
if( $c[2] eq '' )
{
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Print queues</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
EOF
@c = sort( split( "\n", `nwbols -t 3 -S $server` ) );
foreach $c ( @c )
{
my @c = split( ' ', $c );
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<A HREF="/settings/queues/$c[0]">$c[0]</A>
</TD>
<TD ALIGN=RIGHT>
<A HREF="/apply/queues/$c[0]" onclick="return confirm('Delete queue $c[0]?')">Delete</A><BR>
</TD>
</TR>
EOF
}
print cups_import_rows();
print <<EOF;
<TR BGCOLOR="#d7c0a0">
<TD COLSPAN=2>
<B><A HREF="/settings/queues/add_new">Add new print queue</A></B>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
else
{
@all = sort( split( "\n", `nwbols -S $server` ) );
$man_list = '';
$queue_name_value = '';
$selected_cups_printer = sanitize_cups_printer_name( $p{cups_printer} );
if( $c[2] ne 'add_new' )
{
$unix_print = read_property_string( $c[2], 3, 'Q_UNIX_PRINT' );
$spool_dir = read_property_string( $c[2], 3, 'Q_DIRECTORY' );
}
elsif( $selected_cups_printer ne '' )
{
$queue_name_value = cups_queue_name( $selected_cups_printer );
$unix_print = cups_print_command( $selected_cups_printer );
}
( $cups_select, $cups_js ) = cups_select_html( $selected_cups_printer );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/android-chrome-512x512.png">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
TR:first-child TD:first-child { border-top-left-radius:18px; }
TR:first-child TD:last-child { border-top-right-radius:18px; }
TR:last-child TD:first-child { border-bottom-left-radius:18px; }
TR:last-child TD:last-child { border-bottom-right-radius:18px; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA {
border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d;
}
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] {
border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold;
}
A { color:#9f2f26; }
TT { color:#5b4b38; }
</style>
<SCRIPT TYPE="text/javascript">
var smartCupsCommands = {};
var smartCupsQueues = {};
$cups_js
function smartUseCupsPrinter(printer) {
if (!printer) { return; }
var cmd = document.getElementById('unix_print');
if (cmd && smartCupsCommands[printer]) {
cmd.value = smartCupsCommands[printer];
}
var qn = document.getElementById('queue_name');
if (qn && smartCupsQueues[printer] && qn.value === '') {
qn.value = smartCupsQueues[printer];
}
}
window.onload = function() {
var sel = document.getElementById('cups_printer');
if (sel && sel.value) { smartUseCupsPrinter(sel.value); }
};
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/queues/$c[2]" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD>
<B><FONT SIZE=+2>Print queue: $c[2]</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
EOF
if( $c[2] eq 'add_new' )
{
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Queue name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT ID="queue_name" NAME="name" TYPE=TEXT SIZE=32 VALUE="$queue_name_value"><BR>
</TD>
</TR>
EOF
}
print <<EOF;
EOF
if( $cups_select ne '' )
{
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<B>CUPS printer:</B><BR>
<SMALL>Select a host printer to generate the matching lp command.</SMALL>
</TD>
<TD ALIGN=RIGHT>
$cups_select<BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Unix printing command:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT ID="unix_print" NAME="unix_print" TYPE=TEXT SIZE=48 VALUE="$unix_print"><BR>
<SMALL>Example for CUPS: <TT>/usr/bin/lp -d printer -</TT></SMALL>
</TD>
</TR>
<TR BGCOLOR="#fbf7f1">
<TD>
<B>Spool directory:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="spool_dir" TYPE=TEXT SIZE=32 VALUE="$spool_dir"><BR>
</TD>
</TR>
<TR BGCOLOR="#d7c0a0">
<TD>
<INPUT TYPE=SUBMIT VALUE="OK">
</TD>
<TD ALIGN=RIGHT>
<INPUT TYPE=RESET VALUE="Undo changes"><BR>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
}
elsif( $c[1] eq 'advanced' )
{
my $advanced_category = advanced_category();
my $advanced_title = advanced_title( $advanced_category );
my $advanced_hidden = advanced_hidden_category_input( $advanced_category );
my $device_flags = getconfigline( 5 );
my $security_flags = getconfigline( 8 );
my $bindery_flags = getconfigline( 17 );
my $queue_flags = getconfigline( 18 );
my $max_dir_search_handles = getconfigline( 80 );
my $conversion_tables = getconfigline( 50 );
my $watchdogs = getconfigline( 310 );
my $station_file = getconfigline( 400 );
my $nearest_replies = getconfigline( 401 );
my $connect_replies = getconfigline( 402 );
$device_flags = 0 if ! defined( $device_flags ) || $device_flags eq '';
$security_flags = 0 if ! defined( $security_flags ) || $security_flags eq '';
$bindery_flags = 0 if ! defined( $bindery_flags ) || $bindery_flags eq '';
$queue_flags = 0 if ! defined( $queue_flags ) || $queue_flags eq '';
my $dev_keep = ( $device_flags & 1 ) ? ' CHECKED' : '';
my $dev_auto = ( $device_flags & 2 ) ? ' CHECKED' : '';
my $dev_remove_all = ( $device_flags & 4 ) ? ' CHECKED' : '';
my $sec_supervisor_ignore = ( $security_flags & 0x8 ) ? ' CHECKED' : '';
my $sec_2gb_free = ( $security_flags & 0x40 ) ? ' CHECKED' : '';
my $sec_int17 = ( $security_flags & 0x200 ) ? ' CHECKED' : '';
my $sec_delete_open = ( $security_flags & 0x2 ) ? ' CHECKED' : '';
my $sec_rename_open = ( $security_flags & 0x4 ) ? ' CHECKED' : '';
my $bindery_empty_scripts = ( $bindery_flags & 1 ) ? ' CHECKED' : '';
my $queue_no_banner = ( $queue_flags & 1 ) ? ' CHECKED' : '';
my $nearest_0 = $nearest_replies eq '0' ? ' SELECTED' : '';
my $nearest_1 = $nearest_replies eq '1' ? ' SELECTED' : '';
my $nearest_2 = $nearest_replies eq '2' ? ' SELECTED' : '';
my $connect_0 = $connect_replies eq '0' ? ' SELECTED' : '';
my $connect_1 = $connect_replies eq '1' ? ' SELECTED' : '';
my $connect_2 = $connect_replies eq '2' ? ' SELECTED' : '';
my $print_server_rows = '';
foreach my $ps ( getconfig( 22 ) )
{
my $line = $ps;
$line =~ s/^22\s+//;
$print_server_rows .= html_escape( $line ) . "\n";
}
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<HEAD>
<TITLE>SMArT Advanced Settings</TITLE>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<style>
BODY { background:#f6f2ea; color:#2e261d; font-family: Arial, Helvetica, sans-serif; margin:0; padding:14px; }
FORM { margin:0; }
TABLE { border-collapse:separate; border-spacing:0; width:100%; background:#fbf7f1; border:1px solid #ddcfba; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(80,55,30,0.08); }
TD { padding:10px 12px; }
TR + TR TD { border-top:1px solid #eadfce; }
INPUT, SELECT, TEXTAREA { font-family: Arial, Helvetica, sans-serif; font-size:14px; }
INPUT[type=TEXT], INPUT[type=PASSWORD], SELECT, TEXTAREA { border:1px solid #cdbb9f; border-radius:10px; padding:6px 10px; background:#fffdf9; color:#2e261d; }
INPUT[type=SUBMIT], INPUT[type=RESET], INPUT[type=BUTTON] { border:1px solid #a33d2f; border-radius:10px; padding:8px 14px; background:#b84434; color:#fff; font-weight:bold; }
A { color:#9f2f26; }
TT { color:#5b4b38; }
.smallnote { color:#6f6257; font-size:12px; }
</style>
</HEAD>
<BODY BGCOLOR="#f6f2ea">
$settings_nav_bar
<FORM ACTION="/apply/advanced" METHOD=GET>
$advanced_hidden
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR="#d7c0a0">
<TD><B><FONT SIZE=+2>$advanced_title</FONT></B></TD>
<TD ALIGN=RIGHT><IMG SRC="/static/smart_icon.jpg"><BR></TD>
</TR>
EOF
if( advanced_section_visible( $advanced_category, '5' ) )
{
print <<EOF;
<TR BGCOLOR="#ece0cf"><TD COLSPAN=2><B>IPX device flags</B></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Keep IPX devices/routes on stop</TD><TD ALIGN=RIGHT><INPUT NAME="dev_keep" TYPE=CHECKBOX$dev_keep></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Allow automatic kernel IPX interface creation</TD><TD ALIGN=RIGHT><INPUT NAME="dev_auto" TYPE=CHECKBOX$dev_auto></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Remove all IPX routes/devices on stop</TD><TD ALIGN=RIGHT><INPUT NAME="dev_remove_all" TYPE=CHECKBOX$dev_remove_all></TD></TR>
EOF
}
if( advanced_section_visible( $advanced_category, '8' ) )
{
print <<EOF;
<TR BGCOLOR="#ece0cf"><TD COLSPAN=2><B>Security / compatibility flags</B></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Ignore station/time restrictions for supervisor</TD><TD ALIGN=RIGHT><INPUT NAME="sec_supervisor_ignore" TYPE=CHECKBOX$sec_supervisor_ignore></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Limit volume free space information to 2 GB</TD><TD ALIGN=RIGHT><INPUT NAME="sec_2gb_free" TYPE=CHECKBOX$sec_2gb_free></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Enable direct INT17 printing for NETX clients</TD><TD ALIGN=RIGHT><INPUT NAME="sec_int17" TYPE=CHECKBOX$sec_int17></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Allow deleting open files <SPAN CLASS="smallnote">(advanced)</SPAN></TD><TD ALIGN=RIGHT><INPUT NAME="sec_delete_open" TYPE=CHECKBOX$sec_delete_open></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Allow renaming open files <SPAN CLASS="smallnote">(advanced)</SPAN></TD><TD ALIGN=RIGHT><INPUT NAME="sec_rename_open" TYPE=CHECKBOX$sec_rename_open></TD></TR>
EOF
}
if( advanced_section_visible( $advanced_category, '17' ) )
{
print <<EOF;
<TR BGCOLOR="#ece0cf"><TD COLSPAN=2><B>User / bindery flags</B></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Create empty login scripts when missing</TD><TD ALIGN=RIGHT><INPUT NAME="bindery_empty_scripts" TYPE=CHECKBOX$bindery_empty_scripts></TD></TR>
EOF
}
if( advanced_section_visible( $advanced_category, '18' ) )
{
print <<EOF;
<TR BGCOLOR="#ece0cf"><TD COLSPAN=2><B>Print queue flags</B></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD>Always disable print banner</TD><TD ALIGN=RIGHT><INPUT NAME="queue_no_banner" TYPE=CHECKBOX$queue_no_banner></TD></TR>
EOF
}
if( advanced_section_visible( $advanced_category, '22' ) )
{
print <<EOF;
<TR BGCOLOR="#ece0cf"><TD COLSPAN=2><B>Print server entries</B></TD></TR>
<TR BGCOLOR="#fbf7f1"><TD COLSPAN=2><TEXTAREA NAME="print_servers" ROWS=5 STYLE="width:100%">$print_server_rows</TEXTAREA><BR><SPAN CLASS="smallnote">One entry per line, without leading section number 22.</SPAN></TD></TR>
EOF
}
if( advanced_section_visible( $advanced_category, '50' ) || advanced_section_visible( $advanced_category, '80' ) )
{
print <<EOF;
<TR BGCOLOR="#ece0cf"><TD COLSPAN=2><B>Precompiled / path settings</B></TD></TR>
EOF
if( advanced_section_visible( $advanced_category, '50' ) )
{
print qq|\t<TR BGCOLOR="#fbf7f1"><TD>Conversion table file</TD><TD ALIGN=RIGHT><INPUT NAME="conversion_tables" TYPE=TEXT SIZE=45 VALUE="| . html_escape( $conversion_tables ) . qq|"></TD></TR>\n|;
}
if( advanced_section_visible( $advanced_category, '80' ) )
{
print qq|\t<TR BGCOLOR="#fbf7f1"><TD>Maximum directory search handles</TD><TD ALIGN=RIGHT><INPUT NAME="max_dir_search_handles" TYPE=TEXT SIZE=20 VALUE="| . html_escape( $max_dir_search_handles ) . qq|"></TD></TR>\n|;
}
}
if( advanced_section_visible( $advanced_category, '310' ) )
{
print qq|\t<TR BGCOLOR="#ece0cf"><TD COLSPAN=2><B>Watchdog behavior</B></TD></TR>\n|;
print qq|\t<TR BGCOLOR="#fbf7f1"><TD>Watchdog ticks</TD><TD ALIGN=RIGHT><INPUT NAME="watchdogs" TYPE=TEXT SIZE=20 VALUE="| . html_escape( $watchdogs ) . qq|"><BR><SPAN CLASS="smallnote">0 = always, -1 = never, positive value = only below ticks.</SPAN></TD></TR>\n|;
}
if( advanced_section_visible( $advanced_category, '400' ) || advanced_section_visible( $advanced_category, '401' ) || advanced_section_visible( $advanced_category, '402' ) )
{
print <<EOF;
<TR BGCOLOR="#ece0cf"><TD COLSPAN=2><B>Station access control</B></TD></TR>
EOF
if( advanced_section_visible( $advanced_category, '400' ) )
{
print qq|\t<TR BGCOLOR="#fbf7f1"><TD>Station file</TD><TD ALIGN=RIGHT><INPUT NAME="station_file" TYPE=TEXT SIZE=45 VALUE="| . html_escape( $station_file ) . qq|"></TD></TR>\n|;
}
if( advanced_section_visible( $advanced_category, '401' ) )
{
print <<EOF;
<TR BGCOLOR="#fbf7f1"><TD>Nearest server replies</TD><TD ALIGN=RIGHT><SELECT NAME="nearest_replies"><OPTION VALUE="0"$nearest_0>Always reply</OPTION><OPTION VALUE="1"$nearest_1>Station file is exclude list</OPTION><OPTION VALUE="2"$nearest_2>Station file is include list</OPTION></SELECT></TD></TR>
EOF
}
if( advanced_section_visible( $advanced_category, '402' ) )
{
print <<EOF;
<TR BGCOLOR="#fbf7f1"><TD>Connection replies</TD><TD ALIGN=RIGHT><SELECT NAME="connect_replies"><OPTION VALUE="0"$connect_0>Always allow</OPTION><OPTION VALUE="1"$connect_1>Station file is exclude list</OPTION><OPTION VALUE="2"$connect_2>Station file is include list</OPTION></SELECT></TD></TR>
EOF
}
}
print <<EOF;
<TR BGCOLOR="#d7c0a0">
<TD><INPUT TYPE=SUBMIT VALUE="OK"></TD>
<TD ALIGN=RIGHT><INPUT TYPE=RESET VALUE="Undo changes"><BR></TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
else
{
error( 404 );
}
}