Changeset 472
- Timestamp:
- 03/12/13 16:37:46 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r471 r472 2849 2849 return \@userlist; 2850 2850 } # end getUserDropdown() 2851 2852 2853 ## DNSDB::checkUser()2854 # Check user/pass combo on login2855 sub checkUser {2856 my $dbh = shift;2857 my $user = shift;2858 my $inpass = shift;2859 2860 my $sth = $dbh->prepare("SELECT user_id,group_id,password,firstname,lastname FROM users WHERE username=?");2861 $sth->execute($user);2862 my ($uid,$gid,$pass,$fname,$lname) = $sth->fetchrow_array;2863 my $loginfailed = 1 if !defined($uid);2864 2865 if ($pass =~ m|^\$1\$([A-Za-z0-9/.]+)\$|) {2866 $loginfailed = 1 if $pass ne unix_md5_crypt($inpass,$1);2867 } else {2868 $loginfailed = 1 if $pass ne $inpass;2869 }2870 2871 # nnnngggg2872 return ($uid, $gid);2873 } # end checkUser2874 2851 2875 2852
Note:
See TracChangeset
for help on using the changeset viewer.