Initial revision
authornborisov <nborisov>
Wed, 23 Oct 1996 05:30:24 +0000 (05:30 +0000)
committernborisov <nborisov>
Wed, 23 Oct 1996 05:30:24 +0000 (05:30 +0000)
[These were the first versions of these files imported
 into RCS. The last two commits have them from a tarball
 of a revision that was never in RCS. -- Michael Spang]

12 files changed:
Gopher.pl
admin.pl
cashbox.pl
forms.pl [changed mode: 0755->0644]
lib_sys.pl
libfmt.pl
main.pl
member.pl
misc.pl
novelty.pl
quota.pl
stats.pl

index cc81f8a..4940b90 100644 (file)
--- a/Gopher.pl
+++ b/Gopher.pl
@@ -28,7 +28,7 @@ sub Gopher_Quota
     {
         next if (/^\s*$/ || /^\s*#/);
         ($qdate, $quid, $qamt, $qtot, $qleft) = split(/;/);
-        next if $quid eq "csc@math";
+        next if $quid eq "csc\@math";
         $Quota{$QUOTA{$quid}} = $qtot;
     }
     close(QLOG);
index 2c2abab..ae1330a 100644 (file)
--- a/admin.pl
+++ b/admin.pl
@@ -2,6 +2,10 @@
 # Date                 Name                            Modification
 # ----          ----                ------------
 # 94/11/20             Alex Brodsky            Split off from main ceo file
+# 94/12/10      Zygo Blaxell        Added 'will not share acct'
+#                                   to CEO acct request message
+# 95/08/08             Nikita Borisov      Added show member info option
+# 96/09/17             Nikita Borisov      Updated user agreement date
 #
 # 
 
@@ -13,6 +17,7 @@ sub adminmenu
 Choose an option:
   (P)assword change
   Member (I)nfo change
+  S(H)ow Member Info
   (L)ibrary log (NOT the outstanding books)
   (S)ync gopher entries
   (R)eset ceo
@@ -21,7 +26,7 @@ Choose an option:
 
 (P,I,L,S,R,M): 
 EOM
-    @opts=('pdopwchange','idoupdatemember', 'ldoliblog',
+    @opts=('pdopwchange','idoupdatemember', 'hdomeminfoshow', 'ldoliblog',
             'sdosyncgopher','rdoreset','adoaccount','mmainmenu');
     $choice = &domenu($menu,@opts);
     return $choice;
@@ -53,7 +58,7 @@ sub doaccount
         return;
     }
        $forterm = $NEXTTERMMEMBER ? $NEXTTERM : $TERM;
-    $match = grep(/^$forterm$/,split(/,/,(split(/;/,$MEM{$memnum}))[7]));
+    $match = grep(/^$forterm/,split(/,/,(split(/;/,$MEM{$memnum}))[7]));
     unless ($match)
     {
         print "\n${beep}This member has not paid for the current term.\n";
@@ -85,7 +90,9 @@ o I am a member of the University of Waterloo community.
 o I am a member of the University of Waterloo Computer Science Club.
 
 o I have read, have signed, and will adhere to the CSC User Agreement
-  of 17 Apr, 1994.
+  of 15 February, 1995
+
+o I will not share my CSC account with anyone for any reason.
 
 To agree to these terms, answer "yes" below.
 
@@ -120,18 +127,18 @@ EOM
        $username = (split(/;/,$template))[4];
 
        ## If it's not obvious, throw it away
-       $username = "" if $username =~ /@/;
+       $username = "" if $username =~ /\@/;
 
        if ($username eq "")
        {
-               print "\n${beep}Sorry, we can't create an account on another machine.\n\n";
+               print "\n${beep}There is an error with the username you specified. \nEither you left it blank, or you specified a machine. \nChange this before re-applying\n\n";
                return;
        }
 
        ## Truncate the username
        $usernane =~ y/A-Z/a-z/;
        $username =~ s/[^a-z0-9-]//g;
-       substr($username,8)="";
+       $username =~ s/(^........).*/$1/;
 
        print "\nYour userid will be $username.\n\n";
 
@@ -162,10 +169,6 @@ EOM
        print TODO "/opt/local/admin/bin/newuser $username $init_passwd $gcos\n";
        close(TODO);
 
-       ## Mail to accounts
-       system <<EOJ;
-echo "Account requested for $username" | mail -s "Account creation requested" accounts
-EOJ
 }
 
 sub dopwchange
@@ -322,5 +325,50 @@ sub doupdatemember
     &Gopher_Members;
 }
 
