mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 14:36:40 +02:00
committing hotfix to registration
This commit is contained in:
@@ -638,7 +638,7 @@ footer.footer {
|
||||
.category-row h4 {
|
||||
font-weight: 700;
|
||||
text-align: left;
|
||||
color: #555;
|
||||
/*color: #555;*/
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<meta name="title" CONTENT="NodeBB">
|
||||
<meta name="description" content="Node.js/Redis/Socket.io powered forums for a new generation">
|
||||
<link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
||||
<!-- <link href="{cssSrc}" rel="stylesheet" media="screen"> -->
|
||||
<link href="/vendor/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
|
||||
<link rel="stylesheet" href="/vendor/fontawesome/css/font-awesome.min.css">
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
|
||||
|
||||
62
src/user.js
62
src/user.js
@@ -355,39 +355,41 @@ var utils = require('./../public/src/utils.js'),
|
||||
}
|
||||
|
||||
User.sendConfirmationEmail = function (email) {
|
||||
var confirm_code = utils.generateUUID(),
|
||||
confirm_link = config.url + 'confirm/' + confirm_code,
|
||||
confirm_email = global.templates['emails/header'] + global.templates['emails/email_confirm'].parse({'CONFIRM_LINK': confirm_link}) + global.templates['emails/footer'],
|
||||
confirm_email_plaintext = global.templates['emails/email_confirm_plaintext'].parse({ 'CONFIRM_LINK': confirm_link });
|
||||
if (global.config['email:host'] && global.config['email:port'] && global.config['email:from']) {
|
||||
var confirm_code = utils.generateUUID(),
|
||||
confirm_link = config.url + 'confirm/' + confirm_code,
|
||||
confirm_email = global.templates['emails/header'] + global.templates['emails/email_confirm'].parse({'CONFIRM_LINK': confirm_link}) + global.templates['emails/footer'],
|
||||
confirm_email_plaintext = global.templates['emails/email_confirm_plaintext'].parse({ 'CONFIRM_LINK': confirm_link });
|
||||
|
||||
// Email confirmation code
|
||||
var expiry_time = 60*60*2, // Expire after 2 hours
|
||||
email_key = 'email:' + email + ':confirm',
|
||||
confirm_key = 'confirm:' + confirm_code + ':email';
|
||||
// Email confirmation code
|
||||
var expiry_time = 60*60*2, // Expire after 2 hours
|
||||
email_key = 'email:' + email + ':confirm',
|
||||
confirm_key = 'confirm:' + confirm_code + ':email';
|
||||
|
||||
RDB.set(email_key, confirm_code);
|
||||
RDB.expire(email_key, expiry_time);
|
||||
RDB.set(confirm_key, email);
|
||||
RDB.expire(confirm_key, expiry_time);
|
||||
RDB.set(email_key, confirm_code);
|
||||
RDB.expire(email_key, expiry_time);
|
||||
RDB.set(confirm_key, email);
|
||||
RDB.expire(confirm_key, expiry_time);
|
||||
|
||||
// Send intro email w/ confirm code
|
||||
var message = emailjs.message.create({
|
||||
text: confirm_email_plaintext,
|
||||
from: config.mailer.from,
|
||||
to: email,
|
||||
subject: '[NodeBB] Registration Email Verification',
|
||||
attachment: [
|
||||
{
|
||||
data: confirm_email,
|
||||
alternative: true
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
emailjsServer.send(message, function(err, success) {
|
||||
if (err)
|
||||
console.log(err);
|
||||
});
|
||||
// Send intro email w/ confirm code
|
||||
var message = emailjs.message.create({
|
||||
text: confirm_email_plaintext,
|
||||
from: config.mailer.from,
|
||||
to: email,
|
||||
subject: '[NodeBB] Registration Email Verification',
|
||||
attachment: [
|
||||
{
|
||||
data: confirm_email,
|
||||
alternative: true
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
emailjsServer.send(message, function(err, success) {
|
||||
if (err)
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
User.addFriend = function(uid, friendid, callback) {
|
||||
|
||||
@@ -85,7 +85,10 @@ var express = require('express'),
|
||||
return;
|
||||
}
|
||||
|
||||
res.send(templates['header'] + app.create_route(route) + templates['footer']);
|
||||
res.send(
|
||||
templates['header'].parse({ cssSrc: global.config['theme:src'] || '/vendor/bootstrap/css/bootstrap.min.css' }) +
|
||||
app.create_route(route) + templates['footer']
|
||||
);
|
||||
});
|
||||
}(routes[i]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user