From: minima Date: Sat, 15 Jan 2005 22:03:46 +0000 (+0000) Subject: added inscript test to selected commands X-Git-Tag: 1.53~189 X-Git-Url: http://dxspider.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=5f2487385b59dbe88dc763fa9c26fe5a9b4a6b30;p=spider.git added inscript test to selected commands fixed problem with dxcommandmode in perl < 5.8 added spanish translations for script commands --- diff --git a/Changes b/Changes index 8904dd80..8c10c30c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ +15Jan05======================================================================= +1. knocked over a few possible ways of people annoying other people thru +the use of scripts +2. Fixed problem in DXCommandmode with an indirect call that did not work +in perl < 5.8.0. +3. Add Spanish translations of new scripting commands in help. 13Jan05======================================================================= 1. Fixed prompting in languages other than English. 2. Fixed language problem with spoof, but that simply hides a whole can of diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index 3aecaab0..dfdf9292 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -1754,8 +1754,6 @@ SEND messages to the sysop. === 6^SET/STARTUP ^Create a user startup script === 0^SET/STARTUP^Create your own startup script -=== 6^UNSET/STARTUP ^Remove a user startup script -=== 0^UNSET/STARTUP^Remove your own startup script Create a startup script of DXSpider commands which will be executed everytime that you login into this node. You can only input the whole script afresh, it is not possible to 'edit' it. Inputting a new script is @@ -1766,6 +1764,10 @@ You may find the (curiously named) command BLANK useful to break up the output. If you simply want a blank line, it is easier to input one or more spaces and press the key. +See UNSET/STARTUP to remove a script. + +=== 6^UNSET/STARTUP ^Remove a user startup script +=== 0^UNSET/STARTUP^Remove your own startup script You can remove your startup script with UNSET/STARTUP. === 5^SET/SPIDER [..]^Make the callsign an DXSpider node diff --git a/cmd/Commands_es.hlp b/cmd/Commands_es.hlp index 88536209..d7147319 100644 --- a/cmd/Commands_es.hlp +++ b/cmd/Commands_es.hlp @@ -1739,6 +1739,30 @@ en modo de SOLO-RECIBIR no pudiendo usar los comandos DX, ANN, etc. La única excepción que se le hace a un usuario no registrado es la de poder enviar un TALK o un mensaje al sysop. +=== 6^SET/STARTUP Crea un fichero de inicio de conexión para un usuario. +=== 0^SET/STARTUP Crea tu propio fichero de inicio de conexión. +Crea un fichero de conexión con los comandos del cluster que se +ejecutarán cada vez que conectes. Sólo se puede crear el fichero +completo, no pudiéndolo editar parcialmente. Hacer un fichero +personal de inicio de conexión es como hacer un mensaje con el +comando SEND. Para terminar el fichero escribe: /EX en la última +línea, para abandonar la creación de este fichero escribe: /ABORT. + +Puedes encontrar útil el comando "BLANK" para que la salida de datos +que pedimos en el fichero de conexión la tengamos en líneas separadas. +Si sólo quieres una línea en blanco, puedes hacer una línea con uno o +más espacios en blanco y darle ENTER. + +Puedes borrar tu fichero de conexión con el comando UNSET/STARTUP. + +SHOW/STARTUP Ver el fichero de inicio de conexión de un usuario. +SHOW/STARTUP Ver tu propio fichero de inicio de conexión + Para ver el contenido del fichero de conexión creado con SET/STARTUP. + +=== 6^UNSET/STARTUP Borra el fichero de inicio de conexión de un usuario +=== 0^UNSET/STARTUP Borra tu fichero de inicio de conexión. +Puedes borrar tu fichero de conexión con el comando UNSET/STARTUP. + === 0^SET/TALK^Acepta mensajes TALK === 0^UNSET/TALK^Deshabilita la recepción de mensajes TALK @@ -2118,6 +2142,10 @@ especifiques. podr sh/route n2tly +=== 6^SHOW/STARTUP Ver el fichero de inicio de conexión de un usuario. +=== 0^SHOW/STARTUP Ver tu propio fichero de inicio de conexión +Para ver el contenido del fichero de conexión creado con SET/STARTUP. + === 0^SHOW/SATELLITE [ ]^Muestra datos de seguimiento Muestra los datos para el seguimiento desde tu situación para un satélite que elijas, desde ahora o para las próximas horas. diff --git a/cmd/announce.pl b/cmd/announce.pl index 6b66d68e..5e0ff58c 100644 --- a/cmd/announce.pl +++ b/cmd/announce.pl @@ -17,7 +17,7 @@ my ($self, $line) = @_; my @f = split /\s+/, $line; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e9')) if !@f; return (1, $self->msg('e28')) unless $self->registered; diff --git a/cmd/bye.pl b/cmd/bye.pl index 653e9394..9a842efd 100644 --- a/cmd/bye.pl +++ b/cmd/bye.pl @@ -5,6 +5,7 @@ # my $self = shift; +return (1, $self->msg('e5')) if $self->inscript; # log out text if ($self->is_user && -e "$main::data/logout") { diff --git a/cmd/chat.pl b/cmd/chat.pl index a6321f5f..cace4508 100644 --- a/cmd/chat.pl +++ b/cmd/chat.pl @@ -10,7 +10,7 @@ my ($self, $line) = @_; my @f = split /\s+/, $line, 2; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e34')) unless @f == 2; return (1, $self->msg('e28')) unless $self->registered; diff --git a/cmd/demonstrate.pl b/cmd/demonstrate.pl index 53437b96..7ef0277e 100644 --- a/cmd/demonstrate.pl +++ b/cmd/demonstrate.pl @@ -16,7 +16,7 @@ my $mycall = $self->call; return (1, $self->msg('e7', $call)) unless $dxchan; return (1, $self->msg('e31', $call)) unless $dxchan->is_user; -if ($self->remotecmd) { +if ($self->remotecmd || $self->inscript) { Log('DXCommand', "$mycall is trying to 'demo' to $call remotely"); return (1, $self->msg('e5')); } diff --git a/cmd/do.pl b/cmd/do.pl index 7001d987..5fdeeb3d 100644 --- a/cmd/do.pl +++ b/cmd/do.pl @@ -9,7 +9,7 @@ # my ($self, $line) = @_; -return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd; +return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd || $self->inscript; Log('DXCommand', $self->call . " do $line" ); eval "$line"; return (1, $@ ? $@ : "Ok, done $line" ); diff --git a/cmd/dx.pl b/cmd/dx.pl index b0be3bd8..02fc3ca4 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -16,7 +16,7 @@ my $freq; my @out; my $valid = 0; my $localonly; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e28')) unless $self->registered; my @bad; diff --git a/cmd/export.pl b/cmd/export.pl index 0e803a2f..fc1ebfd5 100644 --- a/cmd/export.pl +++ b/cmd/export.pl @@ -14,7 +14,7 @@ my @body; my $ref; my $fn; -return (1, $self->msg("e5")) if $self->priv < 9 || $self->consort ne 'local' || $self->remotecmd; +return (1, $self->msg("e5")) if $self->priv < 9 || $self->consort ne 'local' || $self->remotecmd || $self->inscript; return (1, $self->msg("export1")) unless @f == 2 && $f[0] =~ /^\d+$/; $msgno = $f[0]; diff --git a/cmd/pc.pl b/cmd/pc.pl index 8e371ef2..dcc2f668 100644 --- a/cmd/pc.pl +++ b/cmd/pc.pl @@ -9,7 +9,7 @@ my $self = shift; my $line = shift; my @f = split /\s+/, $line; -return (1, $self->msg('e5')) if $self->priv < 8 || $self->remotecmd; +return (1, $self->msg('e5')) if $self->priv < 8 || $self->remotecmd || $self->inscript; my $call = uc shift @f; my $dxchan = DXChannel->get($call); diff --git a/cmd/save.pl b/cmd/save.pl index 02835ef7..0c4c8b22 100644 --- a/cmd/save.pl +++ b/cmd/save.pl @@ -9,7 +9,7 @@ # my ($self, $line) = @_; -return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd; +return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd || $self->inscript; my ($date_req, $time_req); my $app_req = '>'; diff --git a/cmd/send.pl b/cmd/send.pl index 722200b7..97a1c535 100644 --- a/cmd/send.pl +++ b/cmd/send.pl @@ -17,7 +17,7 @@ # $Id$ # my ($self, $line) = @_; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e36')) unless $self->state =~ /^prompt/; my @out; diff --git a/cmd/set/lockout.pl b/cmd/set/lockout.pl index b5c010fd..d25a5261 100644 --- a/cmd/set/lockout.pl +++ b/cmd/set/lockout.pl @@ -20,7 +20,7 @@ if ($self->priv < 9) { foreach $call (@args) { $call = uc $call; - unless ($self->remotecmd) { + unless ($self->remotecmd || $self->inscript) { if ($ref = DXUser->get_current($call)) { $ref->lockout(1); $ref->put(); diff --git a/cmd/set/passphrase.pl b/cmd/set/passphrase.pl index 41334ffd..9cd270c6 100644 --- a/cmd/set/passphrase.pl +++ b/cmd/set/passphrase.pl @@ -13,7 +13,7 @@ my @out; my $user; my $ref; -if ($self->remotecmd) { +if ($self->remotecmd || $self->inscript) { $call ||= $self->call; Log('DXCommand', $self->call . " attempted to change passphrase for $call remotely"); return (1, $self->msg('e5')); diff --git a/cmd/set/password.pl b/cmd/set/password.pl index c007299a..3a1dc242 100644 --- a/cmd/set/password.pl +++ b/cmd/set/password.pl @@ -14,7 +14,7 @@ my @out; my $user; my $ref; -if ($self->remotecmd) { +if ($self->remotecmd || $self->inscript) { $call ||= $self->call; Log('DXCommand', $self->call . " attempted to change password for $call remotely"); return (1, $self->msg('e5')); diff --git a/cmd/set/privilege.pl b/cmd/set/privilege.pl index ea9e218d..6d5fd4d2 100644 --- a/cmd/set/privilege.pl +++ b/cmd/set/privilege.pl @@ -15,7 +15,7 @@ my @out; my $user; my $ref; -if ($self->priv < 9 || $self->remotecmd) { +if ($self->priv < 9 || $self->remotecmd || $self->inscript) { Log('DXCommand', $self->call . " attempted to set privilege $priv for @args"); return (1, $self->msg('e5')); } @@ -26,7 +26,7 @@ if ($priv < 0 || $priv > 9) { foreach $call (@args) { $call = uc $call; - unless ($self->remotecmd) { + unless ($self->remotecmd || $self->inscript) { if ($ref = DXChannel->get($call)) { $ref->priv($priv); $ref->user->priv($priv); diff --git a/cmd/set/register.pl b/cmd/set/register.pl index 3fa3fcb9..3a7c7db5 100644 --- a/cmd/set/register.pl +++ b/cmd/set/register.pl @@ -21,7 +21,7 @@ return (1, $self->msg('reginac')) unless $main::reqreg; foreach $call (@args) { $call = uc $call; - unless ($self->remotecmd) { + unless ($self->remotecmd || $self->inscript) { if ($ref = DXUser->get_current($call)) { $ref->registered(1); $ref->put(); diff --git a/cmd/set/startup.pl b/cmd/set/startup.pl index 0c0c24b9..aff00ca1 100644 --- a/cmd/set/startup.pl +++ b/cmd/set/startup.pl @@ -6,7 +6,7 @@ # $Id$ # my ($self, $line) = @_; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e5')) if $line && $self->priv < 6; return (1, $self->msg('e36')) unless $self->state =~ /^prompt/; diff --git a/cmd/show/startup.pl b/cmd/show/startup.pl index 1f160c1b..6bb3e854 100644 --- a/cmd/show/startup.pl +++ b/cmd/show/startup.pl @@ -6,7 +6,7 @@ # $Id$ # my ($self, $line) = @_; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e5')) if $line && $self->priv < 5; my @out; diff --git a/cmd/show/var.pl b/cmd/show/var.pl index eee2432f..f68577f8 100644 --- a/cmd/show/var.pl +++ b/cmd/show/var.pl @@ -9,7 +9,7 @@ # my ($self, $line) = @_; -return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd; +return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd || $self->inscript; return (1, $self->msg('e9')) unless $line; my @f = split /\s+/, $line; my $f; diff --git a/cmd/spoof.pl b/cmd/spoof.pl index e8ee5c55..5336a324 100644 --- a/cmd/spoof.pl +++ b/cmd/spoof.pl @@ -15,7 +15,7 @@ my $mylang = $self->lang; my ($call, $newline) = split /\s+/, $line, 2; return (1, $self->msg('nodee1', $call)) if DXChannel->get($call); -if ($self->remotecmd) { +if ($self->remotecmd || $self->inscript) { Log('DXCommand', "$mycall is trying to spoof $call remotely"); return (1, $self->msg('e5')); } diff --git a/cmd/talk.pl b/cmd/talk.pl index f21e2851..2815ad39 100644 --- a/cmd/talk.pl +++ b/cmd/talk.pl @@ -12,7 +12,7 @@ my $via; my $line; my $from = $self->call; my @out; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; # analyse the line there are four situations... # 1) talk call diff --git a/cmd/unset/lockout.pl b/cmd/unset/lockout.pl index 5cc1ac3d..d8c8a126 100644 --- a/cmd/unset/lockout.pl +++ b/cmd/unset/lockout.pl @@ -20,7 +20,7 @@ if ($self->priv < 9) { foreach $call (@args) { $call = uc $call; - unless ($self->remotecmd) { + unless ($self->remotecmd || $self->inscript) { if ($ref = DXUser->get_current($call)) { $ref->lockout(0); $ref->put(); diff --git a/cmd/unset/passphrase.pl b/cmd/unset/passphrase.pl index 213e4f92..9bf6a61c 100644 --- a/cmd/unset/passphrase.pl +++ b/cmd/unset/passphrase.pl @@ -12,7 +12,7 @@ my @out; my $user; my $ref; -if ($self->remotecmd) { +if ($self->remotecmd || $self->inscript) { Log('DXCommand', $self->call . " attempted to unset passphrase for @args remotely"); return (1, $self->msg('e5')); } diff --git a/cmd/unset/password.pl b/cmd/unset/password.pl index 6fdc9257..fcaa4c74 100644 --- a/cmd/unset/password.pl +++ b/cmd/unset/password.pl @@ -12,7 +12,7 @@ my @out; my $user; my $ref; -if ($self->remotecmd) { +if ($self->remotecmd || $self->inscript) { Log('DXCommand', $self->call . " attempted to unset password for @args remotely"); return (1, $self->msg('e5')); } diff --git a/cmd/unset/register.pl b/cmd/unset/register.pl index 8685a13b..555fe021 100644 --- a/cmd/unset/register.pl +++ b/cmd/unset/register.pl @@ -21,7 +21,7 @@ return (1, $self->msg('reginac')) unless $main::reqreg; foreach $call (@args) { $call = uc $call; - unless ($self->remotecmd) { + unless ($self->remotecmd || $self->inscript) { if ($ref = DXUser->get_current($call)) { $ref->registered(0); $ref->put(); diff --git a/cmd/unset/startup.pl b/cmd/unset/startup.pl index 36ee830d..77cc3ea4 100644 --- a/cmd/unset/startup.pl +++ b/cmd/unset/startup.pl @@ -6,7 +6,7 @@ # $Id$ # my ($self, $line) = @_; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e5')) if $line && $self->priv < 5; my @out; diff --git a/cmd/wx.pl b/cmd/wx.pl index 17aef89e..22b5e0cc 100644 --- a/cmd/wx.pl +++ b/cmd/wx.pl @@ -23,7 +23,7 @@ my $from = $self->call; my $t = ztime(time); my $tonode; my $sysopflag; -return (1, $self->msg('e5')) if $self->remotecmd; +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e28')) unless $self->registered; if ($sort eq "FULL") { diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 0f25a5dd..ca3afd6f 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -116,6 +116,7 @@ $count = 0; newroute => '1,New Style Routing,yesno', ve7cc => '0,VE7CC program special,yesno', lastmsgpoll => '0,Last Msg Poll,atime', + inscript => '9,In a script,yesno', ); use vars qw($VERSION $BRANCH); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 7b69ad22..80a31ed5 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -958,7 +958,7 @@ sub do_entry_stuff my $loc = $self->{loc} || confess "local var gone missing" ; if ($line eq "\032" || $line eq '%1A' || uc $line eq "/EX") { no strict 'refs'; - push @out, $loc->{endaction}($self); + push @out, &{$loc->{endaction}}($self); # like this for < 5.8.0 $self->func(undef); $self->state('prompt'); } elsif ($line eq "\031" || uc $line eq "/ABORT" || uc $line eq "/QUIT") { diff --git a/perl/Script.pm b/perl/Script.pm index 8fdd8064..24593aee 100644 --- a/perl/Script.pm +++ b/perl/Script.pm @@ -57,7 +57,9 @@ sub run my $dxchan = shift; foreach my $l (@{$self->{lines}}) { unless ($l =~ /^\s*\#/ || $l =~ /^\s*$/) { + $dxchan->inscript(1); my @out = DXCommandmode::run_cmd($dxchan, $l); + $dxchan->inscript(0); if ($dxchan->can('send_ans')) { $dxchan->send_ans(@out); } else {