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
1f23ea54
Commit
1f23ea54
authored
5 years ago
by
Wolfgang Knopki
Browse files
Options
Download
Email Patches
Plain Diff
user profile fetch
parent
909224be
Pipeline
#366
passed with stage
in 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/headfoot.js
+21
-6
js/headfoot.js
with
21 additions
and
6 deletions
+21
-6
js/headfoot.js
+
21
-
6
View file @
1f23ea54
...
@@ -23,6 +23,26 @@ function userAuthenticated(){
...
@@ -23,6 +23,26 @@ function userAuthenticated(){
}
}
}
}
var
user
=
false
;
function
profileExists
(){
$
.
get
(
"
/api/v1/profile
"
,
function
(
data
)
{
let
email
=
data
.
email
if
(
email
!=
''
){
user
=
true
;
}
})
.
done
(
function
()
{
console
.
log
(
"
done fetching profile info
"
);
})
.
fail
(
function
()
{
console
.
log
(
"
error fetching profile info
"
);
})
return
user
;
}
function
readCookie
(
cname
)
{
function
readCookie
(
cname
)
{
var
name
=
cname
+
"
=
"
;
var
name
=
cname
+
"
=
"
;
...
@@ -129,12 +149,7 @@ function head(){
...
@@ -129,12 +149,7 @@ function head(){
headlink
.
innerHTML
=
"
Account
"
;
headlink
.
innerHTML
=
"
Account
"
;
headlink
.
href
=
"
/account/
"
;
headlink
.
href
=
"
/account/
"
;
}
}
if
(
typeof
user
!==
'
undefined
'
&&
user
){
if
(
profileExists
()){
//user has priority
console
.
log
(
user
)
}
else
{
console
.
log
(
"
user not defined
"
)
}
if
(
typeof
user
!==
'
undefined
'
&&
user
){
//user has priority
headlink
.
innerHTML
=
"
Logout
"
;
headlink
.
innerHTML
=
"
Logout
"
;
headlink
.
href
=
"
/account/logout
"
;
headlink
.
href
=
"
/account/logout
"
;
}
}
...
...
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