From: minima Date: Thu, 27 Jul 2000 12:16:33 +0000 (+0000) Subject: Make sure that a privilege is always defined even if it is 0 X-Git-Tag: R_1_43~31 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e06d5fa736172c044f769e791c23e7cd05ae3445;p=spider.git Make sure that a privilege is always defined even if it is 0 --- diff --git a/Changes b/Changes index d7985194..52381943 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ 27Jul00======================================================================= 1. made sure that 'en' is the default language on new users. +2. issue error message if shutdown is attempted by a low privileged user. +3. Make sure a privilege is defined for all users (even if it is 0). 26Jul00======================================================================= 1. added wantgrid (to control display of grid square info on DX Broadcasts) 2. added lastoper for controlling periodic demands for user info from other diff --git a/cmd/shutdown.pl b/cmd/shutdown.pl index 695748aa..1b3d8bb2 100644 --- a/cmd/shutdown.pl +++ b/cmd/shutdown.pl @@ -6,15 +6,14 @@ my $self = shift; my $call = $self->call; my $ref; - -if ($self->priv >= 5) { - foreach $ref (DXChannel::get_all()) { - $ref->send_now("D", DXProt::pc39($main::mycall, "Shutdown by $call")) - if $ref->is_node && $ref != $DXProt::me; - $ref->send_now("D", $self->msg('shutting')) if $ref->is_user; - } - - # give some time for the buffers to empty and then shutdown (see cluster.pl) - $main::decease = 250; +return (1, $self->msg('e5')) unless $self->priv >= 5; +foreach $ref (DXChannel::get_all()) { + $ref->send_now("D", DXProt::pc39($main::mycall, "Shutdown by $call")) if $ref->is_node && $ref != $DXProt::me; + $ref->send_now("D", $self->msg('shutting')) if $ref->is_user; } -return (1); + +# give some time for the buffers to empty and then shutdown (see cluster.pl) +$main::decease = 250; + + +return (1, $self->msg('shutting')); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 4994b313..60626ef4 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -64,7 +64,7 @@ sub start $self->send($self->msg('l2',$self->{name})); $self->send_file($main::motd) if (-e $main::motd); $self->state('prompt'); # a bit of room for further expansion, passwords etc - $self->{priv} = $user->priv; + $self->{priv} = $user->priv || 0; $self->{lang} = $user->lang || 'en'; $self->{pagelth} = $user->pagelth || 20; $self->{priv} = 0 if $line =~ /^(ax|te)/; # set the connection priv to 0 - can be upgraded later diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 7a324625..5133d9bc 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -96,7 +96,7 @@ sub start # remember type of connection $self->{consort} = $line; $self->{outbound} = $sort eq 'O'; - $self->{priv} = $user->priv; + $self->{priv} = $user->priv || 1; # other clusters can always be 'normal' users $self->{lang} = $user->lang || 'en'; $self->{isolate} = $user->{isolate}; $self->{consort} = $line; # save the connection type