Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
8bedc51f
Commit
8bedc51f
authored
5 years ago
by
Wolfgang Knopki
Browse files
Options
Download
Email Patches
Plain Diff
cleanup merge
parent
7b175bf4
master
MLAB-677
devel
devel_wolfgang
patch-1
reset-jul13
reset-merge
test_logoutbutton
testing
1 merge request
!2
Mlab 56
Pipeline
#558
passed with stage
in 18 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
routes/routes-account.js
+3
-165
routes/routes-account.js
routes/routes-project.js
+3
-3
routes/routes-project.js
with
6 additions
and
168 deletions
+6
-168
routes/routes-account.js
+
3
-
165
View file @
8bedc51f
...
...
@@ -9,7 +9,7 @@ const salt = 64; // salt length
// forgot pwd
const
async
=
require
(
'
async
'
)
const
crypto
=
require
(
'
crypto
'
)
const
nodemailer
=
require
(
'
node
mailer
'
)
const
nodemailer
=
require
(
'
./
mailer
'
)
module
.
exports
=
function
(
app
,
config
,
passport
,
i18n
)
{
...
...
@@ -75,27 +75,6 @@ module.exports = function (app, config, passport, i18n) {
}
);
// ======== NODEMAILER ====================
var
smtpTransport
=
nodemailer
.
createTransport
({
host
:
config
.
mailer
.
host
,
secureConnection
:
config
.
mailer
.
secureConnection
,
port
:
config
.
mailer
.
port
,
auth
:
{
user
:
config
.
mailer
.
authUser
,
pass
:
config
.
mailer
.
authPass
},
tls
:
{
ciphers
:
config
.
mailer
.
tlsCiphers
}
});
var
mailOptions
=
{
to
:
""
,
from
:
config
.
mailer
.
from
,
subject
:
""
,
text
:
""
};
var
updatePasswordMailSubject
=
"
Ihr Passwort für das Transferportal wurde gespeichert.
"
var
mailSignature
=
"
Mit den besten Grüßen,
\n
das Transferportal-Team der HFT Stuttgart
\n\n
"
+
"
Transferportal der Hochschule für Technik Stuttgart
\n
"
+
...
...
@@ -274,7 +253,7 @@ module.exports = function (app, config, passport, i18n) {
else
{
req
.
flash
(
'
success
'
,
'
Profile updated!
'
);
}
res
.
redirect
(
'
lang+
/account/profile
'
);
res
.
redirect
(
'
/account/profile
'
);
})
}
}
else
{
...
...
@@ -313,7 +292,7 @@ module.exports = function (app, config, passport, i18n) {
else
{
if
(
newPwd
!=
retypePwd
)
{
req
.
flash
(
'
error
'
,
"
Passwords do no match. Please make sure you re-type your new password correctly.
"
)
res
.
redirect
(
lang
+
'
/account/security
'
)
res
.
redirect
(
'
/account/security
'
)
}
else
{
// update password
...
...
@@ -551,146 +530,5 @@ module.exports = function (app, config, passport, i18n) {
}
})
})
app
.
get
(
'
/mailinglists
'
,
function
(
req
,
res
)
{
async
.
waterfall
([
function
(
done
)
{
methods
.
getAllMailinglists
(
function
(
mailinglistOverview
,
err
)
{
if
(
!
err
)
{
done
(
err
,
mailinglistOverview
)
}
})
},
// create JSON object of mailinglists for front-end
function
(
mailinglistOverview
,
done
)
{
var
allMailingLists
=
[]
// JSON object
for
(
let
i
=
0
;
i
<
mailinglistOverview
.
length
;
i
++
)
{
// add data to JSON object
allMailingLists
.
push
({
id
:
mailinglistOverview
[
i
].
id
,
name
:
mailinglistOverview
[
i
].
name
,
src
:
mailinglistOverview
[
i
].
src
,
projectstatus
:
mailinglistOverview
[
i
].
projectstatus
,
project_title
:
mailinglistOverview
[
i
].
project_title
});
}
res
.
render
(
lang
+
'
/mailinglists
'
,
{
isUserAuthenticated
:
req
.
isAuthenticated
(),
user
:
req
.
user
,
mailinglists
:
allMailingLists
});
}
])
});
// ======== APP ROUTES - PROJECT ====================
app
.
get
(
'
/project
'
,
function
(
req
,
res
)
{
async
.
waterfall
([
// get all projects from projectdb
function
(
done
)
{
methods
.
getAllProjects
(
function
(
projectsOverview
,
err
)
{
if
(
!
err
)
{
done
(
err
,
projectsOverview
)
}
})
},
// create JSON object for front-end
function
(
projectsOverview
,
done
)
{
var
activeProjects
=
[]
var
nonActiveProjects
=
[]
for
(
var
i
=
0
;
i
<
projectsOverview
.
length
;
i
++
)
{
var
project
=
{
id
:
projectsOverview
[
i
].
id
,
logo
:
projectsOverview
[
i
].
logo
,
akronym
:
projectsOverview
[
i
].
pname
,
title
:
projectsOverview
[
i
].
title
,
summary
:
projectsOverview
[
i
].
onelinesummary
,
category
:
projectsOverview
[
i
].
category
,
cp
:
projectsOverview
[
i
].
contact_email
,
gitlab
:
projectsOverview
[
i
].
gitlab
}
if
(
projectsOverview
[
i
].
projectstatus
==
0
)
{
nonActiveProjects
.
push
(
project
)
}
else
if
(
projectsOverview
[
i
].
projectstatus
==
1
)
{
activeProjects
.
push
(
project
)
}
}
// render the page
if
(
req
.
isAuthenticated
())
{
res
.
render
(
lang
+
'
/project/projects
'
,
{
isUserAuthenticated
:
true
,
nonActive
:
nonActiveProjects
,
active
:
activeProjects
});
}
else
{
res
.
render
(
lang
+
'
/project/projects
'
,
{
isUserAuthenticated
:
false
,
nonActive
:
nonActiveProjects
,
active
:
activeProjects
});
}
}
])
})
app
.
get
(
'
/addprojectoverview
'
,
function
(
req
,
res
)
{
if
(
req
.
isAuthenticated
())
{
res
.
render
(
lang
+
'
/project/addProjectOverview
'
)
}
else
{
res
.
redirect
(
'
/account/login
'
)
}
})
app
.
post
(
'
/addprojectoverview
'
,
function
(
req
,
res
)
{
if
(
req
.
isAuthenticated
())
{
var
wiki
=
0
if
(
req
.
body
.
wiki
)
wiki
=
1
var
projectOverviewData
=
{
pname
:
req
.
body
.
pname
,
title
:
req
.
body
.
title
,
onelinesummary
:
req
.
body
.
summary
,
category
:
req
.
body
.
category
,
logo
:
req
.
body
.
logo
,
gitlab
:
req
.
body
.
gitlabURL
,
wiki
:
wiki
,
overview
:
req
.
body
.
overview
,
question
:
req
.
body
.
question
,
approach
:
req
.
body
.
approach
,
result
:
req
.
body
.
result
,
keywords
:
req
.
body
.
keywords
,
announcement
:
req
.
body
.
announcement
,
term
:
req
.
body
.
term
,
further_details
:
req
.
body
.
furtherDetails
,
website
:
req
.
body
.
website
,
src
:
req
.
body
.
src
,
caption
:
req
.
body
.
caption
,
contact_firstname
:
req
.
body
.
contactFirstname
,
contact_lastname
:
req
.
body
.
contactLastname
,
contact_email
:
req
.
body
.
contactEmail
,
leader_firstname
:
req
.
body
.
leaderFirstname
,
leader_lastname
:
req
.
body
.
leaderLastname
,
leader_email
:
req
.
body
.
leaderEmail
}
methods
.
addProjectOverview
(
projectOverviewData
,
function
(
err
){
if
(
err
)
{
//req.flash('error', "Failed")
req
.
flash
(
'
error
'
,
"
Fehlgeschlagen
"
)
res
.
redirect
(
'
/account/addProjectOverview
'
);
}
else
{
req
.
flash
(
'
success
'
,
'
Your project has been created.
'
)
res
.
redirect
(
'
/account/project
'
);
}
})
}
})
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
routes/routes-project.js
+
3
-
3
View file @
8bedc51f
...
...
@@ -100,7 +100,7 @@ module.exports = function (app) {
}
})
app
.
post
(
'
/addprojectoverview
'
,
function
(
req
,
res
)
{
app
.
post
(
'
/addprojectoverview
__
'
,
function
(
req
,
res
)
{
if
(
req
.
isAuthenticated
())
{
var
wiki
=
0
if
(
req
.
body
.
wiki
)
...
...
@@ -136,7 +136,7 @@ module.exports = function (app) {
if
(
err
)
{
//req.flash('error', "Failed")
req
.
flash
(
'
error
'
,
"
Fehlgeschlagen
"
)
res
.
redirect
(
'
/addProjectOverview
'
);
res
.
redirect
(
'
/
account/
addProjectOverview
'
);
}
else
{
req
.
flash
(
'
success
'
,
'
Your project has been created.
'
)
...
...
@@ -211,7 +211,7 @@ module.exports = function (app) {
if
(
err
)
{
//req.flash('error', "Failed")
req
.
flash
(
'
error
'
,
"
Fehlgeschlagen
"
)
res
.
redirect
(
'
/addProjectOverview
'
);
res
.
redirect
(
'
/
account/
addProjectOverview
'
);
}
else
{
req
.
flash
(
'
success
'
,
'
Your project has been created.
'
)
...
...
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
Menu
Explore
Projects
Groups
Snippets