19Nov07=======================================================================
1. change MRTG graphs to be based on GMT, not localtime. This allows one to
more easily compare debug data with traffic graphs.
+2. Add a create/user command to just add a plain user.
17Nov07=======================================================================
1. Add Local::ann() as requested by Felipe PY1NB.
16Nov07=======================================================================
'^set/nota', 'unset/talk', 'unset/talk',
'^set/noww', 'unset/wwv', 'unset/wwv',
'^set/nowx', 'unset/wx', 'unset/wx',
- '^set/user', 'unset/node', 'unset/node',
'^set$', 'apropos set', 'apropos',
'^sho?w?/u$', 'show/user', 'show/user',
'^sho?w?/bul', 'show/files bulletins', 'show/files',
],
'u' => [
'^uns?e?t?$', 'apropos unset', 'apropos',
+ '^uns?e?t?/node$', 'set/user', 'set/user',
],
'v' => [
],
use the script in /spider/connect/<callsign> to effect the 'chat' exchange
necessary to traverse the network(s) to logon to the cluster <callsign>.
+=== 5^CREATE/USER <callsign> ...^Create this user from the User Database
+This command will create one or more new users. None of the fields
+like name, qth etc will be filled in. It is just a new entry in the user
+database to which one can add more stuff like SET/PASSWORD or by SPOOF.
+
=== 9^DELETE/USDB <callsign> ...^Delete this user from the US State Database
This command will completely remove a one or more callsigns
from the US States database.
--- /dev/null
+#
+# create a user
+#
+# Please note that this is only effective if the user is not on-line
+#
+# Copyright (c) 1998 - Dirk Koopman
+#
+#
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+my $user;
+my $create;
+
+return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd;
+
+foreach $call (@args) {
+ $call = uc $call;
+ $user = DXUser->get($call);
+ unless ($user) {
+ $user = DXUser->new($call);
+ $user->sort('U');
+ $user->homenode($main::mycall);
+ $user->close();
+ push @out, $self->msg('creuser', $call);
+ } else {
+ push @out, $self->msg('hasha', $call, 'Users');
+ }
+}
+return (1, @out);
+
+
+
+
+
+
+
+
+
+
#
-# set any variable in the User file
+# set back to user
#
-# This is a hack - use the UTMOST CAUTION!!!!!!!!
+# Please note that this is only effective if the user is not on-line
#
-# Copyright (c) 1999 Dirk Koopman G1TLH
+# Copyright (c) 1998 - Dirk Koopman
#
#
#
-my ($self, $line) = @_;
-return (1, $self->msg('e5')) if $self->priv < 9;
+my ($self, $line) = @_;
my @args = split /\s+/, $line;
-return (1, $self->msg('suser1')) if @args < 3;
-
-my $call = uc $args[0];
-my $ref = DXUser->get_current($call);
-my $field = $args[1];
-my $value = $args[2];
-
-return (1, $self->msg('suser2', $call)) unless $ref;
-return (1, $self->msg('suser4', $field)) unless $ref->field_prompt($field);
+my $call;
my @out;
+my $user;
+my $create;
-# set it (dates and silly things like that can come later)
-
-my $oldvalue = $ref->{$field};
-$ref->{$field} = $value;
-$ref->put();
-
-push @out, $self->msg('suser3', $field, $oldvalue, $value);
-push @out, print_all_fields($self, $ref, "User Information $call");
+return (1, $self->msg('e5')) if $self->priv < 5;
+foreach $call (@args) {
+ $call = uc $call;
+ my $chan = DXChannel::get($call);
+ if ($chan) {
+ push @out, $self->msg('nodee1', $call);
+ } else {
+ $user = DXUser->get($call);
+ return (1, $self->msg('usernf', $call)) if !$user;
+ $user->sort('U');
+ $user->priv(0);
+ $user->close();
+ push @out, $self->msg('nodeu', $call);
+ }
+}
return (1, @out);
--- /dev/null
+#
+# set any variable in the User file
+#
+# This is a hack - use the UTMOST CAUTION!!!!!!!!
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+#
+#
+my ($self, $line) = @_;
+
+my @args = split /\s+/, $line;
+return (1, $self->msg('suser1')) if @args < 3;
+
+
+my $call = uc $args[0];
+my $ref = DXUser->get_current($call);
+my $field = $args[1];
+my $value = $args[2];
+
+return (1, $self->msg('suser2', $call)) unless $ref;
+return (1, $self->msg('suser4', $field)) unless $ref->field_prompt($field);
+my @out;
+
+# set it (dates and silly things like that can come later)
+
+if ($self->priv < 9 || $self->remotecmd || $self->inscript) {
+ Log('DXCommand', $self->call . " attempted to set user var $field=$value on $call remotely");
+ push @out, $self->msg('sorry');
+}
+
+my $oldvalue = $ref->{$field};
+$ref->{$field} = $value;
+$ref->put();
+
+push @out, $self->msg('suser3', $field, $oldvalue, $value);
+push @out, print_all_fields($self, $ref, "User Information $call");
+
+return (1, @out);
+++ /dev/null
-#
-# set user type BACK TO 'U' (user)
-#
-# Please note that this is only effective if the user is not on-line
-#
-# Copyright (c) 1998 - Dirk Koopman
-#
-#
-#
-
-my ($self, $line) = @_;
-my @args = split /\s+/, $line;
-my $call;
-my @out;
-my $user;
-my $create;
-
-return (1, $self->msg('e5')) if $self->priv < 5;
-
-foreach $call (@args) {
- $call = uc $call;
- my $chan = DXChannel::get($call);
- if ($chan) {
- push @out, $self->msg('nodee1', $call);
- } else {
- $user = DXUser->get($call);
- return (1, $self->msg('usernf', $call)) if !$user;
- $user->sort('U');
- $user->priv(0);
- $user->close();
- push @out, $self->msg('nodeu', $call);
- }
-}
-return (1, @out);
confail => 'connection to $_[0] failed ($_[1])',
constart => 'connection to $_[0] started',
conbump => 'Reconnected as $_[0] at $_[1], this instance is disconnected',
+ creuser => 'User $_[0] has been created',
deluser => 'User $_[0] has been deleted',
db1 => 'This database is hosted at $_[0]',
db2 => 'Sorry, but key: $_[0] was not found in $_[1]',
$version = '1.54';
$subversion = '0';
-$build = '191';
+$build = '192';
1;