/[gedafe]/trunk/lib/perl/Gedafe/Util.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/perl/Gedafe/Util.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 13 by dpavlin, Mon Feb 14 18:52:26 2005 UTC revision 14 by dpavlin, Sun May 8 15:01:05 2005 UTC
# Line 148  sub MyURL($) Line 148  sub MyURL($)
148  sub GetUnique($)  sub GetUnique($)
149  {  {
150          my $s = shift;          my $s = shift;
151          my $socket = ConnectToTicketsDaemon($s);          if ($s->{'ticket_value'}) {
152          print $socket "SITE $s->{path}/$s->{script}\n";                  my $socket = ConnectToTicketsDaemon($s);
153          <$socket>;                  print $socket "SITE $s->{path}/$s->{script}\n";
154          print $socket "GETUNIQUE\n";                  <$socket>;
155          $_ = <$socket>;                  print $socket "GETUNIQUE\n";
156          close($socket);                  $_ = <$socket>;
157          if(! /^([\w-]+)$/) {                  close($socket);
158                  Die("Couldn't understand ticket daemon reply: $_");                  if(! /^([\w-]+)$/) {
159                            Die("Couldn't understand ticket daemon reply: $_");
160                    }
161                    return $1;
162            } else {
163                    return $s->{'user'}.'-'.rand_ascii_32();
164          }          }
         return $1;  
165  }  }
166    
167  sub DropUnique($$)  sub DropUnique($$)
168  {  {
169          my $s = shift;          my $s = shift;
170          my $unique_id = shift;          my $unique_id = shift;
171            return 1 unless ($s->{'ticket_value'});
172          if(defined $unique_id) {          if(defined $unique_id) {
173                  my $socket = ConnectToTicketsDaemon($s);                  my $socket = ConnectToTicketsDaemon($s);
174                  print $socket "SITE $s->{path}/$s->{script}\n";                  print $socket "SITE $s->{path}/$s->{script}\n";

Legend:
Removed from v.13  
changed lines
  Added in v.14

  ViewVC Help
Powered by ViewVC 1.1.26