+sub domeminfoshow
+{
+    print "\nEnter member number: ";
+    local($memnum);
+    chop($memnum = <STDIN>);
+    $memnum =~ s/\D//g;
+    if ($memnum == 0)
+    {
+        print "\n${beep}No number entered - aborting.\n\n";
+        return;
+    }
+    eval { %MEM=&fakedbmopen($MEMDB) } || do
+    {
+        print "\n${beep}Unable to open members database: $!\n";
+        return;
+    };
+    unless (defined $MEM{$memnum})
+    {
+        print "\n${beep}There is no member number $memnum on record - aborting.\n\n";
+        return;
+    }
+    local($template) = $MEM{$memnum};
+    &fakedbmclose($MEMDB,%MEM);
+
+       @tempfields = split(/;/,$template);
+
+    local($t5,$t7);
+    $t5 = $tempfields[5];
+    $t7 = $tempfields[7];
+       open(MEMNFO, ">$editfile");
+       print MEMNFO <<EOT;
+Member Number   : $memnum
+Name            : $tempfields[0]
+Student ID      : $tempfields[1]
+Year and Program: $tempfields[2]
+Phone number    : $tempfields[3]
+
+Userid          : $tempfields[4]
+
+Currently a member for $t7
+EOT
+       close(MEMNFO);
+    &MORE;
+}
+
 1;
 
index 5b94f11..8c25f50 100755 (executable)
@@ -177,5 +177,38 @@ sub UpdateCashlog
     &Backup($CASHLOG);
 }
 
