Changeset 66
- Timestamp:
- 11/12/04 15:17:59 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r16 r66 1 1 # ipdb/cgi-bin/IPDB.pm 2 # Contains DB-related functions for IPDB2 # Contains functions for IPDB - database access, subnet mangling, block allocation, etc 3 3 ### 4 4 # SVN revision info … … 7 7 # Last update by $Author$ 8 8 ### 9 10 # Split from CommonWeb.pm 08/13/2004 kdeugau@vianet 9 # Copyright (C) 2004 - Kris Deugau 11 10 12 11 package IPDB; … … 15 14 use warnings; 16 15 use Exporter; 16 use Net::SMTP; 17 17 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); 18 18 19 19 $VERSION = 1.0; 20 20 @ISA = qw(Exporter); 21 @EXPORT_OK = qw(&connectDB &checkDBSanity );21 @EXPORT_OK = qw(&connectDB &checkDBSanity &allocateBlock); 22 22 23 23 @EXPORT = (); # Export nothing by default. 24 %EXPORT_TAGS = ( ALL => [qw( &connectDB &checkDBSanity )]24 %EXPORT_TAGS = ( ALL => [qw( &connectDB &checkDBSanity &allocateBlock )] 25 25 ); 26 26 27 27 28 # Creates connection to IPDB. … … 66 67 } # end checkDBSanity 67 68 69 70 # allocateBlock() 71 # Does all of the magic of actually allocating a netblock 72 sub allocateBlock($) { 73 } 74 75 76 # mailNotify() 77 # Sends notification mail to recipients regarding an IPDB operation 78 sub mailNotify ($$$) { 79 my ($recip,$subj,$message) = @_; 80 my $mailer = new Net::SMTP "smtp.example.com"; 81 82 $mailer->mail('ipdb@example.com'); 83 $mailer->to($recip); 84 $mailer->data("X-Mailer: IPDB Notify v$IPDB::Version\n", 85 "Date: ".strftime("%a, %d %b %Y %H:%M:%S %z\n", localtime)."\n", 86 "Organization: Example Corp.", 87 "From: \"IP Database\" <ipdb\@example.com>\n", 88 "Subject: $subj\n", 89 "\n", 90 "$message\n"); 91 $mailer->quit; 92 } 93 68 94 # Indicates module loaded OK. Required by Perl. 69 95 1;
Note:
See TracChangeset
for help on using the changeset viewer.