s/datas/data

datas => des données
data => les données
This commit is contained in:
Xavier Guimard 2018-07-05 22:56:16 +02:00
parent 9402f9fff4
commit b2620c2679
104 changed files with 598 additions and 598 deletions

View File

@ -144,7 +144,7 @@ sub base {
## @method hashRef get(string id)
# @param $id Apache::Session session ID.
# @return User datas
# @return User data
sub get {
my $self = shift;
my $id = shift;
@ -165,7 +165,7 @@ sub get {
## @method hashRef newSession()
# Build a new Apache::Session session.
# @return User datas (just the session ID)
# @return User data (just the session ID)
sub newSession {
my $self = shift;
$self->generate unless ( $self->{data}->{_session_id} );
@ -200,7 +200,7 @@ sub newSession {
}
## @method boolean save()
# Save user datas if modified.
# Save user data if modified.
sub save {
my $self = shift;
return unless ( $self->{modified} );

View File

@ -147,7 +147,7 @@ sub _soapCall {
## @method hashRef get(string id)
# @param $id Apache::Session session ID.
# @return User datas
# @return User data
sub get {
my $self = shift;
my $id = shift;
@ -169,7 +169,7 @@ sub get {
## @method hashRef newSession()
# Build a new Apache::Session session.
# @return User datas (just the session ID)
# @return User data (just the session ID)
sub newSession {
my $self = shift;
$self->{data} = $self->_soapCall("newSession");
@ -187,7 +187,7 @@ sub newSession {
}
## @method boolean save()
# Save user datas if modified.
# Save user data if modified.
sub save {
my $self = shift;
return unless ( $self->{modified} );

View File

@ -100,18 +100,18 @@ sub getConfByNum {
# * openIdIDPList() (old OpenID)
# * applicationList()
# - root:
# root query (/confs/latest for example) is redirected to metadatas()
# root query (/confs/latest for example) is redirected to metadata()
# - other requests:
# they are managed by getKey()
# - newRSAKey() returns a new RSA key pair if /confs/newRSAKey is called in a
# POST request
# - prx() load a request and return the content (for SAML/OIDC metadatas)
# - prx() load a request and return the content (for SAML/OIDC metadata)
# 31 - Complex subnodes
# ----------------
## @method PSGI-JSON-response complexNodesRoot($req, $query, $tpl)
# Respond to root requests for virtual hosts and SAMLmetadatas
# Respond to root requests for virtual hosts and SAMLmetadata
#
#@param $req Lemonldap::NG::Common::PSGI::Request
#@param $query Configuration root key
@ -686,15 +686,15 @@ sub combModules {
# 33 - Root queries
# -----------
## @method PSGI-JSON-response metadatas($req)
# Respond to `/conf/:cfgNum` requests by sending configuration metadatas
## @method PSGI-JSON-response metadata($req)
# Respond to `/conf/:cfgNum` requests by sending configuration metadata
#
# NB: if `full=1` is set in the query, configuration is returned directly in
# JSON
#
#@param $req Lemonldap::NG::Common::PSGI::Request
#@return PSGI JSON response
sub metadatas {
sub metadata {
my ( $self, $req ) = @_;
if ( $req->params('full') and $req->params('full') !~ NO ) {
my $c = $self->getConfKey( $req, 'cfgNum' );
@ -738,13 +738,13 @@ sub metadatas {
if ( $self->can('userId') ) {
$self->userLogger->info( 'User '
. $self->userId($req)
. ' ask for configuration metadatas ('
. ' ask for configuration metadata ('
. $res->{cfgNum}
. ')' );
}
else {
$self->logger->info(
"REST request to get configuration metadatas ($res->{cfgNum})"
"REST request to get configuration metadata ($res->{cfgNum})"
);
}
return $self->sendJSONresponse( $req, $res );
@ -764,7 +764,7 @@ sub metadatas {
sub getKey {
my ( $self, $req, $key, $subkey ) = @_;
unless ($key) {
return $self->metadatas($req);
return $self->metadata($req);
}
$self->userLogger->info(
'User ' . $self->userId($req) . " asks for key $key" );

View File

@ -50,8 +50,8 @@ sub _getCipher {
## @method string encrypt(string data)
# Encrypt $data and return it in Base64 format
# @param data datas to encrypt
# @return encrypted datas in Base64 format
# @param data data to encrypt
# @return encrypted data in Base64 format
sub encrypt {
my ( $self, $data ) = @_;
@ -73,8 +73,8 @@ sub encrypt {
## @method string decrypt(string data)
# Decrypt $data and return it
# @param data datas to decrypt in Base64 format
# @return decrypted datas
# @param data data to decrypt in Base64 format
# @return decrypted data
sub decrypt {
my ( $self, $data ) = @_;
$data =~ s/%2B/\+/ig;
@ -100,9 +100,9 @@ sub decrypt {
# Encrypt $data and return it in hexadecimal format
# Data must be hexadecimal and its length must be a multiple of 32
# the encrypted data have same length as the original data
# @param data datas to encrypt
# @param data data to encrypt
# @param key optional secondary key
# @return encrypted datas in hexadecimal data
# @return encrypted data in hexadecimal data
sub encryptHex {
my ( $self, $data, $key ) = @_;
return _cryptHex( $self, $data, $key, "encrypt" );
@ -112,9 +112,9 @@ sub encryptHex {
# Decrypt $data and return it in hexadecimal format
# Data must be hexadecimal and its length must be a multiple of 32
# the decrypted data have same length as the encrypted data
# @param data datas to decrypt
# @param data data to decrypt
# @param key optional secondary key
# @return decrypted datas in hexadecimal data
# @return decrypted data in hexadecimal data
sub decryptHex {
my ( $self, $data, $key ) = @_;
return _cryptHex( $self, $data, $key, "decrypt" );
@ -122,10 +122,10 @@ sub decryptHex {
## @method private string _cryptHex (string data, string key, string sub)
# Auxiliary method to share code between encrypt and decrypt
# @param data datas to decrypt
# @param data data to decrypt
# @param key secondary key
# @param sub may be "encrypt" or "decrypt"
# @return decrypted datas in hexadecimal data
# @return decrypted data in hexadecimal data
sub _cryptHex {
my ( $self, $data, $key, $sub ) = @_;
unless ( $data =~ /^([0-9a-fA-F]{2})*$/ ) {

View File

@ -17,7 +17,7 @@ sub newNotification {
my @notifs;
$json = [$json] unless ( ref($json) eq 'ARRAY' );
foreach my $notif (@$json) {
my @datas;
my @data;
# Mandatory information
foreach (qw(date uid reference)) {
@ -26,10 +26,10 @@ sub newNotification {
$self->logger->error("Attribute $_ is missing");
return 0;
}
push @datas, $tmp;
push @data, $tmp;
}
push @datas, ( $notif->{condition} // '' );
push @notifs, [ @datas, $jsonString ];
push @data, ( $notif->{condition} // '' );
push @notifs, [ @data, $jsonString ];
}
my $count;
foreach (@notifs) {

View File

@ -14,7 +14,7 @@ has parser => (
}
);
# Check XML datas and insert new notifications.
# Check XML data and insert new notifications.
# @param $xml XML string containing notification
# @return number of notifications done
sub newNotification {
@ -29,7 +29,7 @@ sub newNotification {
foreach
my $notif ( $xml->documentElement->getElementsByTagName('notification') )
{
my @datas = ();
my @data = ();
# Mandatory information
foreach (qw(date uid reference)) {
@ -38,16 +38,16 @@ sub newNotification {
$self->logger->error("Attribute $_ is missing");
return 0;
}
push @datas, $tmp;
push @data, $tmp;
}
# Other information
foreach (qw(condition)) {
my $tmp;
if ( $tmp = $notif->getAttribute($_) ) {
push @datas, $tmp;
push @data, $tmp;
}
else { push @datas, ""; }
else { push @data, ""; }
}
my $result = XML::LibXML::Document->new( $version, $encoding );
@ -56,7 +56,7 @@ sub newNotification {
$result->setDocumentElement($root);
$result = $result->serialize;
utf8::encode($result);
push @notifs, [ @datas, $result ];
push @notifs, [ @data, $result ];
}
my $count;
foreach (@notifs) {

View File

@ -33,13 +33,13 @@ sub new {
$self->env->{PATH_INFO} ||= '/';
$self->{uri} = uri_unescape( $self->env->{REQUEST_URI} );
$self->{uri} =~ s|^//+|/|g;
$self->{datas} = {};
$self->{data} = {};
$self->{error} = 0;
$self->{respHeaders} = [];
return bless( $self, $_[0] );
}
sub datas { $_[0]->{datas} }
sub data { $_[0]->{data} }
sub uri { $_[0]->{uri} }

View File

@ -20,12 +20,12 @@ sub new {
return bless { obj => $obj, func => \@func, req => $req }, $class;
}
## @method datas AUTOLOAD()
## @method data AUTOLOAD()
# Call the wanted function with the object given to the constructor.
# AUTOLOAD() is a magic method called by Perl interpreter fon non existent
# functions. Here, we use it to call the wanted function (given by $AUTOLOAD)
# if it is authorizated
# @return datas provided by the exported function
# @return data provided by the exported function
sub AUTOLOAD {
my $self = shift;
$AUTOLOAD =~ s/.*:://;

View File

@ -162,7 +162,7 @@ sub redirectFilter {
while ( $f->read( my $buffer, 1024 ) ) {
}
$class->updateStatus( $f->r, '$class->REDIRECT',
$class->datas->{ $class->tsv->{whatToTrace} }, 'filter' );
$class->data->{ $class->tsv->{whatToTrace} }, 'filter' );
return $class->OK;
}

View File

@ -62,9 +62,9 @@ sub new {
return $self;
}
sub datas {
sub data {
my ($self) = @_;
return $self->{datas} ||= {};
return $self->{data} ||= {};
}
1;

View File

@ -169,7 +169,7 @@ sub _authAndTrace {
}
## @method hashRef user()
# @return hash of user datas
# @return hash of user data
sub user {
my ( $self, $req ) = @_;
return $req->userData

View File

@ -94,7 +94,7 @@ sub run {
unless $class->_isAlive();
# Value to store
my $value = $class->datas->{$secureTokenAttribute};
my $value = $class->data->{$secureTokenAttribute};
# Set token
my $key = $class->_setToken( $value, $secureTokenExpiration );

View File

@ -53,7 +53,7 @@ sub run {
# Build URL
my $zimbra_url =
$class->_buildZimbraPreAuthUrl( $req, $zimbraPreAuthKey, $zimbraUrl,
$class->datas->{$zimbraAccountKey},
$class->data->{$zimbraAccountKey},
$zimbraBy, $timeout );
# Header location
@ -76,7 +76,7 @@ sub _buildZimbraPreAuthUrl {
# Expiration time is calculated with _utime and timeout
my $expires =
$timeout ? ( $class->datas->{_utime} + $timeout ) * 1000 : $timeout;
$timeout ? ( $class->data->{_utime} + $timeout ) * 1000 : $timeout;
# Timestamp
my $timestamp = time() * 1000;

View File

@ -406,7 +406,7 @@ sub postUrlInit {
{
$class->tsv->{maintenance}->{$vhost} = 1;
$class->logger->error(
"$class: Unable to build post datas: "
"$class: Unable to build post data: "
. $class->tsv->{jail}->error );
}
@ -552,7 +552,7 @@ sub substitute {
$expr =~ s/\$vhost\b/\$ENV{HTTP_HOST}/sg;
$expr =~ s/\$ip\b/\$ENV{REMOTE_ADDR}/sg;
# substitute vars with session datas, excepts special vars $_ and $\d+
# substitute vars with session data, excepts special vars $_ and $\d+
$expr =~ s/\$(?!ENV)([_a-zA-Z]\w*)/\$s->{$1}/sg;
$expr =~ s/\$ENV\{/\$r->{env}->\{/g;

View File

@ -160,7 +160,7 @@ sub run {
# Store local macros
if ( keys %$session > $kc ) {
$class->logger->debug("Update local cache");
$req->datas->{session}->update( $session, { updateCache => 2 } );
$req->data->{session}->update( $session, { updateCache => 2 } );
}
# Hide Lemonldap::NG cookie
@ -435,16 +435,16 @@ sub retrieveSession {
# persistent connection).
# NB: timout is here the same value as current HTTP/1.1 Keep-Alive timeout
# (15 seconds)
if ( defined $class->datas->{_session_id}
and $id eq $class->datas->{_session_id}
and ( $now - $class->datasUpdate < 15 ) )
if ( defined $class->data->{_session_id}
and $id eq $class->data->{_session_id}
and ( $now - $class->dataUpdate < 15 ) )
{
$class->logger->debug("Get session $id from Handler internal cache");
return $class->datas;
return $class->data;
}
# 2. Get the session from cache or backend
my $session = $req->datas->{session} = (
my $session = $req->data->{session} = (
Lemonldap::NG::Common::Session->new(
{
storageModule => $class->tsv->{sessionStorageModule},
@ -459,7 +459,7 @@ sub retrieveSession {
unless ( $session->error ) {
$class->datas( $session->data );
$class->data( $session->data );
$class->logger->debug("Get session $id");
@ -470,12 +470,12 @@ sub retrieveSession {
$class->tsv->{timeoutActivityInterval} )
)
{
$req->datas->{session}->update( { '_lastSeen' => $now } );
$class->datas( $session->data );
$req->data->{session}->update( { '_lastSeen' => $now } );
$class->data( $session->data );
if ( $session->error ) {
$class->logger->error("Cannot update session $id");
$class->logger->error( $req->datas->{session}->error );
$class->logger->error( $req->data->{session}->error );
}
else {
$class->logger->debug("Update _lastSeen with $now");
@ -497,11 +497,11 @@ sub retrieveSession {
$class->logger->info("Session $id expired");
# Clean cached data
$class->datas( {} );
$class->data( {} );
return 0;
}
$class->datasUpdate($now);
$class->dataUpdate($now);
return $session->data;
}
else {
@ -644,13 +644,13 @@ sub localUnlog {
$class->logger->debug('Local handler logout');
if ( $id //= $class->fetchId($req) ) {
# Delete thread datas
if ( $class->datas->{_session_id}
and $id eq $class->datas->{_session_id} )
# Delete thread data
if ( $class->data->{_session_id}
and $id eq $class->data->{_session_id} )
{
$class->datas( {} );
$class->data( {} );
}
delete $req->datas->{session};
delete $req->data->{session};
# Delete local cache
if ( $class->tsv->{refLocalStorage}
@ -681,7 +681,7 @@ sub postOutputFilter {
}
## @rmethod protected postInputFilter(string uri)
# Replace request body with form datas defined in configuration
# Replace request body with form data defined in configuration
# @param uri URI to catch
sub postInputFilter {
my ( $class, $req, $session, $uri ) = @_;

View File

@ -24,7 +24,7 @@ BEGIN {
};
# Current sessions properties
our $_v = { datas => {}, datasUpdate => {}, };
our $_v = { data => {}, dataUpdate => {}, };
# Thread shared accessors
foreach ( keys %$_tshv ) {

View File

@ -92,7 +92,7 @@ Level of protection. It can be one of:
=head3 user
Returns user session datas. If empty (no protection), returns:
Returns user session data. If empty (no protection), returns:
{ _whatToTrace => 'anonymous' }

View File

@ -99,7 +99,7 @@ Level of protection. It can be one of:
=head3 user
Returns user session datas. If empty (no protection), returns:
Returns user session data. If empty (no protection), returns:
{ _whatToTrace => 'anonymous' }

View File

@ -58,7 +58,7 @@ sub _run {
my $res = $self->_authAndTrace( $req, 1 );
if ( $res->[0] < 300 ) {
$self->routes( $self->authRoutes );
$req->userData( $self->api->datas );
$req->userData( $self->api->data );
}
else {
# Unset headers (handler adds a Location header)
@ -148,12 +148,12 @@ L<Lemonldap::NG::Common::PSGI::Router>) except that:
=back
Note also that user session datas are available in $req parameter (first argument
Note also that user session data are available in $req parameter (first argument
received by REST methods):
=over
=item $req->userData() returns a hash reference containing user session datas
=item $req->userData() returns a hash reference containing user session data
=back

View File

@ -105,7 +105,7 @@ sub run {
return $tmp;
";
# Second step, Manager/Constants.pm file will contain datas issued from
# Second step, Manager/Constants.pm file will contain data issued from
# this scan
my $ra = Regexp::Assemble->new;

View File

@ -1468,7 +1468,7 @@ sub attributes {
test => sub { 1 },
keyTest => qr/^(?:\*\.)?$Regexp::Common::URI::RFC2396::hostname$/,
keyMsgFail => '__badHostname__',
documentation => 'Virtualhost urls/Datas to post',
documentation => 'Virtualhost urls/Data to post',
},
vhostOptions => {

View File

@ -74,7 +74,7 @@ sub addRoutes {
##@method public PSGI-JSON-response newRSAKey($req)
# Return a hashref containing private and public keys
# The posted datas must contain a JSON object containing
# The posted data must contain a JSON object containing
# {"password":"newpassword"}
#
#@param $req Lemonldap::NG::Common::PSGI::Request object

View File

@ -121,7 +121,7 @@ sub scanTree {
$self->_scanNodes( $self->tree ) or return 0;
# Set cfgNum to ref cfgNum (will be changed when saving), set other
# metadatas and set a value to the key if empty
# metadata and set a value to the key if empty
$self->newConf->{cfgNum} = $self->req->params('cfgNum');
$self->newConf->{cfgAuthor} =
$self->req->userData->{ $Lemonldap::NG::Handler::Main::tsv->{whatToTrace}

View File

@ -226,7 +226,7 @@ sub tests {
backend => $conf->{globalStorage}
};
};
return ( -1, "Unable to insert datas ($@)" ) if ($@);
return ( -1, "Unable to insert data ($@)" ) if ($@);
return ( -1, "Unable to recover data stored" )
unless ( $h{a} == 1 );
eval { tied(%h)->delete; };

View File

@ -272,12 +272,12 @@ sub newNotification {
my $dDate = strftime( "%Y-%m-%d", localtime() );
if ( $json->{date} ) {
$self->logger->debug(
"Posted datas : uid = $json->{uid} - Ref = $json->{reference} - Date = $json->{date}"
"Posted data : uid = $json->{uid} - Ref = $json->{reference} - Date = $json->{date}"
);
}
else {
$self->logger->debug(
"Posted datas : uid = $json->{uid} - Ref = $json->{reference} - Date = ???"
"Posted data : uid = $json->{uid} - Ref = $json->{reference} - Date = ???"
);
$json->{date} = $dDate;
}

View File

@ -95,7 +95,7 @@ Main and plugin keys must be initializated during initialization. They must
be read-only during receiving requests.
The L<Lemonldap::NG::Portal::Main::Request> request has fixed keys. A plugin
that wants to store a temporary key must store it in $req->datas or use
that wants to store a temporary key must store it in C<$req-E<gt>data> or use
defined keys, but it must never create a root key. Plugin keys may have
explicit names to avoid conflicts.

View File

@ -208,7 +208,7 @@ sub _choice {
$req,
[
sub { $res }, 'controlUrl',
'buildCookie', @{ $self->p->afterDatas },
'buildCookie', @{ $self->p->afterData },
]
);
}

View File

@ -165,7 +165,7 @@ sub run {
# Get a challenge (from first key)
my $data = eval {
from_json( $req->datas->{crypter}->[0]->authenticationChallenge );
from_json( $req->data->{crypter}->[0]->authenticationChallenge );
};
if ($@) {
@ -175,7 +175,7 @@ sub run {
# Get registered keys
my @rk;
foreach ( @{ $req->datas->{crypter} } ) {
foreach ( @{ $req->data->{crypter} } ) {
my $k = push @rk,
{ keyHandle => $_->{keyHandle}, version => $data->{version} };
@ -183,7 +183,7 @@ sub run {
}
# Serialize datas
# Serialize data
$data = to_json(
{
challenge => $data->{challenge},
@ -227,7 +227,7 @@ sub run {
return $self->p->sendError( $req, "U2FAnswerError" );
}
my $crypter;
foreach ( @{ $req->datas->{crypter} } ) {
foreach ( @{ $req->data->{crypter} } ) {
$crypter = $_ if ( $_->{keyHandle} eq $data->{keyHandle} );
}
unless ($crypter) {
@ -374,7 +374,7 @@ sub loadUser {
unless (@crypters) {
return -1;
}
$req->datas->{crypter} = \@crypters;
$req->data->{crypter} = \@crypters;
return 1;
}
else {

View File

@ -61,7 +61,7 @@ sub run {
# Get a challenge (from first key)
my $data = eval {
from_json( $req->datas->{crypter}->[0]->authenticationChallenge );
from_json( $req->data->{crypter}->[0]->authenticationChallenge );
};
if ($@) {
@ -71,7 +71,7 @@ sub run {
# Get registered keys
my @rk;
foreach ( @{ $req->datas->{crypter} } ) {
foreach ( @{ $req->data->{crypter} } ) {
my $k = push @rk,
{ keyHandle => $_->{keyHandle}, version => $data->{version} };
@ -79,7 +79,7 @@ sub run {
$self->ott->updateToken( $token, __ch => $data->{challenge} );
# Serialize datas
# Serialize data
$data = to_json(
{
challenge => $data->{challenge},
@ -137,7 +137,7 @@ sub verify {
return $self->fail($req);
}
my $crypter;
foreach ( @{ $req->datas->{crypter} } ) {
foreach ( @{ $req->data->{crypter} } ) {
$crypter = $_ if ( $_->{keyHandle} eq $data->{keyHandle} );
}
unless ($crypter) {
@ -246,7 +246,7 @@ sub loadUser {
unless (@crypters) {
return -1;
}
$req->datas->{crypter} = \@crypters;
$req->data->{crypter} = \@crypters;
return 1;
}
else {

View File

@ -77,7 +77,7 @@ sub run {
# Get a challenge (from first key)
my $data = eval {
from_json(
$req->datas->{crypter}->[0]->authenticationChallenge );
$req->data->{crypter}->[0]->authenticationChallenge );
};
if ($@) {
@ -87,7 +87,7 @@ sub run {
# Get registered keys
my @rk;
foreach ( @{ $req->datas->{crypter} } ) {
foreach ( @{ $req->data->{crypter} } ) {
my $k = push @rk,
{ keyHandle => $_->{keyHandle}, version => $data->{version} };
@ -95,7 +95,7 @@ sub run {
$self->ott->updateToken( $token, __ch => $data->{challenge} );
# Serialize datas
# Serialize data
$data = to_json(
{
challenge => $data->{challenge},

View File

@ -132,7 +132,7 @@ sub authenticate {
}
# Remember password if password reset needed
$req->datas->{oldpassword} = $req->datas->{password}
$req->data->{oldpassword} = $req->data->{password}
if (
$res == PE_PP_CHANGE_AFTER_RESET
or ( $res == PE_PP_PASSWORD_EXPIRED

View File

@ -123,10 +123,10 @@ sub extractFormInfo {
my $portalPath = $self->conf->{portal};
$portalPath =~ s#^https?://[^/]+/?#/#;
$req->datas->{list} = $self->srvList;
$req->datas->{confirmRemember} = 0;
$req->data->{list} = $self->srvList;
$req->data->{confirmRemember} = 0;
$req->datas->{login} = 1;
$req->data->{login} = 1;
return PE_IDPCHOICE;
}
}
@ -140,15 +140,15 @@ sub extractFormInfo {
# Provider is choosen
$self->logger->debug("CAS server $srv choosen");
$req->datas->{_casSrvCurrent} = $srv;
$req->data->{_casSrvCurrent} = $srv;
# Unless a ticket has been found, we redirect the user
unless ($ticket) {
# Add request state parameters
if ( $req->datas->{_url} ) {
if ( $req->data->{_url} ) {
$local_url .= ( $local_url =~ /\?/ ? '&' : '?' )
. build_urlencoded( url => $req->datas->{_url} );
. build_urlencoded( url => $req->data->{_url} );
}
# Forward hidden fields
@ -189,7 +189,7 @@ sub extractFormInfo {
$local_url =~ s/ticket=[^&]+//;
$local_url =~ s/\?$//;
$local_url =~ s/\&$//;
( $req->{user}, $req->datas->{casAttrs} ) =
( $req->{user}, $req->data->{casAttrs} ) =
$self->validateST( $req, $local_url, $ticket, $srvConf, $proxied );
unless ( $req->{user} ) {
$self->userLogger->error("CAS: Unable to validate ST $ticket");
@ -203,7 +203,7 @@ sub extractFormInfo {
if (%$proxied) {
# Check we received a PGT
my $pgtId = $req->datas->{pgtId};
my $pgtId = $req->data->{pgtId};
unless ($pgtId) {
$self->logger->error(
@ -242,7 +242,7 @@ sub authenticate {
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{casAuthnLevel};
$req->{sessionInfo}->{_casSrv} = $req->datas->{_casSrvCurrent};
$req->{sessionInfo}->{_casSrv} = $req->data->{_casSrvCurrent};
PE_OK;
}
@ -257,7 +257,7 @@ sub authLogout {
$self->logger->debug("Build CAS logout URL: $logout_url");
# Register CAS logout URL in logoutServices
$req->datas->{logoutServices}->{CASserver} = $logout_url;
$req->data->{logoutServices}->{CASserver} = $logout_url;
PE_OK;
}

View File

@ -23,22 +23,22 @@ sub extractFormInfo {
}
return PE_FIRSTACCESS;
}
return $req->datas->{enabledMods0}->[0]->extractFormInfo($req);
return $req->data->{enabledMods0}->[0]->extractFormInfo($req);
}
sub authenticate {
return $_[1]->datas->{enabledMods0}->[0]->authenticate( $_[1] );
return $_[1]->data->{enabledMods0}->[0]->authenticate( $_[1] );
}
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
$self->checkChoice($req) unless ( $req->datas->{enabledMods0} );
return $req->datas->{enabledMods0}->[0]->setAuthSessionInfo($req);
$self->checkChoice($req) unless ( $req->data->{enabledMods0} );
return $req->data->{enabledMods0}->[0]->setAuthSessionInfo($req);
}
sub authLogout {
$_[0]->checkChoice( $_[1] ) or return PE_OK;
return $_[1]->datas->{enabledMods0}->[0]->authLogout( $_[1] );
return $_[1]->data->{enabledMods0}->[0]->authLogout( $_[1] );
}
1;

View File

@ -124,8 +124,8 @@ sub getDisplayType {
return $self->conf->{combinationForms}
if ( $self->conf->{combinationForms} );
my ( $nb, $stack ) = (
$req->datas->{dataKeep}->{combinationTry},
$req->datas->{combinationStack}
$req->data->{dataKeep}->{combinationTry},
$req->data->{combinationStack}
);
my ( $res, $name ) = $stack->[$nb]->[0]->( 'getDisplayType', $req );
return $res;
@ -135,7 +135,7 @@ sub authLogout {
my ( $self, $req ) = @_;
$self->getStack( $req, 'extractFormInfo' ) or return PE_ERROR;
my ( $res, $name ) =
$req->datas->{combinationStack}->[ $req->userData->{_combinationTry} ]
$req->data->{combinationStack}->[ $req->userData->{_combinationTry} ]
->[0]->( 'authLogout', $req );
$self->logger->debug(qq'User disconnected using scheme "$name"');
return $res;
@ -143,15 +143,15 @@ sub authLogout {
sub getStack {
my ( $self, $req, @steps ) = @_;
return $req->datas->{combinationStack}
if ( $req->datas->{combinationStack} );
my $stack = $req->datas->{combinationStack} =
return $req->data->{combinationStack}
if ( $req->data->{combinationStack} );
my $stack = $req->data->{combinationStack} =
$self->stackSub->( $req->env );
unless ($stack) {
$self->logger->error('No authentication scheme for this user');
}
@{ $req->datas->{combinationSteps} } = ( @steps, @{ $req->steps } );
$req->datas->{dataKeep}->{combinationTry} ||= 0;
@{ $req->data->{combinationSteps} } = ( @steps, @{ $req->steps } );
$req->data->{dataKeep}->{combinationTry} ||= 0;
return $stack;
}
@ -160,12 +160,12 @@ sub try {
my ( $self, $type, $subname, $req ) = @_;
# Get available authentication schemes for this user if not done
unless ( defined $req->datas->{combinationStack} ) {
unless ( defined $req->data->{combinationStack} ) {
$self->getStack( $req, $subname ) or return PE_ERROR;
}
my ( $nb, $stack ) = (
$req->datas->{dataKeep}->{combinationTry},
$req->datas->{combinationStack}
$req->data->{dataKeep}->{combinationTry},
$req->data->{combinationStack}
);
# If more than 1 scheme is available
@ -178,8 +178,8 @@ sub try {
# On error, restart authentication with next scheme
if ( $res > PE_OK ) {
$self->logger->info(qq'Scheme "$name" returned $res, trying next');
$req->datas->{dataKeep}->{combinationTry}++;
$req->steps( [ @{ $req->datas->{combinationSteps} } ] );
$req->data->{dataKeep}->{combinationTry}++;
$req->steps( [ @{ $req->data->{combinationSteps} } ] );
$req->continue(1);
return PE_OK;
}
@ -189,7 +189,7 @@ sub try {
}
$req->sessionInfo->{ [ '_auth', '_userDB' ]->[$type] } = $name;
$req->sessionInfo->{_combinationTry} =
$req->datas->{dataKeep}->{combinationTry};
$req->data->{dataKeep}->{combinationTry};
if ( $res > 0 ) {
$self->userLogger->warn( 'All schemes failed'
. ( $req->user ? ' for user ' . $req->user : '' ) );

View File

@ -32,7 +32,7 @@ sub init {
sub authenticate {
my ( $self, $req ) = @_;
unless ( $req->{user} eq $req->datas->{password} ) {
unless ( $req->{user} eq $req->data->{password} ) {
$self->setSecurity($req);
return PE_BADCREDENTIALS;
}

View File

@ -58,24 +58,24 @@ sub extractFormInfo {
map { /^(\w+)$/ ? ($1) : () }
values %{ $self->conf->{facebookExportedVars} };
my $datas;
my $data;
# When a field is not granted, Facebook returns only an error
# without real explanation. So here we try to reduce query until
# having a valid response
while (@fields) {
$datas = $fb->get(
$data = $fb->get(
'https://graph.facebook.com/me',
{ fields => join( ',', @fields ) }
)->as_hash;
unless ( ref $datas ) {
unless ( ref $data ) {
$self->logger->error("Unable to get any Facebook field");
return PE_ERROR;
}
if ( $datas->{error} ) {
if ( $data->{error} ) {
my $tmp = pop @fields;
$self->logger->warn(
"Unable to get some Facebook fields ($datas->{error}->{message}). Retrying without $tmp"
"Unable to get some Facebook fields ($data->{error}->{message}). Retrying without $tmp"
);
}
else {
@ -87,22 +87,22 @@ sub extractFormInfo {
return PE_ERROR;
}
# Parse received datas
foreach ( keys %$datas ) {
utf8::encode $datas->{$_};
$self->logger->debug( "Facebook data $_: " . $datas->{$_} );
# Parse received data
foreach ( keys %$data ) {
utf8::encode $data->{$_};
$self->logger->debug( "Facebook data $_: " . $data->{$_} );
}
# Field to trace user
unless ( $datas->{ $self->conf->{facebookUserField} } ) {
unless ( $data->{ $self->conf->{facebookUserField} } ) {
$self->logger->error('Unable to get Facebook id');
return PE_ERROR;
}
$req->user( $datas->{ $self->conf->{facebookUserField} } );
$req->datas->{_facebookDatas} = $datas;
$req->{sessionInfo}->{_facebookDatas} = $datas;
$req->user( $data->{ $self->conf->{facebookUserField} } );
$req->data->{_facebookData} = $data;
$req->{sessionInfo}->{_facebookData} = $data;
# Force redirection to avoid displaying Oauth datas
# Force redirection to avoid displaying Oauth data
$req->mustRedirect(1);
return PE_OK;
}

View File

@ -34,9 +34,9 @@ sub init {
sub extractFormInfo {
my ( $self, $req ) = @_;
if ( $req->datas->{_krbUser} ) {
if ( $req->data->{_krbUser} ) {
$self->logger->debug( 'Kerberos ticket already validated for '
. $req->datas->{_krbUser} );
. $req->data->{_krbUser} );
return PE_OK;
}
@ -94,7 +94,7 @@ sub extractFormInfo {
# Case 3: Display kerberos auth page (with javascript)
else {
$self->logger->debug('Send Kerberos javascript');
$req->datas->{customScript} .=
$req->data->{customScript} .=
'<script type="text/javascript" src="'
. $self->p->staticPrefix
. '/common/js/kerberos.js"></script>';
@ -145,7 +145,7 @@ sub extractFormInfo {
return PE_ERROR;
}
$self->userLogger->notice("$client_name authentified by Kerberos");
$req->datas->{_krbUser} = $client_name;
$req->data->{_krbUser} = $client_name;
if ( $self->conf->{krbRemoveDomain} ) {
$client_name =~ s/^(.*)@.*$/$1/;
}
@ -164,7 +164,7 @@ sub authLogout {
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{krbAuthnLevel};
$req->{sessionInfo}->{_krbUser} = $req->datas->{_krbUser};
$req->{sessionInfo}->{_krbUser} = $req->data->{_krbUser};
PE_OK;
}

View File

@ -26,7 +26,7 @@ sub authenticate {
}
# Set the dn unless done before
unless ( $req->datas->{dn} ) {
unless ( $req->data->{dn} ) {
if ( my $tmp = $self->getUser($req) ) {
$self->setSecurity($req);
return $tmp;
@ -34,11 +34,11 @@ sub authenticate {
}
my $res =
$self->userBind( $req, $req->datas->{dn},
password => $req->datas->{password} );
$self->userBind( $req, $req->data->{dn},
password => $req->data->{password} );
# Remember password if password reset needed
$req->datas->{oldpassword} = $self->{password}
$req->data->{oldpassword} = $self->{password}
if (
$res == PE_PP_CHANGE_AFTER_RESET
or ( $res == PE_PP_PASSWORD_EXPIRED

View File

@ -150,11 +150,11 @@ sub extractFormInfo {
}
foreach ( keys %$json_hash ) {
$req->datas->{linkedInData}->{$_} = $json_hash->{$_};
$req->data->{linkedInData}->{$_} = $json_hash->{$_};
}
$req->user(
$req->datas->{linkedInData}->{ $self->conf->{linkedInUserField} } );
$req->data->{linkedInData}->{ $self->conf->{linkedInUserField} } );
$self->logger->debug(
"Good LinkedIn authentication for " . $req->user );
@ -211,9 +211,9 @@ sub setAuthSessionInfo {
$req->{sessionInfo}->{authenticationLevel} =
$self->conf->{linkedInAuthnLevel};
foreach ( keys %{ $req->datas->{linkedInData} } ) {
foreach ( keys %{ $req->data->{linkedInData} } ) {
$req->{sessionInfo}->{ 'linkedIn_' . $_ } =
$req->datas->{linkedInData}->{$_};
$req->data->{linkedInData}->{$_};
}
PE_OK;

View File

@ -75,7 +75,7 @@ sub init {
sub extractFormInfo {
my ( $self, $req ) = @_;
$req->datas->{csr} = Net::OpenID::Consumer->new(
$req->data->{csr} = Net::OpenID::Consumer->new(
ua => $self->ua(),
cache => $self->p->HANDLER->tsv->{refLocalStorage}
|| Cache::FileCache->new,
@ -93,7 +93,7 @@ sub extractFormInfo {
# 2. Check OpenID responses
if ($openid) {
my $csr = $req->datas->{csr};
my $csr = $req->data->{csr};
# Remote error
unless ( $csr->is_server_response() ) {
@ -115,8 +115,8 @@ sub extractFormInfo {
}
# TODO: check verified identity
elsif ( $req->datas->{vident} = $csr->verified_identity ) {
$req->user( $req->datas->{vident}->url() );
elsif ( $req->data->{vident} = $csr->verified_identity ) {
$req->user( $req->data->{vident}->url() );
$self->userLogger->notice(
"OpenID good authentication for $req->{user}");
$req->{mustRedirect} = 1;
@ -138,7 +138,7 @@ sub extractFormInfo {
$self->userLogger->warn("$url is forbidden for openID exchange");
return PE_BADPARTNER;
}
my $claimed_identity = $req->datas->{csr}->claimed_identity($url);
my $claimed_identity = $req->data->{csr}->claimed_identity($url);
# Check if url is valid
unless ($claimed_identity) {
@ -151,7 +151,7 @@ sub extractFormInfo {
my $check_url = $claimed_identity->check_url(
return_to => $self->conf->{portal}
. '?openid=1&'
. ( $req->datas->{_url} ? build_urlencoded( url => $req->datas->{_url} ) : '' ),
. ( $req->data->{_url} ? build_urlencoded( url => $req->data->{_url} ) : '' ),
trust_root => $self->conf->{portal},
delayed_return => 1,
);

View File

@ -101,7 +101,7 @@ sub extractFormInfo {
}
# Get OpenID Provider
my $op = $req->datas->{_oidcOPCurrent};
my $op = $req->data->{_oidcOPCurrent};
unless ($op) {
$self->userLogger->error("OpenID Provider not found");
@ -205,8 +205,8 @@ sub extractFormInfo {
my $user_id = $id_token_payload_hash->{sub};
# Remember tokens
$req->datas->{access_token} = $access_token;
$req->datas->{id_token} = $id_token;
$req->data->{access_token} = $access_token;
$req->data->{id_token} = $id_token;
$self->logger->debug( "Found user_id: " . $user_id );
$req->user($user_id);
@ -232,10 +232,10 @@ sub extractFormInfo {
my $portalPath = $self->{portal};
$portalPath =~ s#^https?://[^/]+/?#/#;
$req->datas->{list} = $self->opList;
$req->datas->{confirmRemember} = 0;
$req->data->{list} = $self->opList;
$req->data->{confirmRemember} = 0;
$req->datas->{login} = 1;
$req->data->{login} = 1;
return PE_IDPCHOICE;
}
}
@ -243,7 +243,7 @@ sub extractFormInfo {
# Provider is choosen
$self->logger->debug("OpenID Provider $op choosen");
$req->datas->{_oidcOPCurrent} = $op;
$req->data->{_oidcOPCurrent} = $op;
# AuthN Request
$self->logger->debug("Build OpenIDConnect AuthN Request");
@ -268,20 +268,20 @@ sub authenticate {
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
my $op = $req->datas->{_oidcOPCurrent};
my $op = $req->data->{_oidcOPCurrent};
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{oidcAuthnLevel};
$req->{sessionInfo}->{_oidc_OP} = $op;
$req->{sessionInfo}->{_oidc_access_token} =
$req->datas->{access_token};
$req->data->{access_token};
# Keep ID Token in session
my $store_IDToken = $self->conf->{oidcOPMetaDataOptions}->{$op}
->{oidcOPMetaDataOptionsStoreIDToken};
if ($store_IDToken) {
$self->logger->debug("Store ID Token in session");
$req->{sessionInfo}->{_oidc_id_token} = $req->datas->{id_token};
$req->{sessionInfo}->{_oidc_id_token} = $req->data->{id_token};
}
else {
$self->logger->debug("ID Token will not be stored in session");

View File

@ -43,7 +43,7 @@ sub authenticate {
}
elsif ( $code == PAM_PROMPT_ECHO_OFF ) {
$res = $req->datas->{password};
$res = $req->data->{password};
}
push( @response, PAM_SUCCESS, $res );

View File

@ -31,7 +31,7 @@ sub authenticate {
my ( $self, $req ) = @_;
my $res = eval {
$self->restCall( $self->conf->{restAuthUrl},
{ user => $req->user, password => $req->datas->{password} } );
{ user => $req->user, password => $req->data->{password} } );
};
if ($@) {
$self->logger("Auth error: $@");
@ -44,15 +44,15 @@ sub authenticate {
$self->setSecurity($req);
return PE_BADCREDENTIALS;
}
$req->datas->{restAuthInfo} = $res->{info} || {};
$req->data->{restAuthInfo} = $res->{info} || {};
return PE_OK;
}
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
$self->SUPER::setAuthSessionInfo($req);
$req->sessionInfo->{$_} = $req->datas->{restAuthInfo}->{$_}
foreach ( keys %{ $req->datas->{restAuthInfo} } );
$req->sessionInfo->{$_} = $req->data->{restAuthInfo}->{$_}
foreach ( keys %{ $req->data->{restAuthInfo} } );
return PE_OK;
}

View File

@ -54,7 +54,7 @@ sub authenticate {
return PE_RADIUSCONNECTFAILED;
}
my $res = $self->radius->check_pwd( $req->user, $req->datas->{password} );
my $res = $self->radius->check_pwd( $req->user, $req->data->{password} );
unless ( $res == 1 ) {
$self->userLogger->warn("Unable to authenticate $req->{user} !");
$self->setSecurity($req);

View File

@ -16,8 +16,8 @@ sub extractFormInfo {
my $r = $self->checkRemoteId($req);
return $r unless ( $r == PE_OK );
$req->{user} =
$req->datas->{rSessionInfo}->{ $self->conf->{remoteUserField} || 'uid' };
$req->datas->{password} = $req->datas->{rSessionInfo}->{'_password'};
$req->data->{rSessionInfo}->{ $self->conf->{remoteUserField} || 'uid' };
$req->data->{password} = $req->data->{rSessionInfo}->{'_password'};
PE_OK;
}
@ -30,9 +30,9 @@ sub setAuthSessionInfo {
# Store password (deleted in checkRemoteId() if local policy does not accept
# stored passwords)
$req->{sessionInfo}->{'_password'} = $req->datas->{'password'};
$req->{sessionInfo}->{'_password'} = $req->data->{'password'};
$req->{sessionInfo}->{authenticationLevel} =
$req->datas->{rSessionInfo}->{authenticationLevel};
$req->data->{rSessionInfo}->{authenticationLevel};
PE_OK;
}

View File

@ -306,18 +306,18 @@ sub extractFormInfo {
$req->user($user);
# Store Lasso objects
$req->datas->{_lassoLogin} = $login;
$req->datas->{_idp} = $idp;
$req->datas->{_idpConfKey} = $idpConfKey;
$req->datas->{_nameID} = $nameid;
$req->datas->{_sessionIndex} = $session_index;
$req->data->{_lassoLogin} = $login;
$req->data->{_idp} = $idp;
$req->data->{_idpConfKey} = $idpConfKey;
$req->data->{_nameID} = $nameid;
$req->data->{_sessionIndex} = $session_index;
# Store Token
my $saml_token = $assertion->export_to_xml;
$self->logger->debug("SAML Token: $saml_token");
$req->datas->{_samlToken} = $saml_token;
$req->data->{_samlToken} = $saml_token;
# Restore initial SAML request in case of proxying
if ($assertion_responded) {
@ -351,13 +351,13 @@ sub extractFormInfo {
my $samlSessionInfo = $self->getSamlSession($saml_session);
$req->datas->{_proxiedRequest} =
$req->data->{_proxiedRequest} =
$samlSessionInfo->data->{Request};
$req->datas->{_proxiedMethod} =
$req->data->{_proxiedMethod} =
$samlSessionInfo->data->{Method};
$req->datas->{_proxiedRelayState} =
$req->data->{_proxiedRelayState} =
$samlSessionInfo->data->{RelayState};
$req->datas->{_proxiedArtifact} =
$req->data->{_proxiedArtifact} =
$samlSessionInfo->data->{Artifact};
# Save values in hidden fields in case of other user interactions
@ -845,8 +845,8 @@ sub extractFormInfo {
name => $self->idpList->{$_}->{name}
};
}
$req->datas->{list} = \@list;
$req->datas->{confirmRemember} = 1;
$req->data->{list} = \@list;
$req->data->{confirmRemember} = 1;
# Delete existing IDP resolution cookie
$req->addCookie(
@ -860,7 +860,7 @@ sub extractFormInfo {
);
#TODO: check this
$req->datas->{login} = 1;
$req->data->{login} = 1;
return PE_IDPCHOICE;
}
@ -884,7 +884,7 @@ sub extractFormInfo {
)
);
$req->datas->{login} = 1;
$req->data->{login} = 1;
return PE_CONFIRM;
}
@ -998,16 +998,16 @@ sub extractFormInfo {
}
# Keep initial SAML request data in memory in case of proxing
if ( $req->datas->{_proxiedSamlRequest} ) {
if ( $req->data->{_proxiedSamlRequest} ) {
my $infos;
$infos->{type} = 'proxy';
$infos->{_utime} = time;
$infos->{Request} = $req->datas->{_proxiedRequest};
$infos->{Method} = $req->datas->{_proxiedMethod};
$infos->{RelayState} = $req->datas->{_proxiedRelayState};
$infos->{Artifact} = $req->datas->{_proxiedArtifact};
$infos->{Request} = $req->data->{_proxiedRequest};
$infos->{Method} = $req->data->{_proxiedMethod};
$infos->{RelayState} = $req->data->{_proxiedRelayState};
$infos->{Artifact} = $req->data->{_proxiedArtifact};
$infos->{ProxyID} = $samlID;
my $samlSessionInfo = $self->getSamlSession( undef, $infos );
@ -1071,9 +1071,9 @@ sub authenticate {
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
my $login = $req->datas->{_lassoLogin};
my $idp = $req->datas->{_idp};
my $idpConfKey = $req->datas->{_idpConfKey};
my $login = $req->data->{_lassoLogin};
my $idp = $req->data->{_idp};
my $idpConfKey = $req->data->{_idpConfKey};
# Get SAML assertion
my $assertion = $self->getAssertion($login);
@ -1172,13 +1172,13 @@ sub setAuthSessionInfo {
->{samlIDPMetaDataOptionsStoreSAMLToken};
if ($store_samlToken) {
$self->logger->debug("Store SAML Token in session");
$req->{sessionInfo}->{_samlToken} = $req->datas->{_samlToken};
$req->{sessionInfo}->{_samlToken} = $req->data->{_samlToken};
}
else {
$self->logger->debug("SAML Token will not be stored in session");
}
$req->datas->{_lassoLogin} = $login;
$req->data->{_lassoLogin} = $login;
push @{ $req->steps }, sub { $self->authFinish(@_) };
PE_OK;
@ -1194,8 +1194,8 @@ sub authFinish {
my $utime = $req->{sessionInfo}->{_utime};
# Get saved Lasso objects
my $nameid = $req->datas->{_nameID};
my $session_index = $req->datas->{_sessionIndex};
my $nameid = $req->data->{_nameID};
my $session_index = $req->data->{_sessionIndex};
$self->logger->debug( "Store NameID "
. $nameid->dump

View File

@ -40,7 +40,7 @@ sub extractFormInfo {
}
elsif ( $self->conf->{sslByAjax} and not $req->param('nossl') ) {
$self->logger->debug('Send SSL javascript');
$req->datas->{customScript} .=
$req->data->{customScript} .=
'<script type="application/init">{"sslHost":"'
. $self->conf->{sslHost}
. '"}</script>';

View File

@ -84,8 +84,8 @@ sub extractFormInfo {
my %prm = ( twitterback => 1 );
# Add request state parameters
if ( $req->datas->{_url} ) {
$prm{url} = $req->datas->{_url};
if ( $req->data->{_url} ) {
$prm{url} = $req->data->{_url};
}
# Forward hidden fields
@ -187,14 +187,14 @@ sub extractFormInfo {
->from_post_body( $res_access->content );
# Get user_id and screename
$req->datas->{_twitterUserId} = $response->{extra_params}->{user_id};
$req->datas->{_twitterScreenName} =
$req->data->{_twitterUserId} = $response->{extra_params}->{user_id};
$req->data->{_twitterScreenName} =
$response->{extra_params}->{screen_name};
$self->logger->debug( "Get user id "
. $req->datas->{_twitterUserId}
. $req->data->{_twitterUserId}
. " and screen name "
. $req->datas->{_twitterScreenName} );
. $req->data->{_twitterScreenName} );
$req->user(
$response->{extra_params}->{ $self->conf->{'twitterUserField'} } );
$self->logger->debug("Good Twitter authentication for $req->{user}");
@ -205,7 +205,7 @@ sub extractFormInfo {
return PE_ERROR;
}
# Force redirection to avoid displaying OAuth datas
# Force redirection to avoid displaying OAuth data
$req->{mustRedirect} = 1;
# Clean temporaries cookies
@ -223,10 +223,10 @@ sub setAuthSessionInfo {
my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} =
$req->datas->{twitterAuthnLevel};
$req->{sessionInfo}->{_twitterUserId} = $req->datas->{_twitterUserId};
$req->data->{twitterAuthnLevel};
$req->{sessionInfo}->{_twitterUserId} = $req->data->{_twitterUserId};
$req->{sessionInfo}->{_twitterScreenName} =
$req->datas->{_twitterScreenName};
$req->data->{_twitterScreenName};
PE_OK;
}

View File

@ -65,9 +65,9 @@ sub extractFormInfo {
# 2. Verify that certificate is WebID compliant
# NB: WebID URI is used as user field
eval {
$req->datas->{_webid} =
$req->data->{_webid} =
Web::ID->new( certificate => $req->{SSL_CLIENT_CERT} );
$req->user( $req->datas->{_webid}->uri->as_string );
$req->user( $req->data->{_webid}->uri->as_string );
};
return PE_BADCERTIFICATE if ( $@ or not( $req->user ) );
@ -75,8 +75,8 @@ sub extractFormInfo {
return PE_BADPARTNER unless ( $req->user =~ $self->reWebIDWhitelist );
# 4. Verify FOAF document
return PE_BADCREDENTIALS unless ( $req->datas->{_webid}->valid() );
$req->datas->{_webIdAuthDone}++;
return PE_BADCREDENTIALS unless ( $req->data->{_webid}->valid() );
$req->data->{_webIdAuthDone}++;
# 5. OK, access granted
return PE_OK;

View File

@ -49,7 +49,7 @@ sub init {
# RUNNING METHODS
# Read username and password from POST datas
# Read username and password from POST data
sub extractFormInfo {
my ( $self, $req ) = @_;
@ -68,16 +68,16 @@ sub extractFormInfo {
elsif ( $defUser and $defPassword ) {
$res = PE_FORMEMPTY
unless ( ( $req->{user} = $req->param('user') )
&& ( $req->datas->{password} = $req->param('password') ) );
&& ( $req->data->{password} = $req->param('password') ) );
}
# 3. If user and oldpassword defined -> password form
elsif ( $defUser and $defOldPassword ) {
$res = PE_PASSWORDFORMEMPTY
unless ( ( $req->{user} = $req->param('user') )
&& ( $req->datas->{oldpassword} = $req->param('oldpassword') )
&& ( $req->datas->{newpassword} = $req->param('newpassword') )
&& ( $req->datas->{confirmpassword} =
&& ( $req->data->{oldpassword} = $req->param('oldpassword') )
&& ( $req->data->{newpassword} = $req->param('newpassword') )
&& ( $req->data->{confirmpassword} =
$req->param('confirmpassword') ) );
}
@ -110,24 +110,24 @@ sub extractFormInfo {
$self->logger->debug("Captcha code verified");
}
elsif ( $self->ott ) {
unless ( $req->datas->{tokenVerified}
unless ( $req->data->{tokenVerified}
or $self->ott->getToken($token) )
{
$self->ott->setToken($req);
$self->userLogger->warn('Token expired');
return PE_TOKENEXPIRED;
}
$req->datas->{tokenVerified} = 1;
$req->data->{tokenVerified} = 1;
}
}
# Other parameters
$req->datas->{timezone} = $req->param('timezone');
$req->data->{timezone} = $req->param('timezone');
PE_OK;
}
# Set password in session datas if wanted.
# Set password in session data if wanted.
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
@ -137,8 +137,8 @@ sub setAuthSessionInfo {
# Store submitted password if set in configuration
# WARNING: it can be a security hole
if ( $self->conf->{storePassword} ) {
$req->{sessionInfo}->{'_password'} = $req->datas->{'newpassword'}
|| $req->datas->{'password'};
$req->{sessionInfo}->{'_password'} = $req->data->{'newpassword'}
|| $req->data->{'password'};
}
# Store user timezone

View File

@ -261,7 +261,7 @@ sub run {
'casBack2Url', params => { url => $logout_url }
)
);
$req->datas->{activeTimer} = 0;
$req->data->{activeTimer} = 0;
return PE_CONFIRM;
}

View File

@ -116,9 +116,9 @@ sub logout {
# Create if not done a new Lemonldap::NG::Portal::Lib::OpenID::Server objet
sub openIDServer {
my ( $self, $req ) = @_;
return $req->datas->{_openidserver} if ( $req->datas->{_openidserver} );
return $req->data->{_openidserver} if ( $req->data->{_openidserver} );
$req->datas->{_openidserver} =
$req->data->{_openidserver} =
Lemonldap::NG::Portal::Lib::OpenID::Server->new(
server_secret => sub { return $self->secret },
args => sub { $req->param(@_) },
@ -152,7 +152,7 @@ sub openIDServer {
if ( $tmp =~ $self->spList xor $self->listIsWhite ) {
$self->userLogger->warn(
"$trust_root is forbidden for openID exchange");
$req->datas->{_openIdForbidden} = 1;
$req->data->{_openIdForbidden} = 1;
return 0;
}
elsif ( $req->{sessionInfo}->{"_openidTrust$trust_root"} ) {
@ -171,7 +171,7 @@ sub openIDServer {
}
else {
$self->logger->debug('OpenID request not trusted');
$req->datas->{_openIdTrustRequired} = 1;
$req->data->{_openIdTrustRequired} = 1;
return 0;
}
},
@ -185,7 +185,7 @@ sub openIDServer {
},
},
);
return $req->datas->{_openidserver};
return $req->data->{_openidserver};
}
# Manage Lemonldap::NG::Portal::OpenID::Server responses
@ -202,8 +202,8 @@ sub _openIDResponse {
# Setup
elsif ( $type eq 'setup' ) {
if ( $req->datas->{_openIdTrustRequired}
or $req->datas->{_openIdTrustExtMsg} )
if ( $req->data->{_openIdTrustRequired}
or $req->data->{_openIdTrustExtMsg} )
{
# TODO
@ -213,8 +213,8 @@ sub _openIDResponse {
params => { trspan => "openidExchange,$data->{trust_root}" }
)
);
$req->info( $req->datas->{_openIdTrustExtMsg} )
if ( $req->datas->{_openIdTrustExtMsg} );
$req->info( $req->data->{_openIdTrustExtMsg} )
if ( $req->data->{_openIdTrustExtMsg} );
$self->logger->debug('OpenID confirmation');
foreach ( keys %{ $req->parameters } ) {
if (/^(?:openid.*|url)$/) {
@ -224,20 +224,20 @@ sub _openIDResponse {
}
# TODO: understand why this is needed here and not in OIDC
delete $req->datas->{_url};
delete $req->data->{_url};
return PE_CONFIRM;
}
elsif ( $req->datas->{_badOpenIdentity} ) {
elsif ( $req->data->{_badOpenIdentity} ) {
$self->userLogger->warn(
"The user $req->{sessionInfo}->{_user} tries to use the id \"$data->{identity}\" on $data->{trust_root}"
);
return PE_OPENID_BADID;
}
elsif ( $req->datas->{_openIdForbidden} ) {
elsif ( $req->data->{_openIdForbidden} ) {
return PE_BADPARTNER;
}
# User has refused sharing its datas
# User has refused sharing its data
else {
$self->userLogger->notice(
$req->{sessionInfo}->{ $self->conf->{whatToTrace} }

View File

@ -502,7 +502,7 @@ sub run {
}
)
);
$req->datas->{activeTimer} = 0;
$req->data->{activeTimer} = 0;
return PE_CONFIRM;
}
}
@ -865,7 +865,7 @@ sub run {
}
$req->info( $self->loadTemplate('oidcLogout') );
$req->datas->{activeTimer} = 0;
$req->data->{activeTimer} = 0;
return PE_CONFIRM;
}
}
@ -1127,7 +1127,7 @@ sub registration {
# Get client metadata
my $client_metadata_json = $req->content;
unless ($client_metadata_json) {
return $self->p->sendError( $req, 'Missing POST datas', 400 );
return $self->p->sendError( $req, 'Missing POST data', 400 );
}
$self->logger->debug("Client metadata received: $client_metadata_json");

View File

@ -166,7 +166,7 @@ sub ssoMatch {
my ( $self, $req ) = @_;
my $url = $self->normalize_url( $req->uri, $self->conf->{issuerDBSAMLPath},
$self->ssoGetUrl );
return ( $url =~ $self->ssoUrlRe or $req->datas->{_proxiedRequest}
return ( $url =~ $self->ssoUrlRe or $req->data->{_proxiedRequest}
? 1
: 0);
}
@ -206,7 +206,7 @@ sub run {
}
# 1.1. SSO (SSO URL or Proxy Mode)
if ( $url =~ $self->ssoUrlRe or $req->datas->{_proxiedRequest} ) {
if ( $url =~ $self->ssoUrlRe or $req->data->{_proxiedRequest} ) {
$self->logger->debug("URL $url detected as an SSO request URL");
@ -221,11 +221,11 @@ sub run {
$self->disableSignatureVerification($login);
if ($request) {
$req->datas->{_proxiedSamlRequest} = $login->request();
$req->datas->{_proxiedRequest} = $request;
$req->datas->{_proxiedMethod} = $method;
$req->datas->{_proxiedRelayState} = $relaystate,
$req->datas->{_proxiedArtifact} = $artifact;
$req->data->{_proxiedSamlRequest} = $login->request();
$req->data->{_proxiedRequest} = $request;
$req->data->{_proxiedMethod} = $method;
$req->data->{_proxiedRelayState} = $relaystate,
$req->data->{_proxiedArtifact} = $artifact;
}
# Process the request or use IDP initiated mode
@ -441,7 +441,7 @@ sub run {
}
# Check Destination (only in non proxy mode)
unless ( $req->datas->{_proxiedRequest} ) {
unless ( $req->data->{_proxiedRequest} ) {
return PE_SAML_DESTINATION_ERROR
unless ( $self->checkDestination( $login->request, $url ) );
}
@ -1219,7 +1219,7 @@ sub soapSloServer {
sub logout {
my ( $self, $req ) = @_;
return PE_OK if ( $req->datas->{samlSLOCalled} );
return PE_OK if ( $req->data->{samlSLOCalled} );
# Session ID
my $session_id = $req->{sessionInfo}->{_session_id} || $req->{id};
@ -1388,7 +1388,7 @@ sub sloRelayPost {
sub authSloServer {
my ( $self, $req ) = @_;
$self->p->importHandlerDatas($req);
$self->p->importHandlerData($req);
return $self->sloServer($req);
}
@ -1488,7 +1488,7 @@ sub sloServer {
$session = $local_session->data->{ $self->lsDump };
$identity = $local_session->data->{ $self->liDump };
# Import user datas in $req (for other "logout" subs)
# Import user data in $req (for other "logout" subs)
$req->id( $local_session->data->{_session_id} );
$req->sessionInfo( $local_session->data );
$req->user( $local_session->data->{ $self->conf->{whatToTrace} } );
@ -1569,7 +1569,7 @@ sub sloServer {
# Close local session
# This flag is for logout() to say that SAML logout is already done
$req->datas->{samlSLOCalled} = 1;
$req->data->{samlSLOCalled} = 1;
# Launch normal logout and ignore errors
$self->p->do( $req, [ @{ $self->p->beforeLogout }, 'deleteSession' ] );
@ -1606,7 +1606,7 @@ sub sloServer {
# else it means SSO session was not closed: launching it
$self->logger->debug(
"SLO response found on an active SSO session, ignoring it");
$req->datas->{samlSLOCalled} = 1;
$req->data->{samlSLOCalled} = 1;
return $self->p->do( $req,
[ @{ $self->p->beforeLogout }, 'deleteSession' ] );
}

View File

@ -84,7 +84,7 @@ sub sendSoapResponse {
];
}
# Try to recover the CAS session corresponding to id and return session datas
# Try to recover the CAS session corresponding to id and return session data
# If id is set to undef, return a new session
sub getCasSession {
my ( $self, $id, $info ) = @_;
@ -355,7 +355,7 @@ sub validateST {
$self->logger->debug("CAS Proxy URL: $proxy_url");
$req->datas->{casProxyUrl} = $proxy_url;
$req->data->{casProxyUrl} = $proxy_url;
$prm{pgtUrl} = $proxy_url;
}
@ -413,7 +413,7 @@ sub validateST {
# There should be only on session
my $pgtIdSession = $self->getCasSession($id) or next;
$req->datas->{pgtId} = $pgtIdSession->data->{pgtId};
$req->data->{pgtId} = $pgtIdSession->data->{pgtId};
$pgtIdSession->remove;
}
}
@ -499,7 +499,7 @@ This module contains common methods for CAS
=head2 getCasSession
Try to recover the CAS session corresponding to id and return session datas
Try to recover the CAS session corresponding to id and return session data
If id is set to undef, return a new session
=head2 returnCasValidateError

View File

@ -109,9 +109,9 @@ sub checkChoice {
# Store choice if module loops
$req->pdata->{_choice} = $name;
return $name if ( $req->datas->{ "enabledMods" . $self->type } );
return $name if ( $req->data->{ "enabledMods" . $self->type } );
$req->sessionInfo->{_choice} = $name;
$req->datas->{ "enabledMods" . $self->type } = [ $self->modules->{$name} ];
$req->data->{ "enabledMods" . $self->type } = [ $self->modules->{$name} ];
$self->p->_authentication->authnLevel("${name}AuthnLevel");
return $name;
}
@ -121,7 +121,7 @@ sub name {
unless ($req) {
return 'Choice';
}
my $n = ref( $req->datas->{ "enabledMods" . $self->type }->[0] );
my $n = ref( $req->data->{ "enabledMods" . $self->type }->[0] );
$n =~ s/^Lemonldap::NG::Portal::(?:(?:UserDB|Auth)::)?//;
return $n;
}

View File

@ -387,7 +387,7 @@ sub check_password {
# If $user is an object then it's a Lemonldap::NG::Portal::Main::Request
# object
if ( ref($user) ) {
$password = $user->datas->{password};
$password = $user->data->{password};
$user = $user->{user};
}
my $table = $self->conf->{dbiAuthTable};

View File

@ -76,7 +76,7 @@ sub _buildFilter {
$filter =~ s/\$(\w+)/".\$req->{sessionInfo}->{$1}."/g;
$filter =~ s/\$req->\{sessionInfo\}->\{user\}/\$req->{user}/g;
$filter =~
s/\$req->\{sessionInfo\}->\{(_?password|mail)\}/\$req->{datas}->{$1}/g;
s/\$req->\{sessionInfo\}->\{(_?password|mail)\}/\$req->{data}->{$1}/g;
$_[0]->{p}->logger->debug("LDAP transformed filter: $filter");
$filter = "sub{my(\$req)=\$_[0];return \"$filter\";}";
return eval $filter;

View File

@ -93,8 +93,8 @@ sub getNotifBack {
$req->userData( $self->p->HANDLER->retrieveSession( $req, $id ) )
or return $self->p->sendError( $req, 'Unknown session', 401 );
# Restore datas
$self->p->importHandlerDatas($req);
# Restore data
$self->p->importHandlerData($req);
my $uid = $req->sessionInfo->{ $self->notifObject->notifField };
my ( $notifs, $forUser );
@ -174,10 +174,10 @@ sub getNotifBack {
# One pending notification has been found and not accepted,
# restart process to display pending notifications
# TODO: is it a good idea to launch all 'afterDatas' subs ?
# TODO: is it a good idea to launch all 'afterData' subs ?
$self->logger->debug(
'Pending notification has been found and not accepted');
return $self->p->do( $req, $self->p->afterDatas );
return $self->p->do( $req, $self->p->afterData );
}
# All pending notifications have been accepted, restore cookies and

View File

@ -155,8 +155,8 @@ sub getNotifBack {
$req->userData( $self->p->HANDLER->retrieveSession( $req, $id ) )
or return $self->sendError( $req, 'Unknown session', 401 );
# Restore datas
$self->p->importHandlerDatas($req);
# Restore data
$self->p->importHandlerData($req);
my $uid = $req->sessionInfo->{ $self->notifObject->notifField };
my ( $notifs, $forUser ) = $self->notifObject->getNotifications($uid);
@ -233,10 +233,10 @@ sub getNotifBack {
# One pending notification has been found and not accepted,
# restart process to display pending notifications
# TODO: is it a good idea to launch all 'afterDatas' subs ?
# TODO: is it a good idea to launch all 'afterData' subs ?
$self->logger->debug(
'Pending notification has been found and not accepted');
return $self->p->do( $req, $self->p->afterDatas );
return $self->p->do( $req, $self->p->afterData );
}
# All pending notifications have been accepted, restore cookies and

View File

@ -72,7 +72,7 @@ sub sregHook {
$self->logger->error("Unknown OpenID SREG request $k");
}
}
$req->datas->{_openIdTrustExtMsg} .= $self->loadTemplate(
$req->data->{_openIdTrustExtMsg} .= $self->loadTemplate(
'openIdPol',
params => {
policies => \@pol,
@ -103,7 +103,7 @@ sub sregHook {
}
}
# Now set datas
# Now set data
my ( %r, %msg, %ag, %toStore );
# Requested parameters: check if already agreed or confirm is set
@ -197,7 +197,7 @@ sub sregHook {
};
}
$req->datas->{_openIdTrustExtMsg} .= $self->loadTemplate(
$req->data->{_openIdTrustExtMsg} .= $self->loadTemplate(
'openIdTrust',
params => {
required => \@mreq,
@ -213,7 +213,7 @@ sub sregHook {
## @method private array sregfilter(array attr)
# Filter the arguments passed as parameters by checking their compliance with
# SREG.
# @return fitered datas
# @return fitered data
sub sregfilter {
my ( $self, @attr ) = @_;
my ( @ret, @rej );

View File

@ -680,7 +680,7 @@ sub storeState {
my $infos;
foreach (@data) {
$infos->{$_} = $req->{$_} if $req->{$_};
$infos->{"datas_$_"} = $req->datas->{$_} if $req->datas->{$_};
$infos->{"data_$_"} = $req->data->{$_} if $req->data->{$_};
}
return unless ($infos);
@ -714,8 +714,8 @@ sub extractState {
foreach ( keys %{$stateSession} ) {
next if $_ =~ /(type|_session_id|_session_kind|_utime)/;
my $tmp = $stateSession->{$_};
if (s/^datas_//) {
$req->datas->{$_} = $tmp;
if (s/^data_//) {
$req->data->{$_} = $tmp;
}
elsif ( $req->can($_) ) {
$req->$_($tmp);

View File

@ -34,11 +34,11 @@ no warnings 'once';
sub getUser {
my ( $self, $req ) = @_;
return PE_OK if ( $req->datas->{_proxyQueryDone} );
return PE_OK if ( $req->data->{_proxyQueryDone} );
$self->logger->debug(
'Proxy push auth to ' . $self->conf->{proxyAuthService} );
my $resp = $self->ua->post( $self->conf->{proxyAuthService},
{ user => $req->{user}, password => $req->datas->{password} } );
{ user => $req->{user}, password => $req->data->{password} } );
unless ( $resp->is_success ) {
$self->logger->error(
'Unable to query authentication service: ' . $resp->status_line );
@ -66,7 +66,7 @@ sub getUser {
sub setSessionInfo {
my ( $self, $req ) = @_;
return PE_OK if ( $req->datas->{_setSessionInfoDone} );
return PE_OK if ( $req->data->{_setSessionInfoDone} );
my $q = HTTP::Request->new(
GET => $self->conf->{proxySessionService} . '/global',
[
@ -89,7 +89,7 @@ sub setSessionInfo {
foreach ( keys %$res ) {
$req->{sessionInfo}->{$_} ||= $res->{$_} unless (/^_/);
}
$req->datas->{_setSessionInfoDone}++;
$req->data->{_setSessionInfoDone}++;
PE_OK;
}

View File

@ -61,8 +61,8 @@ sub checkRemoteId {
return PE_ERROR;
}
%{ $req->datas->{rSessionInfo} } = %{ $remoteSession->data() };
delete( $req->datas->{rSessionInfo}->{'_password'} )
%{ $req->data->{rSessionInfo} } = %{ $remoteSession->data() };
delete( $req->data->{rSessionInfo}->{'_password'} )
unless ( $self->conf->{storePassword} );
return PE_OK;
}

View File

@ -546,7 +546,7 @@ sub checkLassoError {
## @method Lasso::Server createServer(string metadata, string private_key, string private_key_password, string private_key_enc, string private_key_enc_password, string certificate)
# Load service metadata and create Lasso::Server object
# @param metadata SAML metadatas
# @param metadata SAML metadata
# @param private_key private key
# @param private_key_password optional private key password
# @param private_key_enc optional private key for encryption
@ -767,14 +767,14 @@ sub createAuthnRequest {
# In this case:
# * Check proxy conditions
# * Forward some authn constraints
if ( $req->datas->{_proxiedSamlRequest} ) {
if ( $req->data->{_proxiedSamlRequest} ) {
$self->logger->debug("IDP Proxy mode detected");
# Get ProxyCount value
eval {
$proxyCount =
$req->datas->{_proxiedSamlRequest}->Scoping()->ProxyCount();
$req->data->{_proxiedSamlRequest}->Scoping()->ProxyCount();
};
# Deny request if ProxyCount eq 0
@ -791,22 +791,22 @@ sub createAuthnRequest {
else {
# Decrease ProxyCount
my $scoping = $req->datas->{_proxiedSamlRequest}->Scoping();
my $scoping = $req->data->{_proxiedSamlRequest}->Scoping();
$scoping->ProxyCount( $proxyCount-- );
eval { $request->Scoping($scoping); };
}
}
# isPassive
eval { $isPassive = $req->datas->{_proxiedSamlRequest}->IsPassive(); };
eval { $isPassive = $req->data->{_proxiedSamlRequest}->IsPassive(); };
# forceAuthn
eval { $forceAuthn = $req->datas->{_proxiedSamlRequest}->ForceAuthn(); };
eval { $forceAuthn = $req->data->{_proxiedSamlRequest}->ForceAuthn(); };
# requestedAuthnContext
eval {
$proxyRequestedAuthnContext =
$req->datas->{_proxiedSamlRequest}->RequestedAuthnContext();
$req->data->{_proxiedSamlRequest}->RequestedAuthnContext();
};
}
@ -3432,7 +3432,7 @@ If SAML Destination attribute is present, check it
=head2 getSamlSession
Try to recover the SAML session corresponding to id and return session datas
Try to recover the SAML session corresponding to id and return session data
=head2 createAttribute

View File

@ -29,10 +29,10 @@ no warnings 'once';
sub getUser {
my ( $self, $req ) = @_;
return PE_OK if ( $req->datas->{_proxyQueryDone} );
return PE_OK if ( $req->data->{_proxyQueryDone} );
my $soap = SOAP::Lite->proxy( $self->conf->{proxyAuthService} )
->uri('urn:Lemonldap/NG/Common/PSGI/SOAPService');
my $r = $soap->getCookies( $req->{user}, $req->datas->{password} );
my $r = $soap->getCookies( $req->{user}, $req->data->{password} );
if ( $r->fault ) {
$self->logger->error( "Unable to query authentication service: "
. $r->fault->{faultstring} );
@ -47,22 +47,22 @@ sub getUser {
$self->setSecurity($req);
return PE_BADCREDENTIALS;
}
unless ( $req->datas->{_remoteId} =
unless ( $req->data->{_remoteId} =
$res->{cookies}->{ $self->conf->{remoteCookieName} } )
{
$self->logger->error("No cookie named $self->{remoteCookieName}");
return PE_ERROR;
}
$req->datas->{_proxyQueryDone}++;
$req->data->{_proxyQueryDone}++;
PE_OK;
}
sub setSessionInfo {
my ( $self, $req ) = @_;
return PE_OK if ( $req->datas->{_setSessionInfoDone} );
return PE_OK if ( $req->data->{_setSessionInfoDone} );
my $soap = SOAP::Lite->proxy( $self->conf->{proxySessionService} )
->uri('urn:Lemonldap/NG/Common/PSGI/SOAPService');
my $r = $soap->getAttributes( $req->datas->{_remoteId} );
my $r = $soap->getAttributes( $req->data->{_remoteId} );
if ( $r->fault ) {
$self->logger->error( "Unable to query authentication service"
. $r->fault->{faultstring} );
@ -76,7 +76,7 @@ sub setSessionInfo {
$req->{sessionInfo}->{$_} ||= $res->{attributes}->{$_}
unless (/^_/);
}
$req->datas->{_setSessionInfoDone}++;
$req->data->{_setSessionInfoDone}++;
PE_OK;
}

View File

@ -20,15 +20,15 @@ has availableModules => ( is => 'rw', default => sub { {} } );
# Note that "beforeAuth" can't be used here and must be wrapped in auth
# module
#
# Note also that auth module must store in $req->datas->{enabledMods} a ref
# Note also that auth module must store in $req->data->{enabledMods} a ref
# to each enabled underlying auth modules
sub betweenAuthAndDatas { '_betweenAuthAndDatas' }
sub afterDatas { '_afterDatas' }
sub betweenAuthAndData { '_betweenAuthAndData' }
sub afterData { '_afterData' }
sub forAuthUser { '_forAuthUser' }
sub beforeLogout { '_beforeLogout' }
sub _betweenAuthAndDatas { _wrapEntryPoint( @_, 'betweenAuthAndDatas' ); }
sub _afterDatas { _wrapEntryPoint( @_, 'afterDatas' ); }
sub _betweenAuthAndData { _wrapEntryPoint( @_, 'betweenAuthAndData' ); }
sub _afterData { _wrapEntryPoint( @_, 'afterData' ); }
sub _forAuthUser { _wrapEntryPoint( @_, 'forAuthUser', 1 ); }
sub _beforeLogout { _wrapEntryPoint( @_, 'beforeLogout', 1 ); }
@ -50,8 +50,8 @@ sub _wrapEntryPoint {
"Missing $self->{sessionKey} key in session");
}
}
elsif ( ref $req->datas->{ "enabledMods" . $self->type } ) {
@t = @{ $req->datas->{ "enabledMods" . $self->type } };
elsif ( ref $req->data->{ "enabledMods" . $self->type } ) {
@t = @{ $req->data->{ "enabledMods" . $self->type } };
}
else {
$self->logger->debug(

View File

@ -41,19 +41,19 @@ sub display {
# 1.1 A notification has to be done (session is created but hidden and
# unusable until the user has accept the message)
if ( my $notif = $req->datas->{notification} ) {
if ( my $notif = $req->data->{notification} ) {
$self->logger->debug('Display: notification detected');
$skinfile = 'notification';
%templateParams = (
AUTH_ERROR_TYPE => $req->error_type,
NOTIFICATION => $notif,
HIDDEN_INPUTS => $self->buildHiddenForm($req),
AUTH_URL => $req->{datas}->{_url},
AUTH_URL => $req->{data}->{_url},
CHOICE_PARAM => $self->conf->{authChoiceParam},
CHOICE_VALUE => $req->datas->{_authChoice},
CHOICE_VALUE => $req->data->{_authChoice},
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -67,21 +67,21 @@ sub display {
%templateParams = (
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
AUTH_URL => $req->{datas}->{_url},
AUTH_URL => $req->{data}->{_url},
MSG => $req->info,
HIDDEN_INPUTS => $self->buildHiddenForm($req),
ACTIVE_TIMER => $req->datas->{activeTimer},
ACTIVE_TIMER => $req->data->{activeTimer},
FORM_METHOD => $self->conf->{confirmFormMethod},
CHOICE_PARAM => $self->conf->{authChoiceParam},
CHOICE_VALUE => $req->datas->{_authChoice},
CHOICE_VALUE => $req->data->{_authChoice},
CHECK_LOGINS => $self->conf->{portalCheckLogins}
&& $req->datas->{login},
&& $req->data->{login},
ASK_LOGINS => $req->param('checkLogins') || 0,
CONFIRMKEY => $self->stamp(),
REMEMBER => $req->datas->{confirmRemember},
REMEMBER => $req->data->{confirmRemember},
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -95,21 +95,21 @@ sub display {
%templateParams = (
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
AUTH_URL => $req->{datas}->{_url},
AUTH_URL => $req->{data}->{_url},
HIDDEN_INPUTS => $self->buildHiddenForm($req),
ACTIVE_TIMER => $req->datas->{activeTimer},
ACTIVE_TIMER => $req->data->{activeTimer},
FORM_METHOD => $self->conf->{confirmFormMethod},
CHOICE_PARAM => $self->conf->{authChoiceParam},
CHOICE_VALUE => $req->datas->{_authChoice},
CHOICE_VALUE => $req->data->{_authChoice},
CHECK_LOGINS => $self->conf->{portalCheckLogins}
&& $req->datas->{login},
&& $req->data->{login},
ASK_LOGINS => $req->param('checkLogins') || 0,
CONFIRMKEY => $self->stamp(),
LIST => $req->datas->{list} || [],
REMEMBER => $req->datas->{confirmRemember},
LIST => $req->data->{list} || [],
REMEMBER => $req->data->{confirmRemember},
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -126,13 +126,13 @@ sub display {
MSG => $info,
URL => $req->{urldc},
HIDDEN_INPUTS => $self->buildHiddenForm($req),
ACTIVE_TIMER => $req->datas->{activeTimer},
ACTIVE_TIMER => $req->data->{activeTimer},
FORM_METHOD => $self->conf->{infoFormMethod},
CHOICE_PARAM => $self->conf->{authChoiceParam},
CHOICE_VALUE => $req->datas->{_authChoice},
CHOICE_VALUE => $req->data->{_authChoice},
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -153,12 +153,12 @@ sub display {
PROVIDERURI => $p,
MSG => $req->info(),
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
$templateParams{ID} = $req->datas->{_openidPortal} . $id if ($id);
$templateParams{ID} = $req->data->{_openidPortal} . $id if ($id);
}
# 2. Good authentication
@ -169,10 +169,10 @@ sub display {
%templateParams = (
URL => $req->{urldc},
HIDDEN_INPUTS => $self->buildHiddenForm($req),
FORM_METHOD => $req->datas->{redirectFormMethod} || 'get',
FORM_METHOD => $req->data->{redirectFormMethod} || 'get',
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -193,8 +193,8 @@ sub display {
HIDE_OLDPASSWORD => 0,
$self->menu->params($req),
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -206,10 +206,10 @@ sub display {
MSG => 'askToRenew',
CONFIRMKEY => $self->stamp,
PORTAL => $self->conf->{portal},
URL => $req->datas->{_url},
URL => $req->data->{_url},
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -218,7 +218,7 @@ sub display {
# 2.3 Case : user authenticated but an error was returned (bas url,...)
elsif (
$req->noLoginDisplay
or ( not $req->datas->{noerror}
or ( not $req->data->{noerror}
and $req->userData
and %{ $req->userData } )
)
@ -228,8 +228,8 @@ sub display {
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -243,7 +243,7 @@ sub display {
%templateParams = (
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
AUTH_URL => $req->{datas}->{_url},
AUTH_URL => $req->{data}->{_url},
LOGIN => $login,
CHECK_LOGINS => $self->conf->{portalCheckLogins},
ASK_LOGINS => $req->param('checkLogins') || 0,
@ -254,8 +254,8 @@ sub display {
HIDDEN_INPUTS => $self->buildHiddenForm($req),
STAYCONNECTED => $self->conf->{stayConnected},
(
$req->datas->{customScript}
? ( CUSTOM_SCRIPT => $req->datas->{customScript} )
$req->data->{customScript}
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
);
@ -299,11 +299,11 @@ sub display {
DISPLAY_RESETPASSWORD => 0,
AUTH_LOOP => [],
CHOICE_PARAM => $self->conf->{authChoiceParam},
CHOICE_VALUE => $req->datas->{_authChoice},
CHOICE_VALUE => $req->data->{_authChoice},
OLDPASSWORD => $self->checkXSSAttack( 'oldpassword',
$req->datas->{oldpassword} )
$req->data->{oldpassword} )
? ""
: $req->datas->{oldpassword},
: $req->data->{oldpassword},
HIDE_OLDPASSWORD => $self->conf->{hideOldPassword},
);
}
@ -337,7 +337,7 @@ sub display {
%templateParams,
AUTH_LOOP => $authLoop,
CHOICE_PARAM => $self->conf->{authChoiceParam},
CHOICE_VALUE => $req->datas->{_authChoice},
CHOICE_VALUE => $req->data->{_authChoice},
DISPLAY_FORM => 0,
DISPLAY_OPENID_FORM => 0,
DISPLAY_YUBIKEY_FORM => 0,
@ -473,7 +473,7 @@ sub getSkin {
}
# Build an HTML array to display sessions
# @param $sessions Array ref of hash ref containing sessions datas
# @param $sessions Array ref of hash ref containing sessions data
# @param $title Title of the array
# @param $displayUser To display "User" column
# @param $displaError To display "Error" column

View File

@ -45,12 +45,12 @@ has beforeAuth => (
isa => 'ArrayRef',
default => sub { [] }
);
has betweenAuthAndDatas => (
has betweenAuthAndData => (
is => 'rw',
isa => 'ArrayRef',
default => sub { [] }
);
has afterDatas => (
has afterData => (
is => 'rw',
isa => 'ArrayRef',
default => sub { [] }
@ -151,7 +151,7 @@ sub reloadConf {
# Reinitialize arrays
foreach (
qw(_macros _groups beforeAuth betweenAuthAndDatas afterDatas forAuthUser beforeLogout)
qw(_macros _groups beforeAuth betweenAuthAndData afterData forAuthUser beforeLogout)
)
{
$self->{$_} = [];
@ -307,7 +307,7 @@ sub reloadConf {
}
# Clean $req->pdata after authentication
push @{ $self->afterDatas }, sub {
push @{ $self->afterData }, sub {
unless ( $_[0]->pdata->{keepPdata} ) {
$self->logger->debug('Cleaning pdata');
$_[0]->pdata( {} );
@ -337,7 +337,7 @@ sub findEP {
# Standards entry points
foreach my $sub (
qw(beforeAuth betweenAuthAndDatas afterDatas forAuthUser beforeLogout))
qw(beforeAuth betweenAuthAndData afterData forAuthUser beforeLogout))
{
if ( $obj->can($sub) ) {
$self->logger->debug(" Found $sub entry point:");

View File

@ -99,9 +99,9 @@ sub _redirect {
'controlUrl',
@{ $self->p->beforeAuth },
$self->p->authProcess,
@{ $self->p->betweenAuthAndDatas },
$self->p->sessionDatas,
@{ $self->p->afterDatas },
@{ $self->p->betweenAuthAndData },
$self->p->sessionData,
@{ $self->p->afterData },
(
$restore
? sub {
@ -136,7 +136,7 @@ sub _forAuthUser {
return $self->p->do(
$req,
[
'importHandlerDatas',
'importHandlerData',
'controlUrl',
@{ $self->p->forAuthUser },
sub {
@ -180,10 +180,10 @@ sub restoreRequest {
sub reAuth {
my ( $self, $req ) = @_;
$req->datas->{customScript} =
$req->data->{customScript} =
qq'<script type="text/javascript" src="$self->{p}->{staticPrefix}/common/js/autoRenew.min.js"></script>'
if ( $self->conf->{skipRenewConfirmation} );
$req->datas->{_url} =
$req->data->{_url} =
encode_base64( $self->conf->{portal} . $req->path_info, '' );
$req->pdata->{ $self->ipath } = $self->storeRequest($req);
$req->pdata->{keepPdata} = 1;

View File

@ -156,10 +156,10 @@ are available.
=item C<beforeAuth>: method called before authentication process
=item C<betweenAuthAndDatas>: method called after authentication and before
=item C<betweenAuthAndData>: method called after authentication and before
setting C<sessionInfo> provisionning
=item C<afterDatas>: method called after C<sessionInfo> provisionning
=item C<afterData>: method called after C<sessionInfo> provisionning
I<(macros, groups,...)>
=item C<forAuthUser>: method called for already authenticated users

View File

@ -36,14 +36,14 @@ sub process {
# First process block: check args
# -------------------------------
# For post requests, parse datas
# For post requests, parse data
sub restoreArgs {
my ( $self, $req ) = @_;
$req->mustRedirect(1);
return PE_OK;
}
sub importHandlerDatas {
sub importHandlerData {
my ( $self, $req ) = @_;
$req->{sessionInfo} = $req->userData;
$req->id( $req->sessionInfo->{_session_id} );
@ -73,7 +73,7 @@ sub controlUrl {
}
}
}
$req->{datas}->{_url} ||= '';
$req->{data}->{_url} ||= '';
my $url = $req->param('url');
if ($url) {
@ -120,7 +120,7 @@ sub controlUrl {
return PE_BADURL;
}
$req->datas->{_url} = $url;
$req->data->{_url} = $url;
}
PE_OK;
@ -161,7 +161,7 @@ sub deleteSession {
# TODO
# Collect logout services and build hidden iFrames
if ( $req->datas->{logoutServices} and %{ $req->datas->{logoutServices} } )
if ( $req->data->{logoutServices} and %{ $req->data->{logoutServices} } )
{
$self->logger->debug("Create iFrames to forward logout to services");
@ -172,10 +172,10 @@ sub deleteSession {
)
);
foreach ( keys %{ $req->datas->{logoutServices} } ) {
foreach ( keys %{ $req->data->{logoutServices} } ) {
my $logoutServiceName = $_;
my $logoutServiceUrl =
$req->datas->{logoutServices}->{$logoutServiceName};
$req->data->{logoutServices}->{$logoutServiceName};
$self->logger->debug(
"Find logout service $logoutServiceName ($logoutServiceUrl)");

View File

@ -17,7 +17,7 @@ has steps => ( is => 'rw' );
# Authentication result
has authResult => ( is => 'rw' );
# Session datas when created
# Session data when created
has id => ( is => 'rw' );
has sessionInfo => ( is => 'rw' );
has user => ( is => 'rw' );
@ -116,7 +116,7 @@ sub error_type {
sub init {
my ($self) = @_;
$self->{$_} = {} foreach (qw(datas customParameters sessionInfo pdata));
$self->{$_} = {} foreach (qw(data customParameters sessionInfo pdata));
$self->{$_} = [] foreach (qw(respCookies));
}
@ -130,8 +130,8 @@ sub loginInfo {
sub info {
my ( $self, $info ) = @_;
$self->datas->{_info} .= $info if ( defined $info );
return $self->datas->{_info};
$self->data->{_info} .= $info if ( defined $info );
return $self->data->{_info};
}
sub addCookie {
@ -174,7 +174,7 @@ portal jobs.
Stack of methods to call for this requests. It can be modified to change
authentication process
=head3 datas()
=head3 data()
Free hash ref where plugins can store their data (during one request). Using it
is a LLNG best practice

View File

@ -19,7 +19,7 @@ use URI::Escape;
# List constants
sub authProcess { qw(extractFormInfo getUser authenticate) }
sub sessionDatas {
sub sessionData {
qw(setAuthSessionInfo setSessionInfo setMacros setGroups setPersistentSessionInfo
setLocalGroups store secondFactor storeHistory buildCookie);
}
@ -89,8 +89,8 @@ sub login {
$req,
[
'controlUrl', @{ $self->beforeAuth },
$self->authProcess, @{ $self->betweenAuthAndDatas },
$self->sessionDatas, @{ $self->afterDatas },
$self->authProcess, @{ $self->betweenAuthAndData },
$self->sessionData, @{ $self->afterData },
]
);
}
@ -102,8 +102,8 @@ sub postLogin {
[
'restoreArgs', 'controlUrl',
@{ $self->beforeAuth }, $self->authProcess,
@{ $self->betweenAuthAndDatas }, $self->sessionDatas,
@{ $self->afterDatas },
@{ $self->betweenAuthAndData }, $self->sessionData,
@{ $self->afterData },
]
);
}
@ -113,7 +113,7 @@ sub authenticatedRequest {
return $self->do(
$req,
[
'importHandlerDatas', 'controlUrl',
'importHandlerData', 'controlUrl',
'checkLogout', @{ $self->forAuthUser }
]
);
@ -124,7 +124,7 @@ sub postAuthenticatedRequest {
return $self->do(
$req,
[
'importHandlerDatas', 'restoreArgs',
'importHandlerData', 'restoreArgs',
'controlUrl', 'checkLogout',
@{ $self->forAuthUser }
]
@ -134,24 +134,24 @@ sub postAuthenticatedRequest {
sub refresh {
my ( $self, $req ) = @_;
$req->mustRedirect(1);
my %datas = %{ $req->userData };
$req->user( $datas{ $self->conf->{whatToTrace} } );
$req->id( $datas{_session_id} );
my %data = %{ $req->userData };
$req->user( $data{ $self->conf->{whatToTrace} } );
$req->id( $data{_session_id} );
$self->userLogger->notice( 'Refresh request for ' . $req->user );
foreach ( keys %datas ) {
delete $datas{$_} unless ( /^_/ or /^(?:startTime)$/ );
foreach ( keys %data ) {
delete $data{$_} unless ( /^_/ or /^(?:startTime)$/ );
}
$req->steps(
[
'getUser',
@{ $self->betweenAuthAndDatas },
@{ $self->betweenAuthAndData },
'setAuthSessionInfo',
'setSessionInfo',
'setMacros',
'setGroups',
'setLocalGroups',
sub {
$req->sessionInfo->{$_} = $datas{$_} foreach ( keys %datas );
$req->sessionInfo->{$_} = $data{$_} foreach ( keys %data );
return PE_OK;
},
'store',
@ -187,7 +187,7 @@ sub logout {
sub do {
my ( $self, $req, $steps ) = @_;
$req->steps($steps);
$req->datas->{activeTimer} = $self->conf->{activeTimer};
$req->data->{activeTimer} = $self->conf->{activeTimer};
my $err = $req->error( $self->process($req) );
# Update status
@ -237,8 +237,8 @@ sub do {
and (
$err != PE_REDIRECT
or ( $err == PE_REDIRECT
and $req->datas->{redirectFormMethod}
and $req->datas->{redirectFormMethod} eq 'post' )
and $req->data->{redirectFormMethod}
and $req->data->{redirectFormMethod} eq 'post' )
or $req->info
)
)
@ -297,7 +297,7 @@ sub autoRedirect {
$self->logger->debug("Building redirection to $req->{urldc}");
if ( $self->_jsRedirect->( $req, $req->sessionInfo ) ) {
$req->error(PE_REDIRECT);
$req->datas->{redirectFormMethod} = "get";
$req->data->{redirectFormMethod} = "get";
}
else {
return [ 302,
@ -309,7 +309,7 @@ sub autoRedirect {
return $self->sendHtml( $req, $tpl, params => $prms );
}
# Try to recover the session corresponding to id and return session datas.
# Try to recover the session corresponding to id and return session data.
# If $id is set to undef or if $args{force} is true, return a new session.
sub getApacheSession {
my ( $self, $id, %args ) = @_;
@ -374,7 +374,7 @@ sub getApacheSession {
return $as;
}
# Try to recover the persistent session corresponding to uid and return session datas.
# Try to recover the persistent session corresponding to uid and return session data.
sub getPersistentSession {
my ( $self, $uid, $info ) = @_;
@ -450,7 +450,7 @@ sub updatePersistentSession {
# Update session stored.
# If no id is given, try to get it from cookie.
# If the session is available, update datas with $info.
# If the session is available, update data with $info.
# Note that outdated session data may remain some time on
# server local cache, if there are several LL::NG servers.
# @param infos hash reference of information to update
@ -473,7 +473,7 @@ sub updateSession {
foreach ( keys %$infos ) {
$self->logger->debug(
"Update sessionInfo $_ with " . $infos->{$_} );
$req->{sessionInfo}->{$_} = $self->HANDLER->datas->{$_} =
$req->{sessionInfo}->{$_} = $self->HANDLER->data->{$_} =
$infos->{$_};
}
@ -589,7 +589,7 @@ sub autoPost {
return PE_INFO;
}
$req->datas->{redirectFormMethod} = "post";
$req->data->{redirectFormMethod} = "post";
return PE_REDIRECT;
}

View File

@ -95,7 +95,7 @@ sub _verify {
if ( my $l = $self->conf->{ $self->prefix . '2fAuthnLevel' } ) {
$self->p->updateSession( $req, { authenticationLevel => $l } );
}
return $self->p->do( $req, [ @{ $self->p->afterDatas }, sub { PE_OK } ] );
return $self->p->do( $req, [ @{ $self->p->afterData }, sub { PE_OK } ] );
}
1;

View File

@ -32,13 +32,13 @@ sub _modifyPassword {
# Exit if no password change requested
return PE_OK
unless ( $req->datas->{newpassword} = $req->param('newpassword') );
unless ( $req->data->{newpassword} = $req->param('newpassword') );
# Check if portal require old password
if ( $self->conf->{portalRequireOldPassword} ) {
# TODO: verify oldpassword
unless ( $req->datas->{oldpassword} = $req->param('oldpassword') ) {
unless ( $req->data->{oldpassword} = $req->param('oldpassword') ) {
$self->logger->warn("Portal require old password");
return PE_PP_MUST_SUPPLY_OLD_PASSWORD;
}
@ -46,15 +46,15 @@ sub _modifyPassword {
# Verify that old password is good
return PE_PASSWORD_MISMATCH
unless (
$req->datas->{newpassword} eq $req->param('confirmpassword') );
$req->data->{newpassword} eq $req->param('confirmpassword') );
# Verify old password
return PE_BADOLDPASSWORD
unless ( $self->confirm( $req, $req->datas->{oldpassword} ) );
unless ( $self->confirm( $req, $req->data->{oldpassword} ) );
}
# Call password package
my $res = $self->modifyPassword( $req, $req->datas->{newpassword} );
my $res = $self->modifyPassword( $req, $req->data->{newpassword} );
if ( $res == PE_PASSWORD_OK ) {
$self->logger->debug( 'Update password in session for ' . $req->user );
my $infos;

View File

@ -18,13 +18,13 @@ sub init {
sub confirm {
my ( $self, $req, $pwd ) = @_;
$self->checkChoice($req) or return PE_ERROR;
return $req->datas->{enabledMods2}->[0]->confirm( $req, $pwd );
return $req->data->{enabledMods2}->[0]->confirm( $req, $pwd );
}
sub modifyPassword {
my ( $self, $req, $pwd ) = @_;
$self->checkChoice($req) or return PE_ERROR;
return $req->datas->{enabledMods2}->[0]->modifyPassword( $req, $pwd );
return $req->data->{enabledMods2}->[0]->modifyPassword( $req, $pwd );
}
1;

View File

@ -32,7 +32,7 @@ sub modifyPassword {
# Call the modify password method
my $code =
$self->ldap->userModifyPassword( $dn, $pwd, $req->datas->{oldpassword} );
$self->ldap->userModifyPassword( $dn, $pwd, $req->data->{oldpassword} );
unless ( $code == PE_PASSWORD_OK ) {
$self->ldap->unbind;
@ -42,7 +42,7 @@ sub modifyPassword {
# If password policy and force reset, set reset flag
if ( $self->conf->{ldapPpolicyControl}
and $req->datas->{forceReset}
and $req->data->{forceReset}
and $self->conf->{ldapUsePasswordResetAttribute} )
{
my $result = $self->ldap->modify(

View File

@ -13,7 +13,7 @@ extends 'Lemonldap::NG::Common::Module';
# INTERFACE
use constant afterDatas => 'changeUrldc';
use constant afterData => 'changeUrldc';
use constant forAuthUser => 'changeUrldc';
sub init { 1 }

View File

@ -42,7 +42,7 @@ sub check {
if ( my $user = $req->param('user') and my $pwd = $req->param('password') )
{
$req->user($user);
$req->datas->{password} = $pwd;
$req->data->{password} = $pwd;
# Not launched methods:
# - "extractFormInfo" due to "token"
@ -51,11 +51,11 @@ sub check {
[
'getUser',
'authenticate',
@{ $self->p->betweenAuthAndDatas },
@{ $self->p->betweenAuthAndData },
qw( setAuthSessionInfo setSessionInfo setMacros setGroups
setPersistentSessionInfo setLocalGroups store secondFactor
storeHistory),
@{ $self->p->afterDatas }
@{ $self->p->afterData }
]
);
if ( $res = $self->p->process( $req, ) ) {

View File

@ -11,7 +11,7 @@ our $VERSION = '2.0.0';
extends 'Lemonldap::NG::Portal::Main::Plugin';
use constant afterDatas => 'grantSession';
use constant afterData => 'grantSession';
has rules => ( is => 'rw', default => sub { {} } );

View File

@ -11,7 +11,7 @@ extends 'Lemonldap::NG::Portal::Main::Plugin',
# INITIALIZATION
sub afterDatas { 'run' }
sub afterData { 'run' }
sub init { 1 }

View File

@ -93,7 +93,7 @@ sub _reset {
}
# FIRST FORM
$mailToken = $req->datas->{mailToken} = $req->param('mail_token');
$mailToken = $req->data->{mailToken} = $req->param('mail_token');
unless ( $req->param('mail') || $mailToken ) {
$self->setSecurity($req);
return PE_MAILFIRSTACCESS if ( $req->method eq 'GET' );
@ -114,7 +114,7 @@ sub _reset {
}
$req->{user} = $mailSession->data->{user};
$req->datas->{mailAddress} =
$req->data->{mailAddress} =
$mailSession->data->{ $self->conf->{mailSessionKey} };
$self->logger->debug( 'User associated to: ' . $req->{user} );
$mailSession->remove;
@ -197,9 +197,9 @@ sub _reset {
my $mailTimeout =
$self->conf->{mailTimeout} || $self->conf->{timeout};
my $expTimestamp = time() + $mailTimeout;
$req->datas->{expMailDate} =
$req->data->{expMailDate} =
strftime( "%d/%m/%Y", localtime $expTimestamp );
$req->datas->{expMailTime} =
$req->data->{expMailTime} =
strftime( "%H:%M", localtime $expTimestamp );
return PE_MAILCONFIRMOK;
}
@ -246,7 +246,7 @@ sub _reset {
}
elsif ($mailSession) {
$self->logger->debug( 'Mail session found: ' . $mailSession->id );
$req->datas->{mailAlreadySent} = 1;
$req->data->{mailAlreadySent} = 1;
}
# Send confirmation mail
@ -257,22 +257,22 @@ sub _reset {
$self->logger->debug("Mail expiration timestamp: $expTimestamp");
$req->datas->{expMailDate} =
$req->data->{expMailDate} =
strftime( "%d/%m/%Y", localtime $expTimestamp );
$req->datas->{expMailTime} =
$req->data->{expMailTime} =
strftime( "%H:%M", localtime $expTimestamp );
# Mail session start date
my $startTimestamp = $mailSession->data->{mailSessionStartTimestamp};
$self->logger->debug("Mail start timestamp: $startTimestamp");
$req->datas->{startMailDate} =
$req->data->{startMailDate} =
strftime( "%d/%m/%Y", localtime $startTimestamp );
$req->datas->{startMailTime} =
$req->data->{startMailTime} =
strftime( "%H:%M", localtime $startTimestamp );
# Ask if user want another confirmation email
if ( $req->datas->{mailAlreadySent}
if ( $req->data->{mailAlreadySent}
and !$req->param('resendconfirmation') )
{
$self->userLogger->notice(
@ -283,10 +283,10 @@ sub _reset {
}
# Get mail address
$req->datas->{mailAddress} ||=
$req->data->{mailAddress} ||=
$self->p->getFirstValue(
$req->{sessionInfo}->{ $self->conf->{mailSessionKey} } );
return PE_MAILERROR unless ( $req->datas->{mailAddress} );
return PE_MAILERROR unless ( $req->data->{mailAddress} );
# Build confirmation url
my $url =
@ -294,7 +294,7 @@ sub _reset {
. build_urlencoded(
mail_token => $req->{id},
skin => $self->p->getSkin($req),
( $req->datas->{_url} ? ( url => $req->datas->{_url} ) : () ),
( $req->data->{_url} ? ( url => $req->data->{_url} ) : () ),
);
# Build mail content
@ -319,15 +319,15 @@ sub _reset {
}
# Replace variables in body
$body =~ s/\$expMailDate/$req->datas->{expMailDate}/ge;
$body =~ s/\$expMailTime/$req->datas->{expMailTime}/ge;
$body =~ s/\$expMailDate/$req->data->{expMailDate}/ge;
$body =~ s/\$expMailTime/$req->data->{expMailTime}/ge;
$body =~ s/\$url/$url/g;
$body =~ s/\$(\w+)/$req->{sessionInfo}->{$1} || ''/ge;
# Send mail
unless (
$self->send_mail(
$req->datas->{mailAddress},
$req->data->{mailAddress},
$subject, $body, $html
)
)
@ -383,18 +383,18 @@ sub changePwd {
$self->logger->debug( "Generated password: " . $password );
$req->datas->{newpassword} = $password;
$req->datas->{confirmpassword} = $password;
$req->datas->{forceReset} = 1;
$req->data->{newpassword} = $password;
$req->data->{confirmpassword} = $password;
$req->data->{forceReset} = 1;
}
# Else a password is required in request
else {
$req->datas->{newpassword} = $req->param('newpassword');
$req->datas->{confirmpassword} = $req->param('confirmpassword');
unless ($req->datas->{newpassword}
and $req->datas->{confirmpassword}
and $req->datas->{newpassword} eq $req->datas->{confirmpassword} )
$req->data->{newpassword} = $req->param('newpassword');
$req->data->{confirmpassword} = $req->param('confirmpassword');
unless ($req->data->{newpassword}
and $req->data->{confirmpassword}
and $req->data->{newpassword} eq $req->data->{confirmpassword} )
{
$self->ott->setToken( $req, $req->sessionInfo );
return PE_PASSWORDFORMEMPTY;
@ -412,7 +412,7 @@ sub changePwd {
}
# Send mail containing the new password
$req->datas->{mailAddress} ||=
$req->data->{mailAddress} ||=
$self->p->getFirstValue(
$req->{sessionInfo}->{ $self->conf->{mailSessionKey} } );
@ -438,13 +438,13 @@ sub changePwd {
}
# Replace variables in body
my $password = $req->datas->{newpassword};
my $password = $req->data->{newpassword};
$body =~ s/\$password/$password/g;
$body =~ s/\$(\w+)/$req->{sessionInfo}->{$1} || ''/ge;
# Send mail
return PE_MAILERROR
unless $self->send_mail( $req->datas->{mailAddress}, $subject, $body,
unless $self->send_mail( $req->data->{mailAddress}, $subject, $body,
$html );
PE_MAILOK;
@ -469,13 +469,13 @@ sub display {
SKIN_BG => $self->conf->{portalSkinBackground},
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
AUTH_URL => $req->datas->{_url},
AUTH_URL => $req->data->{_url},
CHOICE_VALUE => $req->{_authChoice},
EXPMAILDATE => $req->datas->{expMailDate},
EXPMAILTIME => $req->datas->{expMailTime},
STARTMAILDATE => $req->datas->{startMailDate},
STARTMAILTIME => $req->datas->{startMailTime},
MAILALREADYSENT => $req->datas->{mailAlreadySent},
EXPMAILDATE => $req->data->{expMailDate},
EXPMAILTIME => $req->data->{expMailTime},
STARTMAILDATE => $req->data->{startMailDate},
STARTMAILTIME => $req->data->{startMailTime},
MAILALREADYSENT => $req->data->{mailAlreadySent},
MAIL => (
$self->p->checkXSSAttack( 'mail', $req->{user} )
? ""
@ -487,11 +487,11 @@ sub display {
DISPLAY_MAILSENT => 0,
DISPLAY_PASSWORD_FORM => 0,
);
if ( $req->datas->{mailToken}
and !$self->p->checkXSSAttack( 'mail_token', $req->datas->{mailToken} )
if ( $req->data->{mailToken}
and !$self->p->checkXSSAttack( 'mail_token', $req->data->{mailToken} )
)
{
$tplPrm{MAIL_TOKEN} = $req->datas->{mailToken};
$tplPrm{MAIL_TOKEN} = $req->data->{mailToken};
}
# Display captcha if it's enabled
@ -512,7 +512,7 @@ sub display {
or $req->error == PE_CAPTCHAERROR
or $req->error == PE_CAPTCHAEMPTY
)
and !$req->datas->{mailToken}
and !$req->data->{mailToken}
)
{
$self->logger->debug('Display form');
@ -538,7 +538,7 @@ sub display {
}
# Display password change form
elsif ( $req->datas->{mailToken}
elsif ( $req->data->{mailToken}
and $req->error != PE_MAILERROR
and $req->error != PE_BADMAILTOKEN
and $req->error != PE_MAILOK )

View File

@ -4,7 +4,7 @@
# * a new route "/notifback" for checking accepted notifications
# (sub getNotifBack). It launch then autoRedirect() with "mustRedirect"
# set to 1 because underlying handler has not seen user as authenticated
# so datas are not set;
# so data are not set;
# * a callback inserted in process steps after authentication process,
# This callback launches checkForNotifications to get notification and
# cipher LemonLDAP::NG cookies.
@ -26,7 +26,7 @@ extends 'Lemonldap::NG::Portal::Main::Plugin';
# INTERFACE
# Declare additional process steps
sub afterDatas { 'checkNotifDuringAuth' }
sub afterData { 'checkNotifDuringAuth' }
# For now, notifications are done only during authentication process
#sub forAuthUser { 'checkNotifForAuthUser' }
@ -109,14 +109,14 @@ sub init {
sub checkNotifDuringAuth {
my ( $self, $req ) = @_;
eval {
$req->{datas}->{notification} =
$req->{data}->{notification} =
$self->module->checkForNotifications($req);
};
if ($@) {
$self->logger->error($@);
return PE_ERROR;
}
if ( $req->{datas}->{notification} ) {
if ( $req->{data}->{notification} ) {
$self->p->rebuildCookies($req);
# Restore and cipher cookies

View File

@ -2,7 +2,7 @@
#
# This plugin adds the following entry points:
# - Sessions backend (if restSessionServer is on)
# * GET /sessions/<type>/<session-id> : get session datas
# * GET /sessions/<type>/<session-id> : get session data
# * GET /sessions/<type>/<session-id>/<key> : get a session key value
# * GET /sessions/<type>/<session-id>/[k1,k2] : get some session key value
# * POST /sessions/<type> : create a session
@ -10,7 +10,7 @@
# * DELETE /sessions/<type>/<session-id> : delete a session
#
# - Sessions for connected users (if restSessionServer is on):
# * GET /session/my/<type> : get session datas
# * GET /session/my/<type> : get session data
# * GET /session/my/<type>/key : get session key
# * DELETE /session/my : ask for logout
#
@ -229,14 +229,14 @@ sub newAuthSession {
$req->{id} = $id;
$req->{force} = 1;
$req->user( $req->param('user') );
$req->datas->{password} = $req->param('password');
$req->data->{password} = $req->param('password');
$req->steps(
[
@{ $self->p->beforeAuth },
qw(getUser authenticate setAuthSessionInfo),
@{ $self->p->betweenAuthAndDatas },
$self->p->sessionDatas,
@{ $self->p->afterDatas },
@{ $self->p->betweenAuthAndData },
$self->p->sessionData,
@{ $self->p->afterData },
]
);
$req->{error} = $self->p->process($req);

View File

@ -125,25 +125,25 @@ sub _register {
}
# Get register token (mail link)
$req->datas->{register_token} = $req->param('register_token');
$req->data->{register_token} = $req->param('register_token');
# If a register token is present, find the corresponding info
if ( $req->datas->{register_token} ) {
if ( $req->data->{register_token} ) {
$self->logger->debug(
"Token given for register: " . $req->datas->{register_token} );
"Token given for register: " . $req->data->{register_token} );
# Get the corresponding session
if ( my $datas =
$self->mailott->getToken( $req->datas->{register_token} ) )
if ( my $data =
$self->mailott->getToken( $req->data->{register_token} ) )
{
$self->logger->debug(
'Token ' . $req->datas->{register_token} . ' found' );
'Token ' . $req->data->{register_token} . ' found' );
foreach (qw(mail firstname lastname ipAddr)) {
$req->datas->{registerInfo}->{$_} = $datas->{$_};
$req->data->{registerInfo}->{$_} = $data->{$_};
}
$self->logger->debug( "User associated to token: "
. $req->datas->{registerInfo}->{mail} );
. $req->data->{registerInfo}->{mail} );
}
else {
return PE_BADMAILTOKEN;
@ -154,15 +154,15 @@ sub _register {
else {
# Use submitted value
$req->datas->{registerInfo}->{mail} = $req->param('mail');
$req->datas->{registerInfo}->{firstname} = $req->param('firstname');
$req->datas->{registerInfo}->{lastname} = $req->param('lastname');
$req->datas->{registerInfo}->{ipAddr} = $req->address;
$req->data->{registerInfo}->{mail} = $req->param('mail');
$req->data->{registerInfo}->{firstname} = $req->param('firstname');
$req->data->{registerInfo}->{lastname} = $req->param('lastname');
$req->data->{registerInfo}->{ipAddr} = $req->address;
# Check captcha/token only if register session does not already exist
if ( $req->datas->{registerInfo}->{mail}
if ( $req->data->{registerInfo}->{mail}
and
!$self->getRegisterSession( $req->datas->{registerInfo}->{mail} ) )
!$self->getRegisterSession( $req->data->{registerInfo}->{mail} ) )
{
# Check if token exists
my $token;
@ -211,12 +211,12 @@ sub _register {
# Check mail
return PE_MALFORMEDUSER
unless ( $req->datas->{registerInfo}->{mail} =~
unless ( $req->data->{registerInfo}->{mail} =~
m/$self->{conf}->{userControl}/o );
# Search for user using UserDB module
# If the user already exists, register is forbidden
$req->user( $req->datas->{registerInfo}->{mail} );
$req->user( $req->data->{registerInfo}->{mail} );
if ( $self->p->_userDB->getUser( $req, useMail => 1 ) == PE_OK ) {
$self->userLogger->error(
"Register: refuse mail $req->{mail} because already exists in UserDB"
@ -224,20 +224,20 @@ sub _register {
return PE_REGISTERALREADYEXISTS;
}
my $register_session =
$self->getRegisterSession( $req->datas->{registerInfo}->{mail} );
$req->datas->{mail_already_sent} =
$self->getRegisterSession( $req->data->{registerInfo}->{mail} );
$req->data->{mail_already_sent} =
( $register_session and !$req->id ) ? 1 : 0;
# Skip this step if confirmation was already sent
unless ( $req->datas->{register_token} or $register_session ) {
unless ( $req->data->{register_token} or $register_session ) {
# Create mail token
$register_session = $self->mailott->createToken(
{
mail => $req->datas->{registerInfo}->{mail},
firstname => $req->datas->{registerInfo}->{firstname},
lastname => $req->datas->{registerInfo}->{lastname},
ipAddr => $req->datas->{registerInfo}->{ipAddr},
mail => $req->data->{registerInfo}->{mail},
firstname => $req->data->{registerInfo}->{firstname},
lastname => $req->data->{registerInfo}->{lastname},
ipAddr => $req->data->{registerInfo}->{ipAddr},
_type => 'register',
}
);
@ -247,7 +247,7 @@ sub _register {
# Send confirmation mail
# Skip this step if user clicked on the confirmation link
unless ( $req->datas->{register_token} ) {
unless ( $req->data->{register_token} ) {
# Check if confirmation mail has already been sent
$self->logger->debug('No register_token');
@ -263,9 +263,9 @@ sub _register {
$self->logger->debug("Register expiration timestamp: $expTimestamp");
$req->datas->{expMailDate} =
$req->data->{expMailDate} =
strftime( "%d/%m/%Y", localtime $expTimestamp );
$req->datas->{expMailTime} =
$req->data->{expMailTime} =
strftime( "%H:%M", localtime $expTimestamp );
# Mail session start date
@ -273,13 +273,13 @@ sub _register {
$self->logger->debug("Register start timestamp: $startTimestamp");
$req->datas->{startMailDate} =
$req->data->{startMailDate} =
strftime( "%d/%m/%Y", localtime $startTimestamp );
$req->datas->{startMailTime} =
$req->data->{startMailTime} =
strftime( "%H:%M", localtime $startTimestamp );
# Ask if user want another confirmation email
if ( $req->datas->{mail_already_sent}
if ( $req->data->{mail_already_sent}
and !$req->param('resendconfirmation') )
{
return PE_MAILCONFIRMATION_ALREADY_SENT;
@ -291,7 +291,7 @@ sub _register {
. build_urlencoded(
register_token => $req->{id},
skin => $self->p->getSkin($req),
( $req->datas->{_url} ? ( url => $req->datas->{_url} ) : () ),
( $req->data->{_url} ? ( url => $req->data->{_url} ) : () ),
);
# Build mail content
@ -308,14 +308,14 @@ sub _register {
$body = $self->loadTemplate( 'mail_register_confirm', filter => $tr );
# Replace variables in body
$body =~ s/\$expMailDate/$req->datas->{expMailDate}/g;
$body =~ s/\$expMailTime/$req->datas->{expMailTime}/g;
$body =~ s/\$expMailDate/$req->data->{expMailDate}/g;
$body =~ s/\$expMailTime/$req->data->{expMailTime}/g;
$body =~ s/\$url/$url/g;
$body =~ s/\$(\w+)/$req->datas->{registerInfo}->{$1}/eg;
$body =~ s/\$(\w+)/$req->data->{registerInfo}->{$1}/eg;
# Send mail
return PE_MAILERROR
unless $self->send_mail( $req->datas->{registerInfo}->{mail},
unless $self->send_mail( $req->data->{registerInfo}->{mail},
$subject, $body, $html );
$self->logger->debug('Register message sent');
@ -327,24 +327,24 @@ sub _register {
$self->logger->debug( "Generated password: " . $password );
$req->datas->{registerInfo}->{password} = $password;
$req->datas->{forceReset} = 1;
$req->data->{registerInfo}->{password} = $password;
$req->data->{forceReset} = 1;
# Find a login
my $result = $self->registerModule->computeLogin($req);
unless ( $result == PE_OK ) {
$self->logger->error( "Could not compute login for "
. $req->datas->{registerInfo}->{mail} );
. $req->data->{registerInfo}->{mail} );
return $result;
}
# Create user
$self->logger->debug(
'Create new user ' . $req->datas->{registerInfo}->{login} );
'Create new user ' . $req->data->{registerInfo}->{login} );
$result = $self->registerModule->createUser($req);
unless ( $result == PE_OK ) {
$self->logger->error(
"Could not create user " . $req->datas->{registerInfo}->{login} );
"Could not create user " . $req->data->{registerInfo}->{login} );
return $result;
}
@ -367,16 +367,16 @@ sub _register {
$url .= '/?'
. build_urlencoded(
skin => $self->p->getSkin($req),
( $req->datas->{_url} ? ( url => $req->datas->{_url} ) : () ),
( $req->data->{_url} ? ( url => $req->data->{_url} ) : () ),
);
# Replace variables in body
$body =~ s/\$url/$url/g;
$body =~ s/\$(\w+)/$req->datas->{registerInfo}->{$1}/ge;
$body =~ s/\$(\w+)/$req->data->{registerInfo}->{$1}/ge;
# Send mail
return PE_MAILERROR
unless $self->send_mail( $req->datas->{registerInfo}->{mail},
unless $self->send_mail( $req->data->{registerInfo}->{mail},
$subject, $body, $html );
return PE_MAILOK;
@ -390,26 +390,26 @@ sub display {
SKIN_BG => $self->conf->{portalSkinBackground},
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
AUTH_URL => $req->datas->{_url},
AUTH_URL => $req->data->{_url},
CHOICE_PARAM => $self->conf->{authChoiceParam},
CHOICE_VALUE => $req->datas->{_authChoice},
EXPMAILDATE => $req->datas->{expMailDate},
EXPMAILTIME => $req->datas->{expMailTime},
STARTMAILDATE => $req->datas->{startMailDate},
STARTMAILTIME => $req->datas->{startMailTime},
MAILALREADYSENT => $req->datas->{mail_already_sent},
CHOICE_VALUE => $req->data->{_authChoice},
EXPMAILDATE => $req->data->{expMailDate},
EXPMAILTIME => $req->data->{expMailTime},
STARTMAILDATE => $req->data->{startMailDate},
STARTMAILTIME => $req->data->{startMailTime},
MAILALREADYSENT => $req->data->{mail_already_sent},
MAIL => $self->p->checkXSSAttack( 'mail',
$req->datas->{registerInfo}->{mail} ) ? ""
: $req->datas->{registerInfo}->{mail},
$req->data->{registerInfo}->{mail} ) ? ""
: $req->data->{registerInfo}->{mail},
FIRSTNAME => $self->p->checkXSSAttack( 'firstname',
$req->datas->{registerInfo}->{firstname} ) ? ""
: $req->datas->{registerInfo}->{firstname},
$req->data->{registerInfo}->{firstname} ) ? ""
: $req->data->{registerInfo}->{firstname},
LASTNAME => $self->p->checkXSSAttack( 'lastname',
$req->datas->{registerInfo}->{lastname} ) ? ""
: $req->datas->{registerInfo}->{lastname},
$req->data->{registerInfo}->{lastname} ) ? ""
: $req->data->{registerInfo}->{lastname},
REGISTER_TOKEN => $self->p->checkXSSAttack( 'register_token',
$req->datas->{register_token} ) ? ""
: $req->datas->{register_token},
$req->data->{register_token} ) ? ""
: $req->data->{register_token},
);
# Display form the first time

View File

@ -159,7 +159,7 @@ sub getCookies {
$self->logger->debug("SOAP authentication request for $user");
$req->{user} = $user;
$req->datas->{password} = $password;
$req->data->{password} = $password;
if ($sessionid) {
$req->{id} = $sessionid;
$req->{force} = 1;
@ -168,7 +168,7 @@ sub getCookies {
$req->{error} = PE_OK;
# User and password are required
unless ( $req->{user} && $req->datas->{password} ) {
unless ( $req->{user} && $req->data->{password} ) {
$req->{error} = PE_FORMEMPTY;
}
@ -177,9 +177,9 @@ sub getCookies {
$req->steps(
[
qw(getUser authenticate setAuthSessionInfo),
@{ $self->p->betweenAuthAndDatas },
$self->p->sessionDatas,
@{ $self->p->afterDatas },
@{ $self->p->betweenAuthAndData },
$self->p->sessionData,
@{ $self->p->afterData },
]
);
$req->{error} = $self->p->process($req);
@ -255,9 +255,9 @@ sub getAttributes {
return $res;
}
# Update datas in the session referenced by $id
# Update data in the session referenced by $id
# @param $id Id of the session
# @param $args datas to store
# @param $args data to store
=begin WSDL
@ -425,7 +425,7 @@ sub isAuthorizedURI {
##@fn private SOAP::Data _buildSoapHash()
# Serialize a hashref into SOAP::Data. Types are fixed to "string".
# @return SOAP::Data serialized datas
# @return SOAP::Data serialized data
sub _buildSoapHash {
my ( $h, @keys ) = @_;
my @tmp = ();

View File

@ -9,7 +9,7 @@ our $VERSION = '2.0.0';
extends 'Lemonldap::NG::Portal::Main::Plugin',
'Lemonldap::NG::Portal::Lib::OtherSessions';
sub afterDatas { 'run' }
sub afterData { 'run' }
sub init { 1 }

View File

@ -16,7 +16,7 @@ extends 'Lemonldap::NG::Portal::Main::Plugin';
# INTERFACE
use constant afterDatas => 'newDevice';
use constant afterData => 'newDevice';
use constant beforeAuth => 'check';
@ -79,7 +79,7 @@ sub newDevice {
return PE_OK;
}
# Store datas in a long-time session
# Store data in a long-time session
sub storeBrowser {
my ( $self, $req ) = @_;
$req->urldc( $req->param('url') );
@ -98,7 +98,7 @@ sub storeBrowser {
_utime => time + $self->timeout,
_session_uid => $uid,
_connectedSince => time,
dataKeep => $req->datas->{dataToKeep},
dataKeep => $req->data->{dataToKeep},
fingerprint => $fg,
},
);
@ -153,7 +153,7 @@ sub check {
and my $token = $req->param('token') )
{
if ( my $prm = $self->ott->getToken($token) ) {
$req->datas->{dataKeep} = $ps->data->{dataKeep};
$req->data->{dataKeep} = $ps->data->{dataKeep};
$self->logger->debug('Persistent connection found');
if ( $fg eq $ps->data->{fingerprint} ) {
$req->user($uid);

View File

@ -72,7 +72,7 @@ sub confirm {
my $res = $self->p->process($req);
return $self->p->do( $req, [ sub { $res } ] ) if ($res);
if ( $upg or $req->param('confirm') == 1 ) {
$req->datas->{noerror} = 1;
$req->data->{noerror} = 1;
$self->p->setHiddenFormValue(
$req,
upgrading => $self->ott->createToken,

View File

@ -15,31 +15,31 @@ sub createUser {
my ( $self, $req ) = @_;
my $name =
ucfirst $req->datas->{registerInfo}->{firstname} . " "
. uc $req->datas->{registerInfo}->{lastname};
ucfirst $req->data->{registerInfo}->{firstname} . " "
. uc $req->data->{registerInfo}->{lastname};
my $sn = uc $req->datas->{registerInfo}->{lastname};
my $gn = ucfirst $req->datas->{registerInfo}->{firstname};
my $sn = uc $req->data->{registerInfo}->{lastname};
my $gn = ucfirst $req->data->{registerInfo}->{firstname};
utf8::decode($sn);
utf8::decode($gn);
my $mesg = $self->ldap->add(
"cn=$name," . $self->conf->{ldapBase},
attrs => [
objectClass => [qw/top person organizationalPerson user/],
sAMAccountName => $req->datas->{registerInfo}->{login},
sAMAccountName => $req->data->{registerInfo}->{login},
cn => $name,
sn => $sn,
givenName => $gn,
unicodePwd => utf8(
chr(34) . $req->datas->{registerInfo}->{password} . chr(34)
chr(34) . $req->data->{registerInfo}->{password} . chr(34)
)->utf16le(),
mail => $req->datas->{registerInfo}->{mail},
mail => $req->data->{registerInfo}->{mail},
]
);
if ( $mesg->is_error ) {
$self->userLogger->error( "Can not create entry for "
. $req->datas->{registerInfo}->{login} );
. $req->data->{registerInfo}->{login} );
$self->logger->error( "LDAP error " . $mesg->error );
$self->ldap->unbind();

View File

@ -19,10 +19,10 @@ sub computeLogin {
# Get first letter of firstname and lastname
my $login =
substr( lc $req->datas->{registerInfo}->{firstname}, 0, 1 )
. lc $req->datas->{registerInfo}->{lastname};
substr( lc $req->data->{registerInfo}->{firstname}, 0, 1 )
. lc $req->data->{registerInfo}->{lastname};
$req->datas->{registerInfo}->{login} = $login;
$req->data->{registerInfo}->{login} = $login;
return PE_OK;
}
@ -32,12 +32,12 @@ sub computeLogin {
# @result Lemonldap::NG::Portal constant
sub createUser {
my ( $self, $req ) = @_;
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{ $req->datas
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{ $req->data
->{registerInfo}->{login} } = {
uid => $req->datas->{registerInfo}->{login},
cn => $req->datas->{registerInfo}->{firstname} . ' '
. $req->datas->{registerInfo}->{lastname},
mail => $req->datas->{registerInfo}->{login} . '@badwolf.org',
uid => $req->data->{registerInfo}->{login},
cn => $req->data->{registerInfo}->{firstname} . ' '
. $req->data->{registerInfo}->{lastname},
mail => $req->data->{registerInfo}->{login} . '@badwolf.org',
};
return PE_OK;
}

View File

@ -22,8 +22,8 @@ sub computeLogin {
# Get first letter of firstname and lastname
my $login =
substr( lc $req->datas->{registerInfo}->{firstname}, 0, 1 )
. lc $req->datas->{registerInfo}->{lastname};
substr( lc $req->data->{registerInfo}->{firstname}, 0, 1 )
. lc $req->data->{registerInfo}->{lastname};
my $finalLogin = $login;
@ -34,7 +34,7 @@ sub computeLogin {
$finalLogin = $login . $i;
}
$req->datas->{registerInfo}->{login} = $finalLogin;
$req->data->{registerInfo}->{login} = $finalLogin;
return PE_OK;
}
@ -45,30 +45,30 @@ sub createUser {
my ( $self, $req ) = @_;
# LDAP connection has been verified by computeLogin
my $sn = uc $req->datas->{registerInfo}->{lastname};
my $gn = ucfirst $req->datas->{registerInfo}->{firstname};
my $sn = uc $req->data->{registerInfo}->{lastname};
my $gn = ucfirst $req->data->{registerInfo}->{firstname};
my $cn = "$gn $sn";
utf8::decode($cn);
utf8::decode($sn);
utf8::decode($gn);
my $mesg = $self->ldap->add(
"uid="
. $req->datas->{registerInfo}->{login} . ","
. $req->data->{registerInfo}->{login} . ","
. $self->conf->{ldapBase},
attrs => [
objectClass => [qw/top person organizationalPerson inetOrgPerson/],
uid => $req->datas->{registerInfo}->{login},
uid => $req->data->{registerInfo}->{login},
cn => $cn,
sn => $sn,
givenName => $gn,
userPassword => $req->datas->{registerInfo}->{password},
mail => $req->datas->{registerInfo}->{mail},
userPassword => $req->data->{registerInfo}->{password},
mail => $req->data->{registerInfo}->{mail},
]
);
if ( $mesg->is_error ) {
$self->userLogger->error( "Can not create entry for "
. $req->datas->{registerInfo}->{login} );
. $req->data->{registerInfo}->{login} );
$self->logger->error( "LDAP error " . $mesg->error );
$self->ldap->unbind();

View File

@ -28,7 +28,7 @@ sub getUser {
sub setSessionInfo {
my ( $self, $req ) = @_;
my $srv;
unless ( $srv = $req->datas->{_casSrvCurrent} ) {
unless ( $srv = $req->data->{_casSrvCurrent} ) {
$self->logger->error('UserDB::CAS must be used with Auth::CAS');
return PE_ERROR;
}
@ -37,7 +37,7 @@ sub setSessionInfo {
%{ $self->conf->{exportedVars} }
);
foreach ( keys %ev ) {
$req->{sessionInfo}->{$_} = $req->datas->{casAttrs}->{$_};
$req->{sessionInfo}->{$_} = $req->data->{casAttrs}->{$_};
}
PE_OK;
}

View File

@ -19,16 +19,16 @@ sub init {
sub getUser {
my ( $self, $req, %args ) = @_;
$self->checkChoice($req) or return PE_FIRSTACCESS;
return $req->datas->{enabledMods1}->[0]->getUser( $req, %args );
return $req->data->{enabledMods1}->[0]->getUser( $req, %args );
}
sub setSessionInfo {
return $_[1]->datas->{enabledMods1}->[0]->setSessionInfo( $_[1] );
return $_[1]->data->{enabledMods1}->[0]->setSessionInfo( $_[1] );
}
sub setGroups {
$_[0]->checkChoice( $_[1] );
return $_[1]->datas->{enabledMods1}->[0]->setGroups( $_[1] );
return $_[1]->data->{enabledMods1}->[0]->setGroups( $_[1] );
}
1;

View File

@ -68,7 +68,7 @@ sub getUser {
eval { $self->p->_authentication->setSecurity($req) };
return PE_ERROR;
}
unless ( $req->datas->{entry} = $sth->fetchrow_hashref() ) {
unless ( $req->data->{entry} = $sth->fetchrow_hashref() ) {
$self->userLogger->warn("User $user not found");
eval { $self->p->_authentication->setSecurity($req) };
return PE_BADCREDENTIALS;
@ -84,8 +84,8 @@ sub setSessionInfo {
foreach my $var ( keys %{ $self->exportedVars } ) {
my $attr = $self->exportedVars->{$var};
$req->{sessionInfo}->{$var} = $req->datas->{entry}->{$attr}
if ( defined $req->datas->{entry}->{$attr} );
$req->{sessionInfo}->{$var} = $req->data->{entry}->{$attr}
if ( defined $req->data->{entry}->{$attr} );
}
PE_OK;
}

View File

@ -40,7 +40,7 @@ sub setSessionInfo {
my $v = $self->{vars}->{$k};
my $attr = $k;
my $required = ( $attr =~ s/^!// ) ? 1 : 0;
$req->{sessionInfo}->{$attr} = $req->datas->{_facebookDatas}->{$v};
$req->{sessionInfo}->{$attr} = $req->data->{_facebookData}->{$v};
if ( $required and not( defined $req->{sessionInfo}->{$attr} ) ) {
$self->logger->warn(
"Required parameter $v is not provided by Facebook server, aborted"

View File

@ -60,12 +60,12 @@ sub getUser {
eval { $self->p->_authentication->setSecurity($req) };
return PE_BADCREDENTIALS;
}
unless ( $req->datas->{entry} = $mesg->entry(0) ) {
unless ( $req->data->{entry} = $mesg->entry(0) ) {
$self->userLogger->warn("$req->{user} was not found in LDAP directory");
eval { $self->p->_authentication->setSecurity($req) };
return PE_BADCREDENTIALS;
}
$req->datas->{dn} = $req->datas->{entry}->dn();
$req->data->{dn} = $req->data->{entry}->dn();
PE_OK;
}
@ -75,13 +75,13 @@ sub getUser {
# @return Lemonldap::NG::Portal constant
sub setSessionInfo {
my ( $self, $req ) = @_;
$req->{sessionInfo}->{_dn} = $req->datas->{dn};
$req->{sessionInfo}->{_dn} = $req->data->{dn};
my %vars = ( %{ $self->conf->{exportedVars} },
%{ $self->conf->{ldapExportedVars} } );
while ( my ( $k, $v ) = each %vars ) {
$req->sessionInfo->{$k} =
$self->ldap->getLdapValue( $req->datas->{entry}, $v ) || "";
$self->ldap->getLdapValue( $req->data->{entry}, $v ) || "";
}
PE_OK;
@ -97,7 +97,7 @@ sub setGroups {
if ( $self->conf->{ldapGroupBase} ) {
# Get value for group search
my $group_value = $self->ldap->getLdapValue( $req->datas->{entry},
my $group_value = $self->ldap->getLdapValue( $req->data->{entry},
$self->conf->{ldapGroupAttributeNameUser} );
$self->logger->debug( "Searching LDAP groups in "

View File

@ -23,9 +23,9 @@ sub init {
sub getUser {
my ( $self, $req ) = @_;
my $op = $req->datas->{_oidcOPCurrent};
my $op = $req->data->{_oidcOPCurrent};
my $access_token = $req->datas->{access_token};
my $access_token = $req->data->{access_token};
my $userinfo_content = $self->getUserInfo( $op, $access_token );
@ -36,11 +36,11 @@ sub getUser {
$self->logger->debug("UserInfo received: $userinfo_content");
$req->datas->{OpenIDConnect_user_info} =
$req->data->{OpenIDConnect_user_info} =
$self->decodeJSON($userinfo_content);
# Check that received sub is the same than current user
unless ( $req->datas->{OpenIDConnect_user_info}->{sub} eq $req->{user} ) {
unless ( $req->data->{OpenIDConnect_user_info}->{sub} eq $req->{user} ) {
$self->logger->error("Received sub do not match current user");
return PE_BADCREDENTIALS;
}
@ -51,7 +51,7 @@ sub getUser {
# Get all required attributes
sub setSessionInfo {
my ( $self, $req ) = @_;
my $op = $req->datas->{_oidcOPCurrent};
my $op = $req->data->{_oidcOPCurrent};
my %vars = (
%{ $self->conf->{exportedVars} },
@ -59,7 +59,7 @@ sub setSessionInfo {
);
while ( my ( $k, $v ) = each %vars ) {
$req->{sessionInfo}->{$k} = $req->datas->{OpenIDConnect_user_info}->{$v}
$req->{sessionInfo}->{$k} = $req->data->{OpenIDConnect_user_info}->{$v}
|| "";
}

View File

@ -48,14 +48,14 @@ sub getUser {
$self->userLogger->warn( 'User ' . $req->user . ' not found' );
return PE_USERNOTFOUND;
}
$req->datas->{restUserDBInfo} = $res->{info} || {};
$req->data->{restUserDBInfo} = $res->{info} || {};
return PE_OK;
}
sub setSessionInfo {
my ( $self, $req ) = @_;
$req->sessionInfo->{$_} = $req->datas->{restUserDBInfo}->{$_}
foreach ( keys %{ $req->datas->{restUserDBInfo} } );
$req->sessionInfo->{$_} = $req->data->{restUserDBInfo}->{$_}
foreach ( keys %{ $req->data->{restUserDBInfo} } );
PE_OK;
}

Some files were not shown because too many files have changed in this diff Show More