+
+sub docashlog
+{
+    open(CASHLOG, $CASHLOG) || do
+    {
+        print "\n${beep}Unable to open cash log: $!\n";
+        return;
+    };
+    open(SCRCASHLOG, ">$editfile") || do
+    {
+        print "\n${beep}Unable to open output file: $!\n";
+        close(CASHLOG);
+        return;
+    };
+    select(SCRCASHLOG);
+    $-=0;
+    $= = $ROWS - 1;
+    ##$_ = `stty size`; ($=) = /^(\d+)/; $= -= 2;
+    while(<CASHLOG>)
+    {
+        next if (/^\s*$/ || /^\s*#/);
+        ($cashdate, $cashamt0, $cashlog, $cashtot0) = split(/;/);
+        $cashamt = sprintf("%.2f",$cashamt0);
+        $cashtot = sprintf("%.2f",$cashtot0);
+        write;
+    }
+    close(CASHLOG);
+    select(STDOUT);
+    close(SCRCASHLOG);
+    &MORE;
+}
+
+
 1;
 
old mode 100755 (executable)
new mode 100644 (file)
index 2cb5380..87c020f
--- a/forms.pl
+++ b/forms.pl
@@ -7,34 +7,24 @@
 
 format SCRMEMBER_TOP =
 
- #           Name          Student#    Program        Phone #        Userid
---- ---------------------- -------- -------------- ------------- --------------
+ #            Name          Student#    Program        Phone #        Userid
+---- ---------------------- -------- -------------- ------------- --------------
 .
 format SCRMEMBER =
-@>> @<<<<<<<<<<<<<<<<<<<<< @<<<<<<< @<<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<<<
+@>>> @<<<<<<<<<<<<<<<<<<<<< @<<<<<<< @<<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<<<
 $memnum, $memname,         $memsid, $memprog,       $memphone,    $memuid
 .
 
 format SCRQUOTA_TOP =
 
- #      Userid              Name          Student# Quota
---- -------------- ---------------------- -------- -----
+ #       Userid              Name          Student# Quota
+---- -------------- ---------------------- -------- -----
 .
 format SCRQUOTA =
-@>> @<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<< @<<<<<<<  @>>
+@>>> @<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<< @<<<<<<<  @>>
 $qnum, $quid,     $qname,                $qsid,    $qqta
 .
 
-format SCRLIBLOG_TOP =
-
- #           Name          Dir     Date                    Title
---- ---------------------- --- ------------ ------------------------------------
-.
-format SCRLIBLOG =
-@>> @<<<<<<<<<<<<<<<<<<<<< @<< @<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$lnum, $lname,            $ldir, $ldate,            $lbtitle
-.
-
 format SCRCASHLOG_TOP =
 
             Date                       Log Entry            Amount   Total
@@ -45,31 +35,21 @@ format SCRCASHLOG =
 $cashdate,                   $cashlog,                     $cashamt,$cashtot
 .
 
-format OUTSTAND_TOP =
-
- #           Name                Date                     Title
---- ---------------------- ---------------- -----------------------------------
-.
-format OUTSTAND =
-@>> @<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$onum, $oname,             $odate,              $obtitle
-.
-
 format GOPMEMBER_TOP =
  #           Name              Program        Phone #        Userid
---- ---------------------- --------------- ------------- --------------
+---- ---------------------- --------------- ------------- --------------
 .
 format GOPMEMBER =
-@>> @<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<<<
+@>>> @<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<<<
 $memnum, $memname,        $memprog,       $memphone,    $memuid
 .
 
 format GOPQUOTA_TOP =
- #      Userid              Name          Quota
---- -------------- ---------------------- -----
+ #       Userid              Name          Quota
+---- -------------- ---------------------- -----
 .
 format GOPQUOTA =
-@>> @<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<  @>>
+@>>> @<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<  @>>
 $qnum, $quid,     $qname,                 $qqta
 .
 
index 0613fae..519657a 100644 (file)
@@ -2,9 +2,12 @@
 # Date                 Name                            Modification
 # ----          ----                ------------
 # 94/09/12             Alex Brodsky            Split off from main ceo file
+# 96/05/17             Nikita Borisov          Added ISBN checks
 #
 # 
 
+require "/u/ceo/ceo/isbn.pl";
+
 sub librarymenu
 {
     local($menu) = <<EOM;
@@ -13,11 +16,12 @@ Choose an option:
   Sign a book (I)n
   Sign a book (O)ut
   (V)iew outstanding books list
+  (E)dit book list
   (M)ain menu
 
 (I,O,V,M): 
 EOM
-    @opts=('idobookin','odobookout','vdooutstanding','mmainmenu');
+    @opts=('idobookin','odobookout','vdooutstanding','mmainmenu','edoeditdb' );
     $choice = &domenu($menu,@opts);
     return $choice;
 }
@@ -25,12 +29,15 @@ EOM
 sub dobookin
 {
     local ($bid);
+       local ($yes);
     ## Get the book ID
     while(1)
     {
         print "Enter the book ID: ";
         chop($bid = <STDIN>);
         $bid =~ s/[^\w-]//g;
+               # let people type 0-07-054235-x
+               $bid =~ tr/x/X/;
         if ($bid =~ /^\s*$/)
         {
             print "\n${beep}No ID supplied - aborting.\n";
@@ -41,6 +48,12 @@ sub dobookin
             print "\n${beep}Invalid checksum - try again.\n\n";
             next;
         }
+               unless (&ISBN_checksum($bid)) {
+                       print "\n${beep}WARNING: Invalid ISBN: $bid.\n",
+                                 "Are you sure this is the right ID? ";
+                       $yes = <STDIN>;
+                       next unless $yes =~ /^y/i;
+               }
         last;
     }
 
@@ -63,6 +76,7 @@ sub dobookin
     ($btitle) = $LIB{$bid} =~ /N\{([^\}]*)\}/;
 
     dbmclose(LIB);
+    &Backup("$LIBDB.db");
     &Backup("$LIBDB.dir");
     &Backup("$LIBDB.pag");
 
@@ -90,7 +104,7 @@ sub dobookin
     print LIBLOG "$date;$whohad;$thename;IN;$bid;$btitle\n";
     close(LIBLOG);
 
-    &Backup($LIBRARYLOG);
+    Backup($LIBRARYLOG);
 
     print "\"$btitle\" has been received from $thename.\n";
 
@@ -160,6 +174,12 @@ sub dobookout
             print "\n${beep}Invalid checksum - try again.\n\n";
             next;
         }
+               unless (&ISBN_checksum($bid)) {
+                       print "\n${beep}WARNING: Invalid ISBN: $bid.\n",
+                                 "Are you sure this is the right ID? ";
+                       $yes = <STDIN>;
+                       next unless $yes =~ /^y/i;
+               }
         last;
     }
     
@@ -220,8 +240,9 @@ sub dobookout
         ($btitle) = $LIB{$bid} =~ /N\{([^\}]*)\}/;
 
         dbmclose(LIB);
-        &Backup("$LIBDB.dir");
-        &Backup("$LIBDB.pag");
+        &Backup("$LIBDB.db");
+               &Backup("$LIBDB.dir");
+               &Backup("$LIBDB.pag");
 
         print "\"$btitle\" has been signed out.\n";
 
