Node.js based forum software built for the modern web
committing hotfix to registration
Julian Lam7f77ec2c5f35
diff --git a/public/css/style.less b/public/css/style.lessindex 8447be7b1a..6225e3d571 100644--- a/public/css/style.less+++ b/public/css/style.less@@ -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;diff --git a/public/templates/header.tpl b/public/templates/header.tplindex 8e9ca1b19a..2b95d4fe18 100644--- a/public/templates/header.tpl+++ b/public/templates/header.tpl@@ -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>diff --git a/src/user.js b/src/user.jsindex 008e93838c..06f18e2431 100644--- a/src/user.js+++ b/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 });-- // 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);-- // 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);- });+ 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';++ 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);+ });+ }}User.addFriend = function(uid, friendid, callback) {diff --git a/src/webserver.js b/src/webserver.jsindex 4f3a25f606..1b468c6476 100644--- a/src/webserver.js+++ b/src/webserver.js@@ -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]));}