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
b5d0af59
authored
Apr 10, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
error with admin login fixed
parent
814c8e69
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
11 deletions
sails/src/api/controllers/AdminController.js
sails/src/api/controllers/StudentController.js
sails/src/api/services/mailService.js
sails/src/assets/arasaac
sails/src/assets/scripts/modules/translate/views/footer_translate.html
sails/src/api/controllers/AdminController.js
View file @
b5d0af59
...
...
@@ -2,11 +2,12 @@
* AdminController which manages the administration login and login
* @type {Object}
*/
const
bcrypt
=
require
(
'bcrypt-nodejs'
);
module
.
exports
=
{
// @TODO ¿?¿?
login
:
function
(
req
,
res
)
{
var
bcrypt
=
require
(
'bcrypt-nodejs'
);
var
email
=
req
.
body
.
email
;
var
password
=
req
.
body
.
password
;
...
...
@@ -15,7 +16,7 @@ module.exports = {
return
res
.
badRequest
(
'No credentials sent'
);
// Check email
admin
=
sails
.
config
.
pictogram
.
admins
.
find
((
a
)
=>
a
.
email
==
email
);
var
admin
=
sails
.
config
.
pictogram
.
admins
.
find
((
a
)
=>
a
.
email
==
email
);
if
(
typeof
admin
==
'undefined'
)
return
res
.
badRequest
(
'User not found'
);
...
...
@@ -27,15 +28,15 @@ module.exports = {
return
res
.
unauthorized
(
'Invalid password'
);
// credentials are valid, return token with max life span
delete
admin
.
password
;
var
returned_admin
=
(
JSON
.
parse
(
JSON
.
stringify
(
admin
)));
delete
returned_admin
.
password
;
return
res
.
ok
({
token
:
sailsTokenAuth
.
issueToken
({
'isAdmin'
:
true
,
'email'
:
email
},
sails
.
config
.
jwt
.
expiresInMinutes
),
user
:
admin
user
:
returned_
admin
});
});
},
// @TODO 357
logout
:
function
(
req
,
res
)
{
delete
req
.
token
;
res
.
ok
(
'Session closed'
);
...
...
sails/src/api/controllers/StudentController.js
View file @
b5d0af59
...
...
@@ -1169,6 +1169,7 @@ module.exports = {
}
student
.
pic
=
newAvatarFileName
;
delete
student
.
password
;
student
.
save
(
function
(
updateStudentError
)
{
if
(
updateStudentError
)
{
throw
updateStudentError
;
...
...
sails/src/api/services/mailService.js
View file @
b5d0af59
...
...
@@ -2,7 +2,7 @@ var mailerService = require('sails-service-mailer');
module
.
exports
.
mailer
=
function
()
{
return
mailerService
(
'sendmail'
,
{
from
:
'no-reply@
yottacode
.com'
,
from
:
'no-reply@
pictogramweb
.com'
,
subject
:
sails
.
__
(
'notification_from_pictogram'
),
provider
:
{
path
:
'/usr/sbin/sendmail'
...
...
sails/src/assets/arasaac
View file @
b5d0af59
/vagrant/arasaac
\ No newline at end of file
/home/ubuntu/pictogram/sails/arasaac
\ No newline at end of file
sails/src/assets/scripts/modules/translate/views/footer_translate.html
View file @
b5d0af59
...
...
@@ -11,12 +11,12 @@
</div>
<div
class=
"col-xs-4"
>
<div
class=
"languages-margin text-center text-muted"
>
Powered by
<a
href=
"http://www.
yottacode
.com"
><img
src=
"img/logo_pictogram.png"
width=
"40px"
alt=
"Pictogram"
title=
"Pictogram"
/></a>
Powered by
<a
href=
"http://www.
pictogramweb
.com"
><img
src=
"img/logo_pictogram.png"
width=
"40px"
alt=
"Pictogram"
title=
"Pictogram"
/></a>
</div>
</div>
<div
class=
"col-xs-4"
>
<div
class=
"languages-margin text-right text-muted"
>
<a
href=
"mailto:soporte@
yottacode
.com"
translate
>
support
</a>
|
<a
href=
"mailto:soporte@
pictogramweb
.com"
translate
>
support
</a>
|
<a
href=
'/app/#/disclaimer'
target=
'_blank'
translate
>
disclaimer
</a>
</div>
</div>
...
...
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