@@ -317,6 +338,7 @@ sub MakeOutstandFile
         next if $whohas == 0;
         ($btitle) = $LIB{$bid} =~ /N\{([^\}]*)\}/;
         ($bodate) = $LIB{$bid} =~ /D\{([^\}]*)\}/;
+               $bodate =~ s/^[^ ]* (.*):\d* E.T/$1/;
         $Outstand{$bid}="$whohas#$btitle#$bodate";
     }
     dbmclose(LIB);
@@ -431,4 +453,105 @@ sub validbookID
     return 1;
 }
 
+sub dooutstanding
+{
+    ##$_ = `stty size`; ($height) = /^(\d+)/; $height -= 2;
+    $height = $ROWS - 2;
+    &MakeOutstandFile($height);
+    &MORE;
+}
+
+sub doeditdb
+{
+    local($memnum,$thename,$thepw,$bid,$flags,$btitle);
+    ## Who wants it?
+    unless ($ENV{'CALUM'} == 1){
+               print "Enter CSC member number: ";
+               chop($memnum=<STDIN>);
+               $memnum =~ s/\D//g;
+               if ($memnum =~ /^\s*$/)
+               {
+                       print "\n${beep}No member number supplied - aborting.\n";
+                       return;
+               }
+               $match = grep(/^$memnum$/,@oslist);
+               unless (($match || $cscmem == 0) && $cscmem =~ /\d/)
+               {
+                       print "Access denied.\n";
+                       return;
+               }
+
+               ## Get the info on this member
+               eval { %MEM=&fakedbmopen($MEMDB) } || do
+               {
+                       print "\n${beep}Unable to open member database: $!\n";
+                       return;
+               };
+               unless (defined $MEM{$memnum})
+               {
+                       print "\n${beep}No such member number is on record - aborting\n";
+                       &fakedbmclose($MEMDB,%MEM);
+                       return;
+               }
+               $match = grep(/^$TERM$/,split(/,/,(split(/;/,$MEM{$memnum}))[7]));
+               unless ($match)
+               {
+                       print "\n${beep}This member has not paid for the current term.\n";
+                       &fakedbmclose($MEMDB,%MEM);
+                       return;
+               }
+               ($thename, $thepw) = (split(/;/,$MEM{$memnum}))[0,5];
+               &fakedbmclose($MEMDB,%MEM);
+
+               if ($thepw ne "" && $ENV{'CALUM'} != 1)
+               {
+                       print "Enter your CSC password: ";
+                       if (crypt(&GetPass, $thepw) ne $thepw)
+                       {
+                               print "\n${beep}Incorrect password - aborting\n";
+                               return;
+                       }
+               }
+       }
+
+       if( !open(TMPFILE, ">lib.edit") ){
+        print "\n${beep}Error opening temporary file: $!\n";
+       }
+
+    ## Read the library file
+    dbmopen(LIB, $LIBDB, 0600) || do
+    {
+        print "\n${beep}Error opening library database: $!\n";
+               close TMPFILE;
+        return;
+    };
+
+       for (keys %LIB){
+               print TMPFILE "$_#$LIB{$_}\n";
+       }
+
+       close TMPFILE;
+
+       system( "rm -f lib.backup;cp lib.edit lib.backup" );
+       system( "/opt/bin/nvi lib.edit" );
+
+       if( open(TMPFILE, "lib.edit") ){
+               %LIB = ();
+               while( $_ = <TMPFILE> ){
+                       chomp $_;
+                       /^([^ ]*)#(.*)$/;
+                       $LIB{$1} = $2;
+               }
+               close TMPFILE;
+       } else {
+        print "\n${beep}Error opening temporary file: $!\n";
+       }
+
+       dbmclose(LIB);
+       &Backup("$LIBDB.db");
+       &Backup("$LIBDB.dir");
+       &Backup("$LIBDB.pag");
+
+       &Gopher_Outstanding;
+}
 1;
index a339cb5..38b47cf 100644 (file)
--- a/libfmt.pl
+++ b/libfmt.pl
@@ -19,10 +19,10 @@ $lnum, $lname,            $ldir, $ldate,            $lbtitle
 format OUTSTAND_TOP =
 
  #           Name                Date                     Title
---- ---------------------- ---------------- -----------------------------------
+--- ---------------------- ------------------------------------------------
 .
 format OUTSTAND =
