gdipupdt.cgi 706 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/perl
  2. #####################################################
  3. # gdipupdt.cgi
  4. #
  5. # This is the GnuDIP HTTP update server for FastCGI.
  6. #
  7. # See COPYING for licensing information.
  8. #
  9. #####################################################
  10. # Perl modules
  11. use strict;
  12. # locate ourselves
  13. use vars qw($gnudipdir);
  14. use FindBin;
  15. BEGIN {
  16. $gnudipdir = '';
  17. if ($FindBin::Bin =~ /(.*)\/.+?/) {
  18. $gnudipdir = $1;
  19. }
  20. }
  21. use lib "$gnudipdir/lib";
  22. # global variables
  23. use vars qw($conf);
  24. # GnuDIP modules
  25. use gdipfupdt;
  26. use gdipupdt;
  27. # function to run before accept
  28. my $init = sub {
  29. # initiate DB connection and get configuration data from DB
  30. getprefs();
  31. };
  32. # run the CGI
  33. gdipfupdt($init, \&gdipupdt);