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
5fca2db9
authored
Jan 05, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'develop' of
http://scm.ujaen.es/softuno/pictogram
into develop
parents
d50d976a
812f0a28
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
sails/src/api/controllers/StudentController.js
sails/src/assets/app/i18n/en-gb.json
sails/src/assets/app/i18n/es-es.json
sails/src/assets/scripts/modules/login/controllers/login_setting_password.js
sails/src/api/controllers/StudentController.js
View file @
5fca2db9
...
@@ -62,18 +62,18 @@ module.exports = {
...
@@ -62,18 +62,18 @@ module.exports = {
student
.
isStudent
=
true
;
student
.
isStudent
=
true
;
if
(
!
student
.
license
||
!
student
.
license
[
0
])
{
if
(
!
student
.
license
||
!
student
.
license
[
0
])
{
sails
.
log
.
error
(
`Tried to login with non valid license
${
req
.
body
.
username
}
`
);
sails
.
log
.
error
(
`Tried to login with non valid license
${
req
.
body
.
username
}
`
);
}
else
res
.
unauthorized
(
"Student has an invalid license"
);
}
else
{
var
hasExpired
=
student
.
license
[
0
].
hasExpired
();
student
=
student
.
toObject
();
// to enable overwrite license field
student
=
student
.
toObject
();
// to enable overwrite license field
student
.
license
=
student
.
license
[
0
];
student
.
license
=
student
.
license
[
0
];
if
(
student
.
license
[
0
].
hasExpired
())
student
.
license
.
expired
=
hasExpired
;
student
.
license
.
expired
=
true
;
else
student
.
license
.
expired
=
false
;
return
res
.
ok
({
return
res
.
ok
({
user
:
student
,
user
:
student
,
token
:
sailsTokenAuth
.
issueToken
(
student
,
sails
.
config
.
jwt
.
expiresInMinutes
),
token
:
sailsTokenAuth
.
issueToken
(
student
,
sails
.
config
.
jwt
.
expiresInMinutes
),
server_time
:
(
new
Date
()).
getTime
()
server_time
:
(
new
Date
()).
getTime
()
});
});
}
}
else
{
}
else
{
sails
.
log
.
error
(
`Invalid student login: user
${
student
.
username
}
, password\
sails
.
log
.
error
(
`Invalid student login: user
${
student
.
username
}
, password\
"
${
req
.
body
.
password
}
"`
);
"
${
req
.
body
.
password
}
"`
);
...
@@ -84,8 +84,8 @@ module.exports = {
...
@@ -84,8 +84,8 @@ module.exports = {
res
.
notFound
(
"Student not found"
);
res
.
notFound
(
"Student not found"
);
}
}
})
})
.
catch
(
function
()
{
.
catch
(
function
(
err
)
{
sails
.
log
.
error
(
`Error getting student
${
req
.
body
.
username
}
for login
`
);
sails
.
log
.
error
(
`Error getting student
${
req
.
body
.
username
}
for login
: `
+
err
);
res
.
serverError
(
"Error when connecting to database"
);
res
.
serverError
(
"Error when connecting to database"
);
});
});
},
},
...
...
sails/src/assets/app/i18n/en-gb.json
View file @
5fca2db9
...
@@ -99,6 +99,7 @@
...
@@ -99,6 +99,7 @@
"error_fetching_students"
:
"Error when loading students"
,
"error_fetching_students"
:
"Error when loading students"
,
"error_only_support_images"
:
"Only images are supported (JPG, PNG or GIF files)"
,
"error_only_support_images"
:
"Only images are supported (JPG, PNG or GIF files)"
,
"error_on_request"
:
"The request has not been processed. Please, check your fields"
,
"error_on_request"
:
"The request has not been processed. Please, check your fields"
,
"error_on_request_sup_not_found"
:
"Account not found or it has not been activated"
,
"error_loading_pictos"
:
"Error loading pictos information"
,
"error_loading_pictos"
:
"Error loading pictos information"
,
"error_general"
:
"An error has been produced"
,
"error_general"
:
"An error has been produced"
,
"expand_navigation"
:
"Expand navigation"
,
"expand_navigation"
:
"Expand navigation"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
5fca2db9
...
@@ -102,6 +102,7 @@
...
@@ -102,6 +102,7 @@
"error_fetching_students"
:
"Error al cargar estudiantes"
,
"error_fetching_students"
:
"Error al cargar estudiantes"
,
"error_only_support_images"
:
"Sólo se soportan imágenes (ficheros JPG, PNG o GIF)"
,
"error_only_support_images"
:
"Sólo se soportan imágenes (ficheros JPG, PNG o GIF)"
,
"error_on_request"
:
"Se ha producido un error. Por favor, compruebe los valores introducidos."
,
"error_on_request"
:
"Se ha producido un error. Por favor, compruebe los valores introducidos."
,
"error_on_request_sup_not_found"
:
"La cuenta no existe o no ha sido activada"
,
"error_loading_pictos"
:
"Error cargando información de los pictos"
,
"error_loading_pictos"
:
"Error cargando información de los pictos"
,
"error_general"
:
"Se ha producido un error"
,
"error_general"
:
"Se ha producido un error"
,
"February"
:
"Febrero"
,
"February"
:
"Febrero"
,
...
...
sails/src/assets/scripts/modules/login/controllers/login_setting_password.js
View file @
5fca2db9
...
@@ -49,7 +49,12 @@ dashboardControllers.controller('LoginSettingPasswordCtrl', function LoginSettin
...
@@ -49,7 +49,12 @@ dashboardControllers.controller('LoginSettingPasswordCtrl', function LoginSettin
})
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
$scope
.
reset
();
$scope
.
reset
();
ngToast
.
danger
({
content
:
$translate
.
instant
(
'error_on_request'
)
});
console
.
log
(
data
);
console
.
log
(
data
.
search
(
"not found"
));
if
(
data
.
search
(
"not found"
)
>
0
)
ngToast
.
danger
({
content
:
$translate
.
instant
(
'error_on_request_sup_not_found'
)
});
else
ngToast
.
danger
({
content
:
$translate
.
instant
(
'error_on_request'
)
});
});
});
}
}
};
};
...
...
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