]> dxcluster.org Git - spider.git/commitdiff
added set/user command
authordjk <djk>
Mon, 26 Apr 1999 18:54:21 +0000 (18:54 +0000)
committerdjk <djk>
Mon, 26 Apr 1999 18:54:21 +0000 (18:54 +0000)
cmd/set/user.pl [new file with mode: 0644]
perl/Messages

diff --git a/cmd/set/user.pl b/cmd/set/user.pl
new file mode 100644 (file)
index 0000000..a4b76bd
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# set any variable in the User file
+#
+# This is a hack - use the UTMOST CAUTION!!!!!!!!
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# $Id$
+#
+my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->priv < 9;
+
+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)
+
+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);
index 4be9b10920a94cdf19dd4377f2211f268c4d5b3b..e2be0e3fa36536ca68063854c1e5395f0159e5ae 100644 (file)
@@ -105,6 +105,10 @@ package DXM;
                                sloc => 'Cluster lat $_[0] long $_[1], DON\'T FORGET TO CHANGE YOUR DXVars.pm',
                                sqra => 'Cluster QRA Locator$_[0], DON\'T FORGET TO CHANGE YOUR DXVars.pm',
                                sorry => 'Sorry',
+                               suser1 => 'usage: callsign user_field_name value',
+                               suser2 => 'User $_[0] not found',
+                               suser3 => 'User field \'$_[0]\' was \'$_[1]\' now set to \'$_[2]\'',
+                               suser4 => 'User field name \'$_[0]\' doesn\'t exist',
                                talks => 'Talk flag set on $_[0]',
                                talku => 'Talk flag unset on $_[0]',
                                usernf => '*** User record for $_[0] not found ***',