Commit 2c9c8f72 authored by FX Deltombe's avatar FX Deltombe
Browse files

Checkbox 'check logins' working through SAML authentication (Lemonldap-439)

parent 9987e1fc
......@@ -60,23 +60,36 @@
</div></td></tr>
</TMPL_LOOP>
<tr>
<td><input type="checkbox" id="remember" name="cookie_type" value="1"><label for="remember"><lang en="Remember my choice" fr="Se souvenir de mon choix"/></label></td>
</tr>
</table>
<tr><td>
<input type="checkbox" id="remember" name="cookie_type" value="1">
<label for="remember"><lang en="Remember my choice" fr="Se souvenir de mon choix"/></label>
</td></tr>
<TMPL_ELSE>
<div class="panel-buttons">
<table style="margin: 0px auto">
<tr><td><div class="panel-buttons">
<button type="submit" class="negative" tabindex="4" onclick="$('#confirm').attr('value','-<TMPL_VAR NAME="CONFIRMKEY">');">
<lang en="Refuse" fr="Refuser" />
</button>
<button type="submit" class="positive" tabindex="3">
<lang en="Accept" fr="Accepter" />
</button>
</div>
</div></td></tr>
</TMPL_IF>
<TMPL_IF NAME="CHECK_LOGINS">
<tr><td>
<input type="checkbox" id="checkLogins" name="checkLogins" <TMPL_IF NAME="ASK_LOGINS">checked</TMPL_IF>/>
<label for="checkLogins">
<lang en="Check my last logins" fr="Voir mes dernières connexions"/>
</label>
</td></tr>
</TMPL_IF>
</table>
</form>
</div>
</div>
......
......@@ -35,9 +35,7 @@
</TMPL_LOOP>
<tr>
<td><input type="checkbox" id="remember" name="cookie_type" value="1"><label for="remember"><lang en="Remember my choice" fr="Se souvenir de mon choix"/></label></td>
</tr>
</table>
<td><input type="checkbox" id="remember" name="cookie_type" value="1"><label for="remember"><lang en="Remember my choice" fr="Se souvenir de mon choix"/></label>
<TMPL_ELSE>
......@@ -62,7 +60,7 @@
</script>
</TMPL_IF>
<table><tbody><tr><td>
<table><tr><td>
<div class="buttons">
<button type="submit" class="positive">
<img src="<TMPL_VAR NAME="SKIN_PATH">/common/accept.png" alt="" />
......@@ -73,9 +71,19 @@
<lang en="Refuse" fr="Refuser" />
</button>
</div>
</td></tr></tbody></table>
</TMPL_IF>
<TMPL_IF NAME="CHECK_LOGINS">
<div class="buttons">
<input type="checkbox" id="checkLogins" name="checkLogins" <TMPL_IF NAME="ASK_LOGINS">checked</TMPL_IF>/>
<label for="checkLogins">
<lang en="Check my last logins" fr="Voir mes dernières connexions"/>
</label>
</div>
</TMPL_IF>
</td></tr></table>
</form>
</div>
......
......@@ -798,6 +798,7 @@ sub extractFormInfo {
-expires => '-1d',
);
$self->{login} = 1;
return PE_CONFIRM;
}
......@@ -824,6 +825,7 @@ sub extractFormInfo {
$self->info($html);
$self->{login} = 1;
return PE_CONFIRM;
}
......
......@@ -141,6 +141,8 @@ sub display {
FORM_METHOD => $self->{confirmFormMethod},
CHOICE_PARAM => $self->{authChoiceParam},
CHOICE_VALUE => $self->{_authChoice},
CHECK_LOGINS => $self->{portalCheckLogins} && $self->{login},
ASK_LOGINS => $self->{checkLogins},
CONFIRMKEY => $self->stamp(),
LIST => $self->{list} || [],
);
......@@ -191,7 +193,7 @@ sub display {
LOGIN => $self->get_user,
AUTOCOMPLETE => $self->{portalAutocomplete},
CHECK_LOGINS => $self->{portalCheckLogins},
ASK_LOGINS => $self->param("checkLogins"),
ASK_LOGINS => $self->{checkLogins},
DISPLAY_RESETPASSWORD => $self->{portalDisplayResetPassword},
DISPLAY_FORM => 1,
MAIL_URL => $self->{mailUrl},
......
......@@ -1841,9 +1841,17 @@ sub existingSession {
# issuerForUnAuthUser(): must be implemented in IssuerDB* module
# extractFormInfo(): must be implemented in Auth* module
# * set $self->{user}
# * authenticate user if possible (or do it in authenticate())
##@apmethod int extractFormInfo()
# Extract data common to all authentication modules,
# and call extractFormInfo() in Auth* module
# Auth*::extractFormInfo set $self->{user} and in some cases
# authenticate user (done in authenticate() else)
#@return Lemonldap::NG::Portal constant
sub extractFormInfo {
my $self = shift;
$self->{checkLogins} = $self->param('checkLogins');
return $self->SUPER::extractFormInfo;
}
# getUser(): must be implemented in UserDB* module
......@@ -2160,7 +2168,7 @@ sub removeOther {
)
: ""
)
) if ( $self->param("checkLogins") );
) if ( $self->{checkLogins} );
PE_OK;
}
......
......@@ -793,7 +793,7 @@ sub createAuthnRequest {
# Set RelayState
my $infos;
foreach (qw /urldc/) {
foreach (qw /urldc checkLogins/) {
$infos->{$_} = $self->{$_} if $self->{$_};
}
my $relaystate = $self->storeRelayState($infos);
......@@ -1360,7 +1360,7 @@ sub createLogoutRequest {
# Set RelayState
my $infos;
foreach (qw /urldc/) {
foreach (qw /urldc checkLogins/) {
$infos->{$_} = $self->{$_} if $self->{$_};
}
my $relaystate = $self->storeRelayState($infos);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment