2 # set a user's password
4 # Copyright (c) 1998 Iain Phillips G0RDI
7 # Syntax: set/pass <callsign> <password>
10 my ($self, $line) = @_;
11 my @args = split /\s+/, $line, 2;
12 my $call = shift @args;
17 if ($self->remotecmd || $self->inscript) {
18 $call ||= $self->call;
19 Log('DXCommand', $self->call . " attempted to change password for $call remotely");
20 return (1, $self->msg('e5'));
24 if ($self->priv < 9) {
25 Log('DXCommand', $self->call . " attempted to change password for $call");
26 return (1, $self->msg('e5'));
28 return (1, $self->msg('e29')) unless @args;
29 if ($ref = DXUser->get_current($call)) {
30 $ref->passwd($args[0]);
32 push @out, $self->msg("password", $call);
33 Log('DXCommand', $self->call . " changed password for $call");
35 push @out, $self->msg('e3', 'User record for', $call);
38 if ($self->conn->{csort} eq 'telnet' && $self->user->passwd) {
39 $self->conn->{decho} = $self->conn->{echo};
40 $self->conn->{echo} = 0;
41 push @out, $self->msg('pw0');
42 $self->state('passwd');
44 push @out, $self->msg('e5');