- Timestamp:
- 04/14/11 15:28:40 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r91 r92 17 17 use CGI::Session; 18 18 use Crypt::PasswdMD5; 19 use Digest::MD5 qw(md5_hex); 19 20 use Net::DNS; 20 21 use DBI; … … 116 117 $webvar{loginfailed} = 1 if !defined($uid); 117 118 118 ##fixme: allow imported VegaDNS passwords. hash is hex-coded MD5.119 #perl -e 'use Digest::MD5 qw(md5 md5_hex md5_base64); print md5_hex("test")."\n";'120 #098f6bcd4621d373cade4e832627b4f6121 122 119 if ($pass =~ m|^\$1\$([A-Za-z0-9/.]+)\$|) { 120 # native passwords (crypt-md5) 123 121 $webvar{loginfailed} = 1 if $pass ne unix_md5_crypt($webvar{password},$1); 122 } elsif ($pass =~ /^[0-9a-f]{32}$/) { 123 # VegaDNS import (hex-coded MD5) 124 $webvar{loginfailed} = 1 if $pass ne md5_hex($webvar{password}); 124 125 } else { 126 # plaintext (convenient now and then) 125 127 $webvar{loginfailed} = 1 if $pass ne $webvar{password}; 126 128 } … … 490 492 foreach (@permtypes) { 491 493 $newperms{$_} = 0; 492 $newperms{$_} = 1 if $webvar{$_} eq 'on';494 $newperms{$_} = (defined($webvar{$_}) && $webvar{$_} eq 'on' ? 1 : 0); 493 495 } 494 496 # not gonna provide the 4th param: template-or-clone flag, just yet … … 529 531 if ($code ne 'OK') { 530 532 # need to find failure mode 531 $page->param(del_failed => 1); 532 $page->param(errmsg => $msg); 533 $page->param(curpage => $webvar{page}); 534 listgroups(); 533 changepage(page => "grpman", del_failed => 1, errmsg => $msg); 535 534 ##fixme: log 536 535 } else { … … 1115 1114 my $newurl = "http://$ENV{HTTP_HOST}$ENV{SCRIPT_NAME}?sid=$sid"; 1116 1115 foreach (keys %params) { 1117 $newurl .= "&$_= $params{$_}";1116 $newurl .= "&$_=".$q->url_encode($params{$_}); 1118 1117 } 1119 1118 … … 1468 1467 } # end listgroups() 1469 1468 1469 1470 1470 sub fill_grouplist { 1471 1471 my $template_var = shift; … … 1496 1496 } # end fill_grouplist() 1497 1497 1498 1498 1499 sub list_users { 1499 1500 … … 1570 1571 } # end list_users() 1571 1572 1573 1572 1574 # Generate all of the glop necessary to add or not the appropriate marker/flag for 1573 1575 # the sort order and column in domain, user, group, and record lists … … 1608 1610 } # end fill_colheads() 1609 1611 1612 1610 1613 sub logaction { 1611 1614 my $domid = shift; … … 1623 1626 $sth->execute($domid,$user_id,$groupid,$username,$fullname,$entry); 1624 1627 } # end logaction() 1628 1625 1629 1626 1630 ##fixme: generalize to return appropriate id on all cases (ie, use $partype) … … 1660 1664 } # end parentID() 1661 1665 1666 1662 1667 # we have to do this in a variety of places; let's make it consistent 1663 1668 sub fill_permissions {
Note:
See TracChangeset
for help on using the changeset viewer.