/[synchroedit]/espi.cgi
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 /espi.cgi

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

revision 2 by dpavlin, Sun Apr 15 23:10:09 2007 UTC revision 3 by dpavlin, Sun Apr 15 23:39:32 2007 UTC
# Line 6  use CGI; Line 6  use CGI;
6  use CGI::Carp 'fatalsToBrowser';  use CGI::Carp 'fatalsToBrowser';
7    
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9    use YAML::Syck;
10    
11  $| = 1;  $| = 1;
12    
13  my $admins = {  my $config_file = $0;
14          'dpavlin' => 'my admin secret',  $config_file =~ s/\.cgi$/.yaml/;
15  };  my $config = LoadFile( $config_file ) or die "can't open $config_file: $!";
16    
17  my $espi_hook = {  my $espi_hook = {
18  #       'authenticate-user' => 'ACCESS GRANTED ADMIN',  #       'authenticate-user' => 'ACCESS GRANTED ADMIN',
# Line 20  my $espi_hook = { Line 21  my $espi_hook = {
21                  my $param = shift;                  my $param = shift;
22                  warn "param = ",dump( $param );                  warn "param = ",dump( $param );
23                  my $ret = 'ACCESS GRANTED';                  my $ret = 'ACCESS GRANTED';
24                  $ret .= ' ADMIN' if defined( $admins->{ $param->{uid} } ) && $admins->{ $param->{uid} } eq $param->{pwd};                  $ret .= ' ADMIN' if defined( $config->{admins}->{ $param->{uid} } ) && $config->{admins}->{ $param->{uid} } eq $param->{pwd};
25                  return $ret;                  return $ret;
26          }          }
27  };  };

Legend:
Removed from v.2  
changed lines
  Added in v.3

  ViewVC Help
Powered by ViewVC 1.1.26