use CGI::Application::Plugin::Authentication; use CGI::Application::Plugin::Authentication::Driver::Filter::md5; DistroPrsRls->authen->config( DRIVER => [ 'DBI', DBH => $authdb, TABLE => 'userdb', CONSTRAINTS => { 'userdb.username' => '__CREDENTIAL_1__', 'MD5:userdb.password' => '__CREDENTIAL_2__' # 'userdb.password' => '__CREDENTIAL_2__' }, ], STORE => 'Session', POST_LOGIN_RUNMODE => 'login_welcome', POST_LOGIN_CALLBACK => \&update_login_date, CREDENTIALS => [ 'authen_username', 'authen_domain', 'authen_password' ], LOGIN_SESSION_TIMEOUT => { IDLE_FOR => '5m', EVERY => '1h' }, ); #### use DBIx::UserDB; use DBIx::SearchProfiles; use Digest::MD5 qw(md5_hex); sub CreateUser { my($userdb,$username,$password)=@_; print STDERR "Running Create User Subroutine.\n"; # store md5 hash of password my $digest = md5_hex($password); # my $string = MD5->hexhash($password); my $user = { username => $username, password => $digest }; $user = $userdb->user_create( $user ); return; }