Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r25 r29 130 130 131 131 # load system-wide site defaults and things from config file 132 open SYSDEFAULTS, "</etc/dnsdb.conf";132 if (open SYSDEFAULTS, "</etc/dnsdb.conf") { 133 133 ##fixme - error check! 134 while (<SYSDEFAULTS>) {135 next if /^\s*#/;136 $def{contact} = $1 if /contact ?= ?([a-z0-9_.-]+)/i;137 $def{prins} = $1 if /prins ?= ?([a-z0-9_.-]+)/i;138 $def{soattl} = $1 if /soattl ?= ?([a-z0-9_.-]+)/i;139 $def{refresh} = $1 if /refresh ?= ?([a-z0-9_.-]+)/i;140 $def{retry} = $1 if /retry ?= ?([a-z0-9_.-]+)/i;141 $def{expire} = $1 if /expire ?= ?([a-z0-9_.-]+)/i;142 $def{minttl} = $1 if /minttl ?= ?([a-z0-9_.-]+)/i;143 $def{ttl} = $1 if /ttl ?= ?([a-z0-9_.-]+)/i;134 while (<SYSDEFAULTS>) { 135 next if /^\s*#/; 136 $def{contact} = $1 if /contact ?= ?([a-z0-9_.-]+)/i; 137 $def{prins} = $1 if /prins ?= ?([a-z0-9_.-]+)/i; 138 $def{soattl} = $1 if /soattl ?= ?([a-z0-9_.-]+)/i; 139 $def{refresh} = $1 if /refresh ?= ?([a-z0-9_.-]+)/i; 140 $def{retry} = $1 if /retry ?= ?([a-z0-9_.-]+)/i; 141 $def{expire} = $1 if /expire ?= ?([a-z0-9_.-]+)/i; 142 $def{minttl} = $1 if /minttl ?= ?([a-z0-9_.-]+)/i; 143 $def{ttl} = $1 if /ttl ?= ?([a-z0-9_.-]+)/i; 144 144 ##fixme? load DB user/pass from config file? 145 } 145 146 } 146 147 # load from database -
trunk/dns.cgi
r26 r29 16 16 use HTML::Template; 17 17 use CGI::Session; 18 use Crypt::PasswdMD5; 18 19 use DBI; 19 20 … … 74 75 my $sortorder = "asc"; 75 76 76 my ($dbh,$msg) = connectDB("dnsdb","dnsdb","secret" );77 my ($dbh,$msg) = connectDB("dnsdb","dnsdb","secret","dbhost"); 77 78 #my $dbh = DBI->connect("DBI:mysql:database=vegadns","vegadns","secret", 78 79 # { AutoCommit => 0 }) or die $DBI::errstr; … … 90 91 my ($uid,$gid,$pass,$fname,$lname) = $sth->fetchrow_array; 91 92 $webvar{loginfailed} = 1 if !defined($uid); 92 $webvar{loginfailed} = 1 if $pass ne $webvar{password}; 93 94 if ($pass =~ m|^\$1\$([A-Za-z0-9/.]+)\$|) { 95 $webvar{loginfailed} = 1 if $pass ne unix_md5_crypt($webvar{password},$1); 96 } else { 97 $webvar{loginfailed} = 1 if $pass ne $webvar{password}; 98 } 93 99 94 100 # set session bits
Note:
See TracChangeset
for help on using the changeset viewer.