X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=331ca00e0d51b08042e36f05014a478f0b7829b0;hb=64b4171276c84a8df58776608dd9f568adef27b2;hp=bce0255fd4750002963821575ccd462f5173ddda;hpb=8942c27356acc5d5f5a20134461bcf7e6bd6a044;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index bce0255f..331ca00e 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -77,7 +77,9 @@ sub start # issue a pc16 to everybody interested my $nchan = DXChannel->get($main::mycall); my @pc16 = DXProt::pc16($nchan, $cuser); - DXProt::broadcast_ak1a(@pc16); + for (@pc16) { + DXProt::broadcast_all_ak1a($_); + } Log('DXCommand', "$call connected"); # send prompts and things @@ -133,6 +135,22 @@ sub normal } else { $self->state('prompt'); } + } elsif ($self->{state} eq 'sysop') { + my $passwd = $self->{user}->passwd; + my @pw = split / */, $passwd; + if ($passwd) { + my @l = @{$self->{passwd}}; + my $str = "$pw[$l[0]].*$pw[$l[1]].*$pw[$l[2]].*$pw[$l[3]].*$pw[$l[4]]"; + if ($cmdline =~ /$str/) { + $self->{priv} = $self->{user}->priv; + } else { + $self->send($self->msg('sorry')); + } + } else { + $self->send($self->msg('sorry')); + } + delete $self->{passwd}; + $self->state('prompt'); } else { @ans = run_cmd($self, $cmdline); # if length $cmdline; @@ -288,7 +306,7 @@ sub finish # issue a pc17 to everybody interested my $nchan = DXChannel->get($main::mycall); my $pc17 = $nchan->pc17($self); - DXProt::broadcast_ak1a($pc17); + DXProt::broadcast_all_ak1a($pc17); Log('DXCommand', "$call disconnected"); $ref->del() if $ref;