#!/bin/sh # # CGI-script for userlist editting (Using bindery tools) # # Copyright 2000 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 . $WEBSERVE_ROOT/cgi-bin/functions . $WEBSERVE_ROOT/smart.conf if [ "$2" != "x" ]; then echo Content-Type: text/html echo; fi checkrefer checkparams $* checkbind if [ "$*" = "prn-flags" ]; then i=`getconfig 18 | cut -d" " -f2` $GENFORM < $SMART_ROOT/forms/prn-flags "$i" exit; fi declare -i i export `echo $* | sed "s/&/ /g"` if [ "$*" ]; then if [ "$DELETE" ]; then export DELETE="" nwborm $SERVER_LOGIN -t 3 -o $QUEUE $0 list x exit; elif [ "$EDIT" ]; then export EDIT="" COMMAND="` nwbpvalues $SERVER_LOGIN -t 3 -o $QUEUE -p Q_UNIX_PRINT | \ while read LINE; do if echo $LINE | grep -q '\['; then echo "$LINE"; fi; done | cut -b1-47 | $HEXASC`" SPOOLDIR="`nwbpvalues $SERVER_LOGIN -t 3 -o $QUEUE -p Q_DIRECTORY`" $GENFORM < $SMART_ROOT/forms/printer "$QUEUE" "$COMMAND" "$SPOOLDIR" fi; fi case "$1" in padd ) $GENFORM < $SMART_ROOT/forms/printer ;; list ) cat< Printers
- Printers
SelQueue nameQueue ID `nwbols $SERVER_LOGIN -t 3 | sort +1 | { read LINE i=0 while [ -n "$LINE" ]; do i=i+1 NAME=\`echo $LINE | cut -d" " -f1\` echo -n \ echo -n \\ echo -n \ echo -n $NAME echo -n \ echo $LINE | cut -d" " -f2 read LINE done; }`
Add print queue
EOF ;; esac