72OTJYGTKL5ISUSCBOYLZLD3BOSKDO5EE2G5BTSZSNV5ZKMYQGIQC
3QWDDLBR5DGFK5Y3TDMK55R2SCHRHFVO2KW2BMZGIYRTIQEZC45AC
XUKHBDR5HJKYJ7GEWTL4YLQEW2S4ERU2WVQZU3INIJB34B4CTUKAC
XJRJ4J7M6BC433TBLWHHKX7UYYCFX6M7ZQLUEYYTREPCSM6M3RDQC
WDKFN4B2M7BUF4S7X6YA5AKHOJKHLG65LWNQVOSIBTKFEZELBMKAC
LZVO64YG43JD7YMZSCTZNOBS5ROZA4FMPKJW2YOMHX2V5PTGBVWQC
36ZTCZ4FDV6ILURQEIGFHCP57ALZH6OWYNN3MBXG2QXZSBULBPMAC
NILMMFMYWOTQUABCE56HAHEGMPCOU3Q6H76IFBDUKBICDT7WB5RQC
U2ZK6LZ7MTUISO6AXHAWGSQLWRJYAWMYZPN4MORRGUT6POM6X7HQC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
HOI5XQHSZIQICDJXTCOOY6LOA6AKE4RYYDIXL6E76JJF26IORQAQC
accessDenied($c, "Bad username or password.")
if !$c->authenticate({username => $username, password => $password});
if ($c->authenticate({username => $username, password => $password}, 'ldap')) {
doLDAPLogin($self, $c, $username);
} elsif ($c->authenticate({username => $username, password => $password})) {}
else {
accessDenied($c, "Bad username or password.")
}
if (!$user) {
$c->model('DB::Users')->create(
{ username => $username
, fullname => decode('UTF-8', $LDAPUser->cn)
, password => "!"
, emailaddress => $LDAPUser->mail
, type => "LDAP"
});
$user = $c->find_user({ username => $username }) or die;
} else {
$user->update(
{ fullname => decode('UTF-8', $LDAPUser->cn)
, password => "!"
, emailaddress => $LDAPUser->mail
, type => "LDAP"
});
}
$user->userroles->delete;
if (@LDAPRoles) {
$user->userroles->create({ role => (substr $_, 6) }) for @LDAPRoles;
}
$c->set_authenticated($user);
}