-@>> @<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+@>> @<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 $onum, $oname,             $odate,              $obtitle
 .
 
diff --git a/main.pl b/main.pl
index 20791f9..ce82d3a 100644 (file)
--- a/main.pl
+++ b/main.pl
@@ -49,7 +49,7 @@ Choose an option:
   (S)tats
   (M)embership
   (Q)uota
-  (W)orld Wide Web (lynx 2.3.6)
+  (W)orld Wide Web (lynx 2.4.1)
   e(X)it
 
 (M,Q,N,L,C,A,S,W,X): 
index b4adc0b..bc89bdd 100644 (file)
--- a/member.pl
+++ b/member.pl
@@ -2,6 +2,14 @@
 # Date                 Name                            Modification
 # ----          ----                ------------
 # 94/11/20             Alex Brodsky            Split off from main ceo file
+# 94/12/10             Ian Goldberg            Added the memlist, do{term,all}mem
+#                                                                      functions that Alex forgot
+# 95/03/08      Zygo Blaxell           Scan member database when adding new
+#                                                                      users - forbid duplicate {user,student}id,
+#                                                                      print warning messages for names, phone #
+# 95/05/08      Nikita Borisov      Add an option to renew membership without
+#                                   a password
+# 95/06/01             Nikita Borisov          Added a "print who I am" for above routine
 #
 # 
 
@@ -22,15 +30,16 @@ NOTE: If you were last a member in S93 or later, and wish to become a member
 Choose an option:
   Buy membership for (N)ew member
   Buy membership for (O)ld member
+  Buy membership for old member (W)ithout password
   (T)his term's members
   (A)ll members on file
   (M)ain menu
 
-(N,O,T,A,M): 
+(N,O,W,T,A,M): 
 EOM
 
-    @opts = ('ndonewmember','odooldmember','tdotermmem','adoallmem',
-            'mmainmenu');
+    @opts = ('ndonewmember','odooldmember','wdowopasswd','tdotermmem',
+       'adoallmem', 'mmainmenu');
     $choice = &domenu($menu, @opts);
     return $choice;
 }
@@ -109,12 +118,46 @@ sub donewmember
         last if $i != $pos;
         ++$pos;
     }
+       # UserID check by zblaxell
+       local(%member_userids,%member_studentids,%member_names,%member_phones);
+       foreach (grep(/^\d+$/,keys(%MEM))) {
+               local($my_)=$MEM{$_};
+               $my_ =~ tr/A-Z/a-z/;
+               $my_ =~ tr/a-z0-9;\@//dc;
+               local($name,$studentid,$program,$phone,$userid)=split(/;/,$my_);
+               $userid =~ s/\@.*$//;
+               $userid=substr($userid,0,8);
+               $member_userids{$userid}.="$_, ";
+               $member_names{$name}.="$_, ";
+               $member_studentids{$studentid}.="$_, ";
+               $member_phones{$phone}.="$_, ";
+       }
     &fakedbmclose($MEMDB,%MEM);
     local($filled) = &memupdate(";;;;;;;");
     if ($filled eq "")
     {
         return;
     }
+       local($myfilled)=$filled;
+       $myfilled =~ tr/A-Z/a-z/;
+       $myfilled =~ tr/a-z0-9;\@//dc;
+       local($name,$studentid,$program,$phone,$userid)=split(/;/,$myfilled);
+       if ($phone && $member_phones{$phone}) {
+               print "\n${beep}Warning: Phone number $phone belongs to member(s) $member_phones{$phone}continuing...\n";
+       }
+       if ($name && $member_names{$name}) {
+               print "\n${beep}Warning: Name $name belongs to member(s) $member_names{$name}continuing...\n";
+       }
+       $userid =~ s/\@.*$//;
+       $userid = substr($userid,0,8);
+       if ($userid && $member_userids{$userid}) {
+               print "\n${beep}UserID $userid belongs to member(s) $member_userids{$userid}aborting.\n\n";
+               return;
+       }
+       if ($studentid && $member_studentids{$studentid}) {
+               print "\n${beep}StudentID $studentid belongs to member(s) $member_studentids{$studentid}aborting.\n\n";
+               return;
+       }
     print "\nEnter number of terms (\$$MEMBERFEE each): ";
     chop($numterms = <STDIN>);
     $numterms =~ s/\D//g;
@@ -148,13 +191,95 @@ sub donewmember
        }
     $MEM{$pos} = $filled;
     &fakedbmclose($MEMDB,%MEM);
