Display FavApps tab by default if required (#1689)

This commit is contained in:
Christophe Maudoux 2019-04-28 20:39:05 +02:00
parent 12e96a3056
commit e9fd5815c9
1 changed files with 8 additions and 8 deletions

View File

@ -67,6 +67,10 @@ sub params {
(qw/favApps appslist password logout loginHistory oidcConsents/);
my @customTabs = split( /,\s*/, $self->{conf}->{customMenuTabs} || '' );
$res{DISPLAY_MODULES} = $self->displayModules($req);
$res{AUTH_ERROR_TYPE} =
$req->error_type( $res{AUTH_ERROR} = $req->menuError );
# Tab to display
# Get the tab URL parameter
@ -106,14 +110,10 @@ sub params {
$res{DISPLAY_TAB} = $req->param("tab");
}
else {
$res{DISPLAY_TAB} = "appslist";
$res{DISPLAY_TAB} = $res{DISPLAY_MODULES}->[0]->{FavApps} ? "favApps" : "appslist";
}
}
$res{DISPLAY_MODULES} = $self->displayModules($req);
$res{AUTH_ERROR_TYPE} =
$req->error_type( $res{AUTH_ERROR} = $req->menuError );
# Display menu 2fRegisters link only if at least a 2F device is registered
$res{sfaManager} =
$self->p->_sfEngine->display2fRegisters( $req, $req->userData );
@ -368,11 +368,11 @@ sub _filterHash {
}
# Check if app is marked as favorite
my $appuri = $apphash->{$key}->{options}->{uri};
my $uri = $apphash->{$key}->{options}->{uri};
foreach (@$favAppslistRef) {
if ( $_->{appuri} eq $appuri ) {
if ( $_->{appuri} eq $uri ) {
$apphash->{$key}->{options}->{isFavApp} = "1";
$self->logger->debug("App $appuri is marked as favorite");
$self->logger->debug("App $uri is marked as favorite");
last;
}
}