chiark / gitweb /
Bugfixes, discard generation stuff.
authorijackson <ijackson>
Tue, 22 Jun 1999 16:15:22 +0000 (16:15 +0000)
committerijackson <ijackson>
Tue, 22 Jun 1999 16:15:22 +0000 (16:15 +0000)
bcp5-registry.pl
config.pl
database.pl
passwords.pl
template.html

index d5276a5a2573fae37169e4bc6eb097fe2f803cb4..4861b28d7fc4cc5977b60ec07ac479b76cb3d512 100755 (executable)
@@ -69,6 +69,7 @@ $intro= 0;
 $error= 0;
 $registernew= 0;
 $pick= 0;
+$deleted= 0;
 $pickvarsubnet= 8;
 $pickvarprefix= 24;
 $pick28check= '';
@@ -104,11 +105,10 @@ if (length $in{'register'}) {
     read_database();
     
     $id= randnybs(16);
-    $generation= 0;
     $db{$id}= $ent= { };
     $ent->{'created'}= $now;
     $ent->{'changed'}= 0;
-    $email= $in{'email'};
+    $alwaysemail= $email= $in{'email'};
     set_entry();
 
     $justcreated= 1;
@@ -144,7 +144,6 @@ if (length $in{'register'}) {
     read_database();
     get_entry();
     check_password();
-    check_generation();
 
     $ent->{'changed'}= $now;
     $email= length($in{'email'}) ? $in{'email'} : $db{$id}->{'email'};
@@ -160,12 +159,13 @@ if (length $in{'register'}) {
     read_database();
     get_entry();
     check_password();
-    check_generation();
-    
+
+    $deleted= 1;
+    show_entry();
+
     delete $db{$id};
     write_database();
 
-    $deleted= 1;
     finish();
 
 } elsif (length $in{'pick'}) {
@@ -246,7 +246,8 @@ sub show_entry () {
        $$dk= gmtime($$k)." GMT";
     }
     $alwaysemail= $email;
-    if ($ent->{'hiddenemail'} && !$justcreated && !$fulldetails && !$justupdated) {
+    if ($ent->{'hiddenemail'} && !$justcreated && \
+              !$fulldetails && !$justupdated && !$deleted) {
        $displayemail= 0;
        $email= '';
     } else {
@@ -256,10 +257,6 @@ sub show_entry () {
     $emailhidechecked= $ent->{'hiddenemail'} ? 'checked' : '';
 }
 
-sub check_generation () {
-    $ent->{'generation'} eq $ent->{'generation'} or finish_error('generation');
-}
-
 sub set_entry () {
     my ($v, $b, @b, $val, $mask);
     $net= $in{'net'};
@@ -270,7 +267,7 @@ print DEBUG "set_entry parsed netrange $network $prefix\n";
 print DEBUG "$current_areai\n";
     $current_areai>=0 or finish_error("wrongnet");
 print DEBUG "ok\n";
-    
+
     foreach $v (qw(name contact email)) {
        $$v= $in{$v} unless $v eq 'email';
        length $$v or finish_error("no$v");
@@ -278,7 +275,7 @@ print DEBUG "ok\n";
     }
     $hiddenemail= !!length $in{'hiddenemail'};
 
-    foreach $k (qw(generation network prefix name contact email hiddenemail)) {
+    foreach $k (qw(network prefix name contact email hiddenemail)) {
        $ent->{$k}= $$k;
     }
 
@@ -343,7 +340,7 @@ sub finish_error ($) {
     my ($type) = @_;
     my ($t, $esel, $f);
     foreach $t (qw(noemail nonet noname nocontact badsize wrongsize badnet wrongnet
-                  nopassword badpassword notfound generation badchar)) {
+                  nopassword badpassword notfound badchar)) {
        $esel= "error_$t";
        $$esel= 0;
        $f=1 if $type eq $t;
index 8c60597cf69bc7aca096b76c6ca9eb1a5a0fdef5..a9bb4c9ede18678cbeaef19365f79ab0cc70cd9d 100644 (file)
--- a/config.pl
+++ b/config.pl
@@ -5,6 +5,6 @@ $nameboxlen= 55;
 $contactboxlen= 55;
 $emailboxlen= 55;
 $nullemail= 'discard-all@chiark.greenend.org.uk';
-$cgi= 'http://www.chiark.greenend.org.uk/ucgi/~ijackson/cam-g-rin';
+$cgi= 'http://www.chiark.greenend.org.uk/ucgi/~ijackson/cam-grin';
 
 $ENV{'PATH'}= '/usr/local/bin:/bin:/usr/bin';
index 720a6c35629e57da82e3a462c5ec70722701ccf9..8bbd8fdbb90ce4ec4712a17aa289aff8273d4909 100644 (file)
@@ -1,6 +1,6 @@
 #
 
-@db_fields= qw(generation network prefix name contact email hiddenemail created changed);
+@db_fields= qw(network prefix name contact email hiddenemail created changed);
 
 sub read_database () {
 print DEBUG "reading\n";
index 1ebb2108140fe96577ca7d3f227070418709e92c..f153d0d0b1877592ee49f4ffac22093ebf084982 100644 (file)
@@ -42,7 +42,9 @@ sub make_password ($) {
 sub send_password ($) {
     $password= make_password($id);
     process_file('notice.txt');
-    print DEBUG "---\n$out---\n";
+    open SM, "| /usr/sbin/sendmail -odb -oi -oee -f $nullemail -t" or die $!;
+    print SM $out or die $!;
+    close SM; $? and die $?;
 }
 
 1;
index d9eb460128204e33e47dbbb87080bdb4135562fb..664ae834d3a8befb1efab42c87987212aed87217 100644 (file)
@@ -26,6 +26,10 @@ registered @@@name@@@
 updated @@@name@@@
 @@@endif:@@@
 
+@@@if:deleted@@@
+deleted @@@name@@@
+@@@endif:@@@
+
 @@@if:listingall@@@
 entire database
 @@@endif:@@@
@@ -85,6 +89,10 @@ Database entry updated: @@@name@@@
 Password sent
 @@@endif:@@@
 
+@@@if:deleted@@@
+Database entry deleted
+@@@endif:@@@
+
 @@@if:listingall@@@
 Entire database listing
 @@@endif:@@@
@@ -169,12 +177,6 @@ If you believe that this has happened to you in error, contact the
 registry administrator, @@@adminemail@@@, quoting identifier @@@id@@@.
 @@@endif:@@@
 
-@@@if:error_generation@@@
-Another modification has been made to the record.  Please use the
-`view' option to see the new values, before making any further
-changes.
-@@@endif:@@@
-
 @@@if:error_noemail@@@
 You must provide an email address.
 @@@endif:@@@
@@ -291,6 +293,12 @@ hide it; apart from that we will only use it to contact you about your
 database entry.
 @@@endif:@@@
 
+@@@if:deleted@@@
+<h2>Deleted entry</h2>
+The following entry has been deleted.  If this was a mistake, you may
+re-register it now.
+@@@endif:@@@
+
 @@@if:details|fulldetails@@@
 <h2>Entry details</h2>
 @@@endif:@@@
@@ -310,7 +318,6 @@ time unless you confirm it.  You have beeen sent an email with your
 password, requesting confirmation.  When you have received the email
 you may use `confirm/update', below, to confirm your database entry.
 If you do not confirm it it will expire in a few days.
-
 @@@endif:@@@
 
 @@@if:justupdated@@@
@@ -318,8 +325,7 @@ If you do not confirm it it will expire in a few days.
 The database entry below has been updated/confirmed/renewed.
 @@@endif:@@@
 
-
-@@@if:registernew|details|fulldetails|justcreated|justupdated|picked|passwordsent@@@
+@@@if:registernew|details|fulldetails|justcreated|justupdated|picked|passwordsent|deleted@@@
 
 <p>
 <form method="POST" action="@@@cgi@@@">
@@ -354,6 +360,10 @@ Hide email address from public database.
 <input type=submit name="register" value="Register.">
 @@@endif:@@@
 
+@@@if:deleted@@@
+<input type=submit name="register" value="Re-register.">
+@@@endif:@@@
+
 @@@if:details|fulldetails|justcreated|justupdated|passwordsent@@@
 <p>
 
@@ -364,7 +374,6 @@ Last update/confirm: @@@datechanged@@@<br>
 @@@ifnot:changed@@@
 Not yet confirmed.
 @@@endif:@@@
-<input type=hidden name="generation" value="@@@generation@@@">
 @@@endif:@@@
 
 @@@if:details@@@
@@ -395,6 +404,11 @@ You can also view the full details, including the hidden email address.
 <p>
 @@@endif:@@@
 
+@@@if:details|justcreated|passwordsent@@@
+Password: <input type=text name="pw" size="30">
+<br>
+@@@endif:@@@
+
 @@@ifnot:displayemail@@@
 <input type=submit name="view" value="View full details.">
 @@@endif:@@@
@@ -402,14 +416,10 @@ You can also view the full details, including the hidden email address.
 @@@if:details|fulldetails|justcreated|justupdated|passwordsent@@@
 <input type=submit name="update" value="Update/confirm/renew.">
 <input type=submit name="delete" value="Delete.">
-<br>
-@@@endif:@@@
-
-@@@if:details|justcreated|passwordsent@@@
-Password: <input type=text name="pw" size="30">
 @@@endif:@@@
 
 @@@if:fulldetails|justupdated@@@
+<br>
 <input type=hidden name="pw" value="@@@password@@@">
 Password: supplied.
 @@@endif:@@@