-    &Backup("$MEMDB.dir");
-    &Backup("$MEMDB.pag");
+       # zblaxell:  replaced these with '$MEMDB'
+    #&Backup("$MEMDB.dir");
+    #&Backup("$MEMDB.pag");
+    &Backup("$MEMDB");
     print "\nInfo for membership card:\n\nName: $recs[0]\nNum : $pos\nTerm: $TERMRANGE\n";
     &UpdateCashlog($MEMBERFEE * $numterms,"New member #$pos ($recs[0]) for $TERMRANGE");
     &Gopher_Members;
 }
 
+sub dowopasswd
+{
+    local($useTERM) = $TERM;
+    local($useCAPTERM) = $CAPTERM;
+       local($numterms) = 1;
+    if ($NEXTTERMMEMBER)
+    {
+        $useTERM = $NEXTTERM;
+        $useCAPTERM = $useTERM;
+        $useCAPTERM =~ tr/a-z/A-Z/;
+    }
+    print "\nEnter member number: ";
+    local($memnum);
+    chop($memnum = <STDIN>);
+    $memnum =~ s/\D//g;
+    if ($memnum == 0)
+    {
+        print "\n${beep}No number entered - aborting.\n\n";
+        return;
+    }
+    eval { %MEM=&fakedbmopen($MEMDB) } || do
+    {
+        print "\n${beep}Unable to open members database: $!\n";
+        return;
+    };
+    unless (defined $MEM{$memnum})
+    {
+        print "\n${beep}There is no member number $memnum on record - aborting.\n\n";
+        return;
+    }
+    local($filled) = $MEM{$memnum};
+    &fakedbmclose($MEMDB,%MEM);
+
+#    local($filled) = &memupdate($template);
+    if ($filled eq "")
+    {
+        return;
+    }
+       @recs = split(/;/,$filled);
+       print "\n$recs[0]\n";
+    print "\nEnter number of terms (\$$MEMBERFEE each): ";
+    chop($numterms = <STDIN>);
+    $numterms =~ s/\D//g;
+    if ($numterms == 0)
+    {
+        print "\n${beep}No number entered - aborting.\n\n";
+        return;
+    }
+    if ($numterms < 1 || $numterms > 200)
+    {
+        print "\n${beep}Don't be silly - aborting.\n\n";
+        return;
+    }
+       $recs[7] .= '';
+       &AddNTerms($recs[7], $useTERM, $numterms);
+    $filled = join(';',@recs);
+
+    eval { %MEM=&fakedbmopen($MEMDB) } || do
+    {
+        print "\n${beep}Unable to open members database: $!\n";
+        return;
+    };
+       local($tt);
+       foreach $tt (@TERMRANGE)
+       {
+               local($termmem) = $MEM{$tt};
+               @mems = split(/,/,$termmem);
+               @find = grep($_ == $memnum, @mems);
+               unshift(@mems,$memnum) if $#find < 0;
+               $MEM{$tt} = join(',',sort {$a<=>$b} @mems);
+       }
+    $MEM{$memnum} = $filled;
+    &fakedbmclose($MEMDB,%MEM);
+    &Backup("$MEMDB.dir");
+    &Backup("$MEMDB.pag");
+    print "\nInfo for membership card:\n\nName: $recs[0]\nNum : $memnum\nTerm: $TERMRANGE\n";
+    &UpdateCashlog($MEMBERFEE * $numterms,"Old member #$memnum ($recs[0]) for $TERMRANGE");
+    &Gopher_Members;
+}
+
 sub dooldmember
 {
     local($useTERM) = $TERM;
@@ -283,7 +408,7 @@ EOT
     chop($tempfields[6] = `date`);
     if ($tempfields[5] eq "")
     {
-        print "\nYou may now choose a CSC password.  If you do not wish one, just press Return.\n";
+        print "\nYou may now choose a CSC password.  If you do not wish one, just press Return.\nPlease choose one that is EASY TO REMEMBER (like your cat's name):\n";
         while(1)
         {
             print "Enter password: ";
@@ -307,5 +432,57 @@ EOT
     return($template);
 }
 
+sub dotermmem
+{
+    &memlist($TERM);
+}
+
+sub doallmem
+{
+    &memlist("");
+}
+
+sub memlist
+{
+    local($nummems);
+    local($scope) = shift;
+    open (SCRMEMBER, ">$editfile") || do
+    {
+        print "\n${beep}Unable to open output file: $!\n";
+        return;
+    };
+    eval { %MEM=&fakedbmopen($MEMDB) } || do
+    {
+        print "\n${beep}Unable to open member database: $!\n";
+        close(SCRMEMBER);
+        return;
+    };
+    if ($scope eq "")
+    {
+        @list = sort {$a<=>$b} grep(/^\d+$/,keys %MEM);
+    }
+    else
+    {
+        @list = sort {$a<=>$b} split(/,/,$MEM{$scope});
+    }
+    select(SCRMEMBER);
+    $-=0;
+    $= = $ROWS - 1;
+    ##$_ = `stty size`; ($=) = /^(\d+)/; $= -= 2;
+    $nummems = 0;
+    foreach $memnum (@list)
+    {
+        ($memname,$memsid,$memprog,$memphone,$memuid,$mempw,$memdate,$memterms)
+            = split(/;/,$MEM{$memnum});
+        write;
+        ++$nummems;
+    }
+    &fakedbmclose($MEMDB,%MEM);
+    print "\nTotal: $nummems\n";
+    select(STDOUT);
+    close(SCRMEMBER);
+    &MORE;
+}
+
 1;
 
diff --git a/misc.pl b/misc.pl
index 7fdd69c..61ff3ce 100644 (file)
--- a/misc.pl
+++ b/misc.pl
@@ -7,12 +7,12 @@
 
 sub Secure
 {
-    system("chmod -w *");
+    #system("chmod -w *");
 }
 
 sub Unsecure
 {
-    system("chmod u+w *");
+    #system("chmod u+w *");
 }
 
 sub VI0
index 2aba39f..a4ede2b 100644 (file)
@@ -2,6 +2,9 @@
 # Date                 Name                            Modification
 # ----          ----                ------------
 # 94/11/20             Alex Brodsky            Split off from main ceo file
+# 95/10/14      Nikita Borisov      Added MousePads (aren't they cool? :)
+# 96/01/24      Nikita Borisov      Added FASS tickets (hack hack hack)
+# 96/01/29             Nikita Borisov          Removed FASS tickets option
 #
 # 
 
@@ -30,12 +33,14 @@ What to sell?
   (S)hirts
   (B)uttons
   (N)ovelty menu
+  m(O)use Pads
   (M)ain menu
 
-(P,S,B,N,M): 
+(P,S,B,N,O,M): 
 EOM
 
     @opts = ('pdosellpens','sdosellshirts','bdosellbuttons',
+                        'odosellmpads', # 'fdosellfass',
             'nnoveltymenu','mmainmenu');
     $choice = &domenu($menu,@opts);
     return $choice;
@@ -56,18 +61,35 @@ sub dosellbuttons
     &dosellsomething("buttons","buttons");
 }
 
+sub dosellmpads
+{
+    &dosellsomething("mousepads","mousepads");
+}
+
+sub dosellfass
+{
+       &dosellsomething("FASS Tickets", "fass");
+}
+
 sub dosellsomething
 {
     local($item,$code,$quant,$cost,$comm);
     $item = shift;
     $code = shift;
-    &Editscreen(<<EOT);
+    &Editscreen(<<EOT) unless $code eq "fass";
 Please fill in the following information for selling $item.
 
 Quantity  : 
 Total cost: \$
 Comments  : 
 EOT
+    &Editscreen(<<EOT) if $code eq "fass";
+Please fill in the following information for selling $item.
+
+Quantity  : 
+Total cost: \$
+Sold to   : 
+EOT
     &VI;
     ($quant, $cost, $comm) = split(/\n/,&Filterscreen);
     $quant =~ s/\D//g;
index c002537..d0ccdd8 100644 (file)
--- a/quota.pl
+++ b/quota.pl
@@ -1,7 +1,11 @@
 #
-# Date                 Name                            Modification
+# Date                        Modification
 # ----          ----                ------------
-# 94/11/20             Alex Brodsky            Split off from main ceo file
+# 94/11/20      Alex Brodsky        Split off from main ceo file
+# 95/11/28      Nikita Borisov      Added W96 quota special
+# 96/01/18      Nikita Borisov      Reworked how people buying 12 megs are
+#                                   charged
+# 96/03/19      Nikita Borisov      Removed W96 quota special
 #
 # 
 
@@ -41,7 +45,7 @@ sub dobuyquota
     local ($thename, $theidnum, $theuserid);
     chop($userid = <STDIN>);
     $userid =~ s/[^\w-]//g;
-    substr($userid,8)="";
+       $userid =~ s/^(.{8}).*/$1/;
     if ($userid eq "")
     {
         print "\n${beep}No userid supplied - aborting.\n\n";
@@ -76,7 +80,7 @@ sub dobuyquota
     {
         $cardnum = $QUOT{$userid};
         ($thename, $theidnum, $theuserid) = split(/;/,$QUOT{$cardnum});
-        substr($theuserid,8)="";
+               $theuserid =~ s/^(.{8}).*$/$1/;
         warn "Card number $cardnum is for userid $theuserid\n" unless
                 $theuserid eq $userid;
         dbmclose(QUOT);
@@ -168,6 +172,15 @@ EOS
 
     ## Compute cost
     $cost = $COSTPERMEG * $qadd;
+## W96 and beyond 10 meg rule 
+       do {
+         $cost = $COSTPERTENMEG * int($qadd / 10);
+         $cost += $COSTPERMEG * ($qadd % 10);
+         open(QLOG2, ">>$QUOTASPCLLOG") && do {
+               print QLOG2 "$date;$userid;$qadd;$cost\n";
+               close(QLOG2);
+         }
+    } if ($qadd >= 10);
     $cost += $ADMINCHARGE if $qadd < $NOADMINIFOVER || $NOADMINIFOVER == 0;
 
     chop($date = `date`);
@@ -206,11 +219,6 @@ EOS
 #rcp .mostrecent csc_disk@descartes:.mostrecent
 #rsh descartes -l csc_disk 'cat .mostrecent >> records/todo'
 
-    system <<EOJ;
-
-echo "$userid now has $tq MB quota" | mail -s "Quota update required" csc_disk
-EOJ
-
     &Gopher_Quota;
 }
 
@@ -238,7 +246,7 @@ sub doquotalist
     {
         next if (/^\s*$/ || /^\s*#/);
         ($qdate, $quid, $qamt, $qtot, $qleft) = split(/;/);
-        next if $quid eq "csc@math";
+        next if $quid eq "csc\@math";
         $Quota{$QUOTA{$quid}} = $qtot;
     }
     close(QLOG);
index f82a1e9..1355524 100644 (file)
--- a/stats.pl
+++ b/stats.pl
@@ -2,6 +2,7 @@
 # Date                 Name                            Modification
 # ----          ----                ------------
 # 94/11/20             Alex Brodsky            Split off from main ceo file
+# 95/10/06             Nikita Borisov          We create new accounts, not new members
 #
 # 
 
@@ -35,14 +36,33 @@ sub Statscash
        return sprintf("\$%.2f", $lastamount);
 }
 
+
 sub dostats
 {
+       local($date,@ltime);
        print "\nCSC Vital Statistics:\n";
        print "---------------------\n";
        print "Cash on hand: ", &Statscash, "\n";
        print "Total membership for $CAPTERM: ", &Statsmembers, "\n";
        open(QUOTA, $QUOTAINFO);
-       print <QUOTA>, "\n";
+       print <QUOTA>;
+       close(QUOTA);
+       ## New members last created:
+       print "New accounts last created: ";
+       @ltime = localtime((stat($USERTODOOLD))[9]);
+       $date = ('Sun ','Mon ','Tue ','Wed ','Thu ','Fri ','Sat ')[$ltime[6]];
+       $date .= ('Jan ','Feb ','Mar ','Apr ','May ','Jun ','Jul ','Aug ','Sep ','Oct ','Nov ','Dec ')[$ltime[4]];
+       $date .= sprintf("%2d ",$ltime[3]);
+       $date .= sprintf("%02d:%02d:%02d 19%02d",@ltime[2,1,0,5]);
+       print $date,"\n";
+       ## New quota done:
+       print "Quotas last updated: ";
+       @ltime = localtime((stat($QUOTATODOOLD))[9]);
+       $date = ('Sun ','Mon ','Tue ','Wed ','Thu ','Fri ','Sat ')[$ltime[6]];
+       $date .= ('Jan ','Feb ','Mar ','Apr ','May ','Jun ','Jul ','Aug ','Sep ','Oct ','Nov ','Dec ')[$ltime[4]];
+       $date .= sprintf("%2d ",$ltime[3]);
+       $date .= sprintf("%02d:%02d:%02d 19%02d",@ltime[2,1,0,5]);
+       print $date,"\n";
 }
 
 1;