Changeset 432 for trunk/cgi-bin
- Timestamp:
- 07/16/10 17:31:13 (14 years ago)
- Location:
- trunk/cgi-bin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r429 r432 130 130 # Set up for a PostgreSQL db; could be any transactional DBMS with the 131 131 # right changes. 132 # This definition should be sub connectDB($$$) to be technically correct,133 # but this breaks. GRR.134 132 sub connectDB { 135 my ($dbname,$user,$pass) = @_; 133 my $dbname = shift; 134 my $user = shift; 135 my $pass = shift; 136 my $dbhost = shift; 137 136 138 my $dbh; 137 my $DSN = "DBI:Pg:host=ipdb-db;dbname=$dbname"; 138 # my $user = 'ipdb'; 139 # my $pw = 'ipdbpwd'; 139 my $DSN = "DBI:Pg:".($dbhost ? "host=$dbhost;" : '')."dbname=$dbname"; 140 140 141 141 # Note that we want to autocommit by default, and we will turn it off locally as necessary. -
trunk/cgi-bin/MyIPDB.pm
r420 r432 15 15 use IPDB 2.0 qw(:ALL); 16 16 17 ## connectDB_My() 18 # Wrapper for IPDB::connectDB 19 # Takes no arguments, returns whatever IPDB::connectDB returns. 20 sub connectDB_My { 21 return connectDB("ipdb", "ipdb", "ipdbpwd"); 22 } # end connectDB_My() 17 18 # DSN, user, and password for database. These **MUST** be set. 19 my $dbname = 'ipdb'; 20 my $dbuser = 'ipdb'; 21 my $dbpass = 'ipdbpwd'; 22 # DB host is optional. 23 my $dbhost = 'ipdb-db'; 23 24 24 25 # Set some globals declared in IPDB.pm. Most of these only affect mailNotify(). … … 44 45 #$IPDB::syslog_facility = 'daemon'; 45 46 47 48 ## connectDB_My() 49 # Wrapper for IPDB::connectDB 50 # Takes no arguments, returns whatever IPDB::connectDB returns. 51 sub connectDB_My { 52 return connectDB($dbname, $dbuser, $dbpass, $dbhost); 53 } # end connectDB_My() 54 46 55 # Keep Perl from complaining. 47 56 1;
Note:
See TracChangeset
for help on using the changeset viewer.