fixed create_sysop so that the it has the correct BEGIN sequence, which will
[spider.git] / perl / create_sysop.pl
index dcab2f1559ca0281536da5c7e2c709335071f86e..1e553209d9045dacc65d7b2712cc0e83e2182428 100755 (executable)
@@ -9,6 +9,16 @@
 # $Id$
 # 
 
+# make sure that modules are searched in the order local then perl
+BEGIN {
+  # root of directory tree for this system
+  $root = "/spider"; 
+  $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
+
+  unshift @INC, "$root/perl";  # this IS the right way round!
+  unshift @INC, "$root/local";
+}
+
 use DXVars;
 use DXUser;
 
@@ -24,12 +34,34 @@ sub create_it
   $self->{lat} = $mylatitude;
   $self->{long} = $mylongtitude;
   $self->{email} = $myemail;
-  $self->{sort} = 'C';           # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
+  $self->{bbsaddr} = $mybbsaddr;
+  $self->{sort} = 'U';           # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
+  $self->{priv} = 9;             # 0 - 9 - with 9 being the highest
+  $self->{lastin} = 0;
+  $self->{dxok} = 1;
+  $self->{annok} = 1;
+
+  # write it away
+  $self->close();
+
+  # now do one for the alias
+  $self = DXUser->new($myalias);
+  $self->{name} = $myname;
+  $self->{qth} = $myqth;
+  $self->{qra} = $mylocator;
+  $self->{lat} = $mylatitude;
+  $self->{long} = $mylongtitude;
+  $self->{email} = $myemail;
+  $self->{bbsaddr} = $mybbsaddr;
+  $self->{sort} = 'U';           # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
   $self->{priv} = 9;             # 0 - 9 - with 9 being the highest
   $self->{lastin} = 0;
+  $self->{dxok} = 1;
+  $self->{annok} = 1;
 
   # write it away
   $self->close();
+
   DXUser->finish();
   print "New user database created as $userfn\n";
 }