Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Administrator
m4lab_landing_page
Commits
c4ac2316
Commit
c4ac2316
authored
5 years ago
by
Wolfgang Knopki
Browse files
Options
Download
Email Patches
Plain Diff
set login button according to SAML status
parent
ff996215
Pipeline
#360
passed with stage
in 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/headfoot.js
+6
-2
js/headfoot.js
with
6 additions
and
2 deletions
+6
-2
js/headfoot.js
+
6
-
2
View file @
c4ac2316
...
@@ -14,7 +14,7 @@ function userAuthenticated(){
...
@@ -14,7 +14,7 @@ function userAuthenticated(){
let
params
=
new
URLSearchParams
(
window
.
location
.
search
);
let
params
=
new
URLSearchParams
(
window
.
location
.
search
);
if
(
params
.
get
(
'
isAuthenticatedUser
'
)){
if
(
params
.
get
(
'
isAuthenticatedUser
'
)){
return
true
;
return
true
;
}
else
if
(
document
.
getElementById
(
'
loginswitch
'
)){
}
else
if
(
document
.
getElementById
(
'
loginswitch
'
)){
//relikt login via OAuth
if
(
document
.
getElementById
(
'
loginswitch
'
).
getAttribute
(
'
authenticated
'
)
==
'
1
'
){
if
(
document
.
getElementById
(
'
loginswitch
'
).
getAttribute
(
'
authenticated
'
)
==
'
1
'
){
return
true
;
return
true
;
}
}
...
@@ -111,7 +111,7 @@ function head(){
...
@@ -111,7 +111,7 @@ function head(){
for
(
let
k
=
0
;
k
<
menu
[
j
].
combos
.
length
;
k
++
){
for
(
let
k
=
0
;
k
<
menu
[
j
].
combos
.
length
;
k
++
){
let
combolink
=
document
.
createElement
(
'
a
'
);
let
combolink
=
document
.
createElement
(
'
a
'
);
combolink
.
classList
.
add
(
"
dropdown-item
"
);
combolink
.
classList
.
add
(
"
dropdown-item
"
);
if
(
userAuthenticated
()
){
if
(
userAuthenticated
()
||
user
){
//either logged in the old way or logged in using SAML
if
(
menu
[
j
].
combos
[
k
].
link
.
includes
(
'
?
'
)){
if
(
menu
[
j
].
combos
[
k
].
link
.
includes
(
'
?
'
)){
combolink
.
href
=
menu
[
j
].
combos
[
k
].
link
+
"
&isAuthenticatedUser=true
"
;
combolink
.
href
=
menu
[
j
].
combos
[
k
].
link
+
"
&isAuthenticatedUser=true
"
;
}
else
{
}
else
{
...
@@ -129,6 +129,10 @@ function head(){
...
@@ -129,6 +129,10 @@ function head(){
headlink
.
innerHTML
=
"
Account
"
;
headlink
.
innerHTML
=
"
Account
"
;
headlink
.
href
=
"
/account/
"
;
headlink
.
href
=
"
/account/
"
;
}
}
if
(
user
){
//user has priority
headlink
.
innerHTML
=
"
Logout
"
;
headlink
.
href
=
"
/account/logout
"
;
}
headlink
.
classList
.
remove
(
"
nav-link
"
);
headlink
.
classList
.
remove
(
"
nav-link
"
);
headlink
.
classList
.
add
(
"
btn
"
);
headlink
.
classList
.
add
(
"
btn
"
);
headlink
.
classList
.
add
(
"
btn-outline-dark
"
);
headlink
.
classList
.
add
(
"
btn-outline-dark
"
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment