Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8eb61060
authored
Aug 14, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update of user data after submission
parent
c2fb874a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
sails/src/assets/scripts/modules/login/controllers/login.js
sails/src/assets/scripts/modules/supervisor/controllers/supervisor.js
sails/src/assets/scripts/modules/login/controllers/login.js
View file @
8eb61060
...
...
@@ -68,6 +68,7 @@ function LoginCtrl(
if
(
data
.
user
.
lang
===
'en-us'
)
data
.
user
.
lang
=
'en-gb'
;
$scope
.
lang
=
data
.
user
.
lang
;
;
$translate
.
use
(
$scope
.
lang
);
}
else
{
$translate
.
use
(
$scope
.
lang
);
...
...
@@ -76,7 +77,9 @@ function LoginCtrl(
// user is in the scope of the MainCtrl
$scope
.
user
=
JSON
.
parse
(
JSON
.
stringify
(
data
.
user
));
$scope
.
user
.
name
=
$scope
.
user
.
name
||
$translate
.
instant
(
'name'
);
$scope
.
user
.
surname
=
$scope
.
user
.
surname
||
$translate
.
instant
(
'surname'
);
$window
.
sessionStorage
.
user
=
JSON
.
stringify
(
data
.
user
);
$location
.
path
(
'/students'
);
})
...
...
sails/src/assets/scripts/modules/supervisor/controllers/supervisor.js
View file @
8eb61060
...
...
@@ -20,21 +20,6 @@ dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl(
if
(
!
$window
.
sessionStorage
.
user
)
return
$scope
.
logout
();
var
user
=
JSON
.
parse
(
$window
.
sessionStorage
.
user
);
// Assign values this way (like an object) to ensure it's the parent scope
$scope
.
user
.
id
=
user
.
id
;
$scope
.
user
.
role
=
user
.
role
;
$scope
.
user
.
name
=
user
.
name
||
$translate
.
instant
(
'name'
);
$scope
.
user
.
surname
=
user
.
surname
||
$translate
.
instant
(
'surname'
);
$scope
.
user
.
pic
=
user
.
pic
;
$scope
.
user
.
lang
=
user
.
lang
;
$scope
.
user
.
isOffice
=
user
.
isOffice
;
$scope
.
user
.
isTutor
=
user
.
isTutor
;
$scope
.
user
.
isAdmin
=
user
.
isAdmin
;
$scope
.
user
.
isTherapist
=
user
.
isTherapist
;
$scope
.
user
.
arasaacLicense
=
user
.
arasaacLicense
;
// Link to setup
$scope
.
setup
=
function
(){
$location
.
path
(
'/setup'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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