Cees:
Thanks for your reply. As requested:
my $authdb = db600testauth::connect_admin();
DistroPrsRls_www->authen->config(
DRIVER => [ 'DBI',
DBH => $authdb,
TABLE => 'userdb',
CONSTRAINTS => {
'userdb.username' => '__CREDENTIAL_1__',
'userdb.password' => '__CREDENTIAL_2__'
},
],
STORE => 'Session',
POST_LOGIN_RUNMODE => 'login_welcome',
# POST_LOGIN_CALLBACK => \&update_login_date,
CREDENTIALS => [ 'authen_username','authen_password' ],
LOGIN_SESSION_TIMEOUT => { IDLE_FOR => '15m', EVERY => '1h' },
);
DistroPrsRls_www->authz->config(
DRIVER => [ 'DBI',
DBH => $authdb,
TABLES => ['userdb', 'groupmembers', 'groupdb'],
JOIN_ON => 'userdb.uid = groupmembers.uid AND groupdb.gid = grou
+pmembers.gid',
USERNAME => 'userdb.username' ,
CONSTRAINTS => { 'groupdb.groupname' => '__PARAM_1__', }
],
);
DistroPrsRls_www->authz('dpradmin')->config(
DRIVER => [ 'DBI',
DBH => $authdb,
TABLES => ['userdb', 'groupmembers', 'groupdb'],
JOIN_ON => 'userdb.uid = groupmembers.uid AND groupdb.gid = grou
+pmembers.gid',
USERNAME => 'userdb.username' ,
CONSTRAINTS => { 'groupdb.groupname' => '__PARAM_1__', }
],
);
DistroPrsRls_www->authen->protected_runmodes(qr/^(login_|admin_|dpr_)/
+);
Then in each runmode, I have a line of code which looks like this:
return $self->authz->forbidden unless $self->authz->authorize('dpradmi
+n');
Hope that is helpful to a complete response. Thanks again.
-- Hugh |