mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-19 21:40:27 +02:00
Merge branch 'master' of https://github.com/designcreateplay/NodeBB
This commit is contained in:
33
README.md
33
README.md
@@ -38,38 +38,7 @@ NodeBB requires the following software to be installed:
|
||||
|
||||
## Installation
|
||||
|
||||
First, we install our base software stack:
|
||||
|
||||
# apt-get install git nodejs redis-server build-essential imagemagick
|
||||
|
||||
If you want to use MongoDB instead of Redis install it from http://www.mongodb.org/downloads and remove 'redis-server' from the above command. [MongoDB-Setup](https://github.com/designcreateplay/NodeBB/wiki/Installing-NodeBB-With-MongoDB)
|
||||
|
||||
**If your package manager only installed a version of Node.js that is less than 0.8 (e.g. Ubuntu 12.10, 13.04):**
|
||||
|
||||
# add-apt-repository ppa:chris-lea/node.js
|
||||
# apt-get update && apt-get dist-upgrade
|
||||
|
||||
Next, clone this repository:
|
||||
|
||||
$ cd /path/to/nodebb/install/location
|
||||
$ git clone git://github.com/designcreateplay/NodeBB.git nodebb
|
||||
|
||||
Obtain all of the dependencies required by NodeBB:
|
||||
|
||||
$ cd nodebb
|
||||
$ npm install
|
||||
|
||||
Initiate the setup script by running the app with the `--setup` flag:
|
||||
|
||||
$ ./nodebb setup
|
||||
|
||||
The default settings are for a local server running on the default port, with a redis store on the same machine/port.
|
||||
|
||||
Lastly, we run the forum.
|
||||
|
||||
$ ./nodebb start
|
||||
|
||||
NodeBB can also be started with helper programs, such as `supervisor` and `forever`. [Take a look at the options here](https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB).
|
||||
[Please refer to platform-specific installation documentation](https://github.com/designcreateplay/NodeBB/wiki#wiki-installing-nodebb)
|
||||
|
||||
## Securing NodeBB
|
||||
|
||||
|
||||
@@ -189,8 +189,7 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
||||
password_confirm.on('blur', onPasswordConfirmChanged);
|
||||
|
||||
$('#changePasswordBtn').on('click', function() {
|
||||
|
||||
if (passwordvalid && passwordsmatch && (currentPassword.val() || app.isAdmin)) {
|
||||
if ((passwordvalid && passwordsmatch) || app.isAdmin) {
|
||||
socket.emit('user.changePassword', {
|
||||
'currentPassword': currentPassword.val(),
|
||||
'newPassword': password.val(),
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputCurrentPassword">[[user:current_password]]</label>
|
||||
<div class="controls">
|
||||
<input class="form-control" type="password" id="inputCurrentPassword" placeholder="Current Password" value="">
|
||||
<input class="form-control" type="password" id="inputCurrentPassword" placeholder="Current Password" value=""<!-- IF !hasPassword --> disabled<!-- ENDIF !hasPassword-->>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
<!-- BEGIN linkTags -->
|
||||
<link<!-- IF linkTags.link --> link="{linkTags.link}"<!-- ENDIF linkTags.link --><!-- IF linkTags.rel --> rel="{linkTags.rel}"<!-- ENDIF linkTags.rel --><!-- IF linkTags.type --> type="{linkTags.type}"<!-- ENDIF linkTags.type --><!-- IF linkTags.href --> href="{linkTags.href}"<!-- ENDIF linkTags.href --> />
|
||||
<!-- END linkTags -->
|
||||
<!-- BEGIN pluginCSS -->
|
||||
<link rel="stylesheet" href="{pluginCSS.path}?{cache-buster}">
|
||||
<!-- END pluginCSS -->
|
||||
<!-- IF useCustomCSS -->
|
||||
<style type="text/css">{customCSS}</style>
|
||||
<!-- ENDIF useCustomCSS -->
|
||||
|
||||
@@ -62,6 +62,8 @@ var fs = require('fs'),
|
||||
Plugins.loadedHooks = {};
|
||||
Plugins.staticDirs = {};
|
||||
Plugins.cssFiles.length = 0;
|
||||
Plugins.lessFiles.length = 0;
|
||||
Plugins.clientScripts.length = 0;
|
||||
|
||||
// Read the list of activated plugins and require their libraries
|
||||
async.waterfall([
|
||||
@@ -195,21 +197,12 @@ var fs = require('fs'),
|
||||
winston.info('[plugins] Found ' + pluginData.css.length + ' CSS file(s) for plugin ' + pluginData.id);
|
||||
}
|
||||
|
||||
if (!pluginData.staticDir) {
|
||||
Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) {
|
||||
return path.join('/plugins', file);
|
||||
}));
|
||||
} else {
|
||||
winston.warn('[plugins/' + pluginData.id + '] staticDir is deprecated, define CSS files with new staticDirs instead.');
|
||||
Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) {
|
||||
return path.join('/plugins', pluginData.id, file);
|
||||
}));
|
||||
}
|
||||
|
||||
next();
|
||||
} else {
|
||||
next();
|
||||
Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) {
|
||||
return path.join(pluginData.id, file);
|
||||
}));
|
||||
}
|
||||
|
||||
next();
|
||||
},
|
||||
function(next) {
|
||||
// LESS files for plugins
|
||||
|
||||
@@ -26,6 +26,11 @@ var path = require('path'),
|
||||
source += '\n@import "./' + plugins.lessFiles[x] + '";';
|
||||
}
|
||||
|
||||
// ... and for each CSS file
|
||||
for(x=0,numCSS=plugins.cssFiles.length;x<numCSS;x++) {
|
||||
source += '\n@import (less) "./' + plugins.cssFiles[x] + '";';
|
||||
}
|
||||
|
||||
var parser = new (less.Parser)({
|
||||
paths: paths
|
||||
});
|
||||
|
||||
24
src/user.js
24
src/user.js
@@ -185,8 +185,13 @@ var bcrypt = require('bcryptjs'),
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (data && data.password) {
|
||||
delete data.password;
|
||||
if (data) {
|
||||
if (data.password) {
|
||||
data.password = null;
|
||||
data.hasPassword = true;
|
||||
} else {
|
||||
data.hasPassword = false;
|
||||
}
|
||||
}
|
||||
callback(err, data);
|
||||
});
|
||||
@@ -467,13 +472,18 @@ var bcrypt = require('bcryptjs'),
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
bcrypt.compare(data.currentPassword, currentPassword, function(err, res) {
|
||||
if (err || !res) {
|
||||
return callback(err || new Error('Your current password is not correct!'));
|
||||
}
|
||||
if (currentPassword !== null) {
|
||||
bcrypt.compare(data.currentPassword, currentPassword, function(err, res) {
|
||||
if (err || !res) {
|
||||
return callback(err || new Error('Your current password is not correct!'));
|
||||
}
|
||||
|
||||
hashAndSetPassword(callback);
|
||||
});
|
||||
} else {
|
||||
// No password in account (probably SSO login)
|
||||
hashAndSetPassword(callback);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -123,7 +123,6 @@ process.on('uncaughtException', function(err) {
|
||||
}],
|
||||
templateValues = {
|
||||
bootswatchCSS: meta.config['theme:src'],
|
||||
pluginCSS: plugins.cssFiles.map(function(file) { return { path: nconf.get('relative_path') + file.replace(/\\/g, '/') }; }),
|
||||
title: meta.config.title || '',
|
||||
description: meta.config.description || '',
|
||||
'brand:logo': meta.config['brand:logo'] || '',
|
||||
|
||||
Reference in New Issue
Block a user