Files
mars-smart/settings.pl
Mario Fetka bb9392b9b0 Add smart
2026-04-21 04:52:41 +02:00

1705 lines
36 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 handle_request()
{
if( $c[1] eq 'general' )
{
$server_name = getconfigline( 2 );
$internal_net = getconfigline( 3 );
( $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>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/general" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD>
<B><FONT SIZE=+2>General settings</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Burst mode</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Burst mode:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="burst_enabled" TYPE=CHECKBOX$burst_enabled_0><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Timing</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/dirs" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD>
<B><FONT SIZE=+2>Directories</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<B>Spool directory:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="spool" TYPE=TEXT SIZE=32 VALUE="$spool"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Bindery files:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="bindery" TYPE=TEXT SIZE=32 VALUE="$bindery"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Attribute handling files:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="attribute" TYPE=TEXT SIZE=32 VALUE="$attribute"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Trustee handling files:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="trustee" TYPE=TEXT SIZE=32 VALUE="$trustee"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/configh" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD>
<B><FONT SIZE=+2>Precompiled settings</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<B><TT>mmap()</TT> calls:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="mmap" TYPE=CHECKBOX$mmap_0><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Limits</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/security" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD>
<B><FONT SIZE=+2>Security</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/susers" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD>
<B><FONT SIZE=+2>User configuration</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Guest user</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>User:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="guest_user" SIZE=5>
$guest_user_list
</SELECT><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Group:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="guest_group" SIZE=5>
$guest_group_list
</SELECT><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Supervisor user</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Username:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="root_name" TYPE=TEXT SIZE=20 VALUE="$root_name"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Unix user:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="root_user" SIZE=5>
$root_list
</SELECT><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Password:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="root_password" TYPE=PASSWORD SIZE=20 VALUE="$root_password"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>User mapping</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/logging" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD>
<B><FONT SIZE=+2>Logging</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Logfiles</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Parts to log</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>General logging flags</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Routing logging flags</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<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]">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/volumes/$c[0]" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<B>Volume name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="name" TYPE=TEXT SIZE=32 VALUE="$c[0]"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Unix path:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="path" TYPE=TEXT SIZE=32 VALUE="$c[1]"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Additional options</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Removable:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="m" TYPE=CHECKBOX$m><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>No fixed i-nodes:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="n" TYPE=CHECKBOX$n><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Single filesystem:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="o" TYPE=CHECKBOX$o><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Pipe filesystem:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="p" TYPE=CHECKBOX$p><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Read-only:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="r" TYPE=CHECKBOX$r><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Additional namespaces</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>OS/2 LFN support:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="O" TYPE=CHECKBOX$O><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>NFS support:</B>
</TD>
<TD ALIGN=RIGHT>
Enabled<INPUT NAME="N" TYPE=CHECKBOX$N><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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 '' )
{
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<BODY BGCOLOR=$COLOR_BACK>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<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]">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD COLSPAN=2>
<B><A HREF="/settings/devices/add_new">Add new device</A></B>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
else
{
$c = getconfigline( '4 ' . $c[2] );
@c = split( ' ', $c );
$c[2] =~ s/\.//g;
eval( '$frametype_' . $c[2] . ' = " SELECTED";' );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/devices/$c[0]" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD>
<B><FONT SIZE=+2>Device: $c[0]</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Network number:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="number" TYPE=TEXT SIZE=20 VALUE="$c[0]"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Network interface:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="interface" TYPE=TEXT SIZE=20 VALUE="$c[1]"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<B>Interface delay:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="delay" TYPE=TEXT SIZE=20 VALUE="$c[3]"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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' )
{
open( FILE, '<' . $smart_nwclient_path ) or die "Could not open $smart_nwclient_path: $!";
$x = <FILE>;
close( FILE );
chomp( $x );
( $bind_server, $bind_user, $bind_pass ) = split( '[/ ]', $x );
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/smart" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD>
<B><FONT SIZE=+2>SMArT settings</FONT></B>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="/static/smart_icon.jpg"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_SUBH_BACK>
<TD COLSPAN=2>
<B><FONT>Bindery server</FONT></B><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<B>Supervisor password:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="bind_pass" TYPE=PASSWORD SIZE=20 VALUE="$bind_pass"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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' )
{
$server = get_server();
if( $c[2] eq '' )
{
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<BODY BGCOLOR=$COLOR_BACK>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<A HREF="/settings/users/$c[0]">$c[0]</A>
</TD>
<TD ALIGN=RIGHT>
<A HREF="/apply/users/$c[0]">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR=$COLOR_HEAD_BACK>
<TD COLSPAN=2>
<B><A HREF="/settings/users/add_new">Add new user</A></B>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
EOF
}
else
{
$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
{
foreach $u ( unix_userlist() )
{
$unix_user_list .= "\t\t\t" . '<OPTION VALUE="' . $u->{name} . '">' . $u->{name} . '</OPTION>' . "\n";
}
foreach $g ( @allgroups )
{
$g =~ s/ .*//;
$group_list .= "\t\t\t" . $g . '<INPUT TYPE=CHECKBOX NAME="group_' . $g . '"><BR>' . "\n";
}
}
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/users/$c[2]" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<B>Account name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="name" TYPE=TEXT SIZE=20><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Full name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="fullname" TYPE=TEXT SIZE=20 VALUE="$fullname"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Password:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="password" TYPE=PASSWORD SIZE=20><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>UNIX user:</B>
</TD>
<TD ALIGN=RIGHT>
<SELECT NAME="unix_user" SIZE=5>
$unix_user_list </SELECT>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Groups belonged to:</B>
</TD>
<TD ALIGN=RIGHT>
$group_list </TD>
</TR>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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 'groups' )
{
$server = get_server();
if( $c[2] eq '' )
{
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<BODY BGCOLOR=$COLOR_BACK>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<A HREF="/settings/groups/$c[0]">$c[0]</A>
</TD>
<TD ALIGN=RIGHT>
<A HREF="/apply/groups/$c[0]">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/groups/$c[2]" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<B>Group name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="name" TYPE=TEXT SIZE=20><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Full name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="fullname" TYPE=TEXT SIZE=20 VALUE="$fullname"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Group managers:</B>
</TD>
<TD ALIGN=RIGHT>
$man_list </TD>
</TR>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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>
<BODY BGCOLOR=$COLOR_BACK>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<A HREF="/settings/queues/$c[0]">$c[0]</A>
</TD>
<TD ALIGN=RIGHT>
<A HREF="/apply/queues/$c[0]">Delete</A><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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 = '';
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' );
}
print <<EOF;
HTTP/1.0 200 OK
Content-Type: text/html
$server_id
<HTML>
<BODY BGCOLOR=$COLOR_BACK>
<FORM ACTION="/apply/queues/$c[2]" METHOD=GET>
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
<TR BGCOLOR=$COLOR_HEAD_BACK>
<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=$COLOR_TEXT_BACK>
<TD>
<B>Queue name:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="name" TYPE=TEXT SIZE=32><BR>
</TD>
</TR>
EOF
}
print <<EOF;
<TR BGCOLOR=$COLOR_TEXT_BACK>
<TD>
<B>Unix printing command:</B>
</TD>
<TD ALIGN=RIGHT>
<INPUT NAME="unix_print" TYPE=TEXT SIZE=32 VALUE="$unix_print"><BR>
</TD>
</TR>
<TR BGCOLOR=$COLOR_TEXT_BACK>
<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=$COLOR_HEAD_BACK>
<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 );
}
}