From eee3731832447d8e8ff099e6b2f5a59223f3815b Mon Sep 17 00:00:00 2001
From: NodeBB Misty
Date: Tue, 26 Jul 2016 09:02:34 -0400
Subject: [PATCH 01/25] Latest translations and fallbacks
---
public/language/ar/category.json | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/public/language/ar/category.json b/public/language/ar/category.json
index d36d7a6977..833873ea84 100644
--- a/public/language/ar/category.json
+++ b/public/language/ar/category.json
@@ -10,11 +10,11 @@
"share_this_category": "انشر هذه الفئة",
"watch": "تابع",
"ignore": "تجاهل",
- "watching": "Watching",
- "ignoring": "Ignoring",
- "watching.description": "Show topics in unread",
- "ignoring.description": "Do not show topics in unread",
- "watch.message": "أنت اﻷن متابع لتحديثات هذه الفئة",
+ "watching": "متابع",
+ "ignoring": "متجاهل",
+ "watching.description": "أظهر المواضيع في غير مقروء",
+ "ignoring.description": "لا تظهر المواضيع في غير مقروء",
+ "watch.message": "أنت اﻷن تتابع تحديثات هذه الفئة",
"ignore.message": "أنت اﻷن تتجاهل تحديثات هذه الفئة",
- "watched-categories": "الفئات المراقبه"
+ "watched-categories": "الفئات المتابعة"
}
\ No newline at end of file
From 98d17a05893313411c738212c336a44212d2a57e Mon Sep 17 00:00:00 2001
From: barisusakli
Date: Tue, 26 Jul 2016 16:40:40 +0300
Subject: [PATCH 02/25] fix tab
---
src/socket.io/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/socket.io/index.js b/src/socket.io/index.js
index 772166687a..cebbfe1a24 100644
--- a/src/socket.io/index.js
+++ b/src/socket.io/index.js
@@ -1,6 +1,6 @@
"use strict";
-var SocketIO = require('socket.io');
+var SocketIO = require('socket.io');
var socketioWildcard = require('socketio-wildcard')();
var async = require('async');
var nconf = require('nconf');
From 2268f250bb4bdb2d0dff4f9281ce799fd6337f78 Mon Sep 17 00:00:00 2001
From: Julian Lam
Date: Tue, 26 Jul 2016 10:01:54 -0400
Subject: [PATCH 03/25] removed commented out language method
---
src/plugins.js | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/src/plugins.js b/src/plugins.js
index da7f25eefe..6eba5de2ce 100644
--- a/src/plugins.js
+++ b/src/plugins.js
@@ -425,28 +425,4 @@ var middleware;
], next);
};
- // function addLanguages(params, callback) {
- // Plugins.customLanguages.forEach(function(lang) {
- // console.log('route for', '/language/' + lang.route);
- // params.router.get('/language' + lang.route, function(req, res, next) {
- // res.json(lang.file);
- // });
-
- // var components = lang.route.split('/'),
- // language = components[1],
- // filename = components[2].replace('.json', '');
-
- // translator.addTranslation(language, filename, lang.file);
- // });
-
- // for(var resource in Plugins.customLanguageFallbacks) {
- // params.router.get('/language/:lang/' + resource + '.json', function(req, res, next) {
- // winston.verbose('[translator] No resource file found for ' + req.params.lang + '/' + path.basename(req.path, '.json') + ', using provided fallback language file');
- // res.sendFile(Plugins.customLanguageFallbacks[path.basename(req.path, '.json')]);
- // });
- // }
-
- // callback(null);
- // }
-
}(exports));
From c666a7efda8db9d71caebaedb2ac72d61522897a Mon Sep 17 00:00:00 2001
From: Anil Mandepudi
Date: Wed, 27 Jul 2016 10:06:54 -0700
Subject: [PATCH 04/25] add static:assets.prepare hook (#4889)
* add static:assets.prepare hook
add static:assets.prepare hook to be called before css minification so that themes/plugins can modify less vars.
* change parameter
---
src/webserver.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/webserver.js b/src/webserver.js
index 48d8167d3b..5ed7f44cd6 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -85,6 +85,7 @@ function initializeNodeBB(callback) {
function(next) {
plugins.init(app, middleware, next);
},
+ async.apply(plugins.fireHook, 'static:assets.prepare', {}),
async.apply(meta.js.bridgeModules, app),
function(next) {
async.series([
From a9a522c8eccf4187a21a5345e1a9b646841e7dca Mon Sep 17 00:00:00 2001
From: Julian Lam
Date: Wed, 27 Jul 2016 14:31:15 -0400
Subject: [PATCH 05/25] allowing widgets to not show up if widget explicitly
returns null
---
src/widgets/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/widgets/index.js b/src/widgets/index.js
index 5debdf3b26..fdac7e19d9 100644
--- a/src/widgets/index.js
+++ b/src/widgets/index.js
@@ -44,7 +44,7 @@ widgets.render = function(uid, area, req, res, callback) {
req: req,
res: res
}, function(err, html) {
- if (err) {
+ if (err || html === null) {
return next(err);
}
From af75a887b5a0ca007a7d802231654f0626cfec39 Mon Sep 17 00:00:00 2001
From: barisusakli
Date: Wed, 27 Jul 2016 22:17:02 +0300
Subject: [PATCH 06/25] closes #4892
prevent crash if registerHook is called with invalid hook name
---
src/plugins/hooks.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js
index c2dde7b92a..5bd2ba459e 100644
--- a/src/plugins/hooks.js
+++ b/src/plugins/hooks.js
@@ -23,6 +23,10 @@ module.exports = function(Plugins) {
}
}
+ if (!data.hook) {
+ return winston.warn('[plugins/' + id + '] registerHook called with invalid data.hook', data);
+ }
+
var method;
if (Object.keys(Plugins.deprecatedHooks).indexOf(data.hook) !== -1) {
From f47d60c9306019656af7700c794cb1d203011ffe Mon Sep 17 00:00:00 2001
From: NodeBB Misty
Date: Thu, 28 Jul 2016 09:02:56 -0400
Subject: [PATCH 07/25] Latest translations and fallbacks
---
public/language/nl/category.json | 8 ++++----
public/language/nl/topic.json | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/public/language/nl/category.json b/public/language/nl/category.json
index 8c9caafa53..7ca67ad3be 100644
--- a/public/language/nl/category.json
+++ b/public/language/nl/category.json
@@ -10,10 +10,10 @@
"share_this_category": "Deel deze categorie",
"watch": "Volgen",
"ignore": "Negeren",
- "watching": "Watching",
- "ignoring": "Ignoring",
- "watching.description": "Show topics in unread",
- "ignoring.description": "Do not show topics in unread",
+ "watching": "Volgend",
+ "ignoring": "Negerend",
+ "watching.description": "Toon ongelezen onderwerpen",
+ "ignoring.description": "Toon geen onderwerpen onder onder ongelezen onderwerpen",
"watch.message": "Van deze categorie worden nu meldingen ontvangen",
"ignore.message": "Er worden geen meldingen van deze categorie ontvangen",
"watched-categories": "Categorieën die bekeken zijn."
diff --git a/public/language/nl/topic.json b/public/language/nl/topic.json
index 2baaccfceb..d011e95667 100644
--- a/public/language/nl/topic.json
+++ b/public/language/nl/topic.json
@@ -31,8 +31,8 @@
"flag_success": "Dit bericht is gerapporteerd aan de beheerder.",
"deleted_message": "Dit onderwerp is verwijderd. Alleen gebruikers met beheerrechten op onderwerpniveau kunnen dit inzien.",
"following_topic.message": "Vanaf nu worden meldingen ontvangen zodra iemand een reactie op dit onderwerp geeft.",
- "not_following_topic.message": "You will see this topic in the unread topics list, but you will not receive notifications when somebody posts to this topic.",
- "ignoring_topic.message": "You will no longer see this topic in the unread topics list. You will be notified when you are mentioned or your post is up voted.",
+ "not_following_topic.message": "Dit onderwerp zal verschijnen in de lijst van ongelezen onderwerpen, maar er zullen geen meldingen ontvangen zodra iemand een reactie op dit onderwerp geeft.",
+ "ignoring_topic.message": "Dit onderwerp zal niet meer verschijnen in de lijst van ongelezen berichten. U zult enkel een melding ontvangen wanneer u wordt genoemd, of wanneer er een positieve stem op uw reactie wordt gegeven.",
"login_to_subscribe": "Log in or registreer om dit onderwerp te volgen.",
"markAsUnreadForAll.success": "Onderwerp is voor iedereen als ongelezen gemarkeerd.",
"mark_unread": "Ongelezen markeren",
@@ -45,9 +45,9 @@
"watching": "Gevolgd",
"not-watching": "Niet gevolgd",
"ignoring": "Genegeerd",
- "watching.description": "Notify me of new replies.
Show topic in unread.",
- "not-watching.description": "Do not notify me of new replies.
Show topic in unread if category is not ignored.",
- "ignoring.description": "Do not notify me of new replies.
Do not show topic in unread.",
+ "watching.description": "Stuur me een melding bij nieuwe reacties.
Toon onderwerp bij de ongelezen onderwerpen.",
+ "not-watching.description": "Stuur me geen melding van nieuwe reacties.
Toon onderwerp in ongelezen mits de categorie niet genegeerd wordt.",
+ "ignoring.description": "Stuur me geen melding van nieuwe reacties.
Toon dit onderwerp niet onder de ongelezen onderwerpen.",
"thread_tools.title": "Acties",
"thread_tools.markAsUnreadForAll": "Ongelezen markeren",
"thread_tools.pin": "Onderwerp vastpinnen",
From e7386e20cf90cbc8e7c59938c2a78cd66c0f8bf5 Mon Sep 17 00:00:00 2001
From: Julian Lam
Date: Thu, 28 Jul 2016 11:51:06 -0400
Subject: [PATCH 08/25] closes #4505
---
public/language/en_GB/global.json | 4 +-
public/src/admin/appearance/customise.js | 4 ++
public/src/admin/manage/category.js | 4 ++
public/src/admin/settings.js | 9 ++++
public/src/ajaxify.js | 62 +++++++++++++++---------
public/src/modules/settings.js | 9 ++++
src/views/admin/header.tpl | 3 +-
7 files changed, 70 insertions(+), 25 deletions(-)
diff --git a/public/language/en_GB/global.json b/public/language/en_GB/global.json
index 226589b8af..6641c28261 100644
--- a/public/language/en_GB/global.json
+++ b/public/language/en_GB/global.json
@@ -116,5 +116,7 @@
"enter_page_number": "Enter page number",
"upload_file": "Upload file",
"upload": "Upload",
- "allowed-file-types": "Allowed file types are %1"
+ "allowed-file-types": "Allowed file types are %1",
+
+ "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?"
}
diff --git a/public/src/admin/appearance/customise.js b/public/src/admin/appearance/customise.js
index a135a240fe..a85fd663ad 100644
--- a/public/src/admin/appearance/customise.js
+++ b/public/src/admin/appearance/customise.js
@@ -16,6 +16,8 @@ define('admin/appearance/customise', ['admin/settings'], function(Settings) {
customCSS.getSession().setMode("ace/mode/css");
customCSS.on('change', function(e) {
+ app.flags = app.flags || {};
+ app.flags._unsaved = true;
$('#customCSS-holder').val(customCSS.getValue());
});
@@ -23,6 +25,8 @@ define('admin/appearance/customise', ['admin/settings'], function(Settings) {
customHTML.getSession().setMode("ace/mode/html");
customHTML.on('change', function(e) {
+ app.flags = app.flags || {};
+ app.flags._unsaved = true;
$('#customHTML-holder').val(customHTML.getValue());
});
});
diff --git a/public/src/admin/manage/category.js b/public/src/admin/manage/category.js
index b58d3295b9..8288610e73 100644
--- a/public/src/admin/manage/category.js
+++ b/public/src/admin/manage/category.js
@@ -18,6 +18,9 @@ define('admin/manage/category', [
if (cid) {
modified_categories[cid] = modified_categories[cid] || {};
modified_categories[cid][$(el).attr('data-name')] = $(el).val();
+
+ app.flags = app.flags || {};
+ app.flags._unsaved = true;
}
}
@@ -31,6 +34,7 @@ define('admin/manage/category', [
}
if (result && result.length) {
+ app.flags._unsaved = false;
app.alert({
title: 'Updated Categories',
message: 'Category IDs ' + result.join(', ') + ' was successfully updated.',
diff --git a/public/src/admin/settings.js b/public/src/admin/settings.js
index 0c341151e1..9e616cfe80 100644
--- a/public/src/admin/settings.js
+++ b/public/src/admin/settings.js
@@ -27,6 +27,12 @@ define('admin/settings', ['uploader'], function(uploader) {
revertBtn = $('#revert'),
x, key, inputType, field;
+ // Handle unsaved changes
+ $(fields).on('change', function() {
+ app.flags = app.flags || {};
+ app.flags._unsaved = true;
+ });
+
for (x = 0; x < numFields; x++) {
field = fields.eq(x);
key = field.attr('data-field');
@@ -77,6 +83,9 @@ define('admin/settings', ['uploader'], function(uploader) {
type: 'danger'
});
}
+
+ app.flags._unsaved = false;
+
app.alert({
alert_id: 'config_status',
timeout: 2500,
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index 211cbb15e4..7280de01ed 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -1,11 +1,9 @@
"use strict";
+/*global app, bootbox, templates, socket, config, RELATIVE_PATH*/
var ajaxify = ajaxify || {};
$(document).ready(function() {
-
- /*global app, templates, socket, config, RELATIVE_PATH*/
-
var location = document.location || window.location;
var rootUrl = location.protocol + '//' + (location.hostname || location.host) + (location.port ? ':' + location.port : '');
var apiXHR = null;
@@ -295,6 +293,32 @@ $(document).ready(function() {
// Enhancing all anchors to ajaxify...
$(document.body).on('click', 'a', function (e) {
+ var _self = this;
+ var process = function() {
+ if (!e.ctrlKey && !e.shiftKey && !e.metaKey && e.which === 1) {
+ if (internalLink) {
+ var pathname = this.href.replace(rootUrl + RELATIVE_PATH + '/', '');
+
+ // Special handling for urls with hashes
+ if (window.location.pathname === this.pathname && this.hash.length) {
+ window.location.hash = this.hash;
+ } else {
+ if (ajaxify.go(pathname)) {
+ e.preventDefault();
+ }
+ }
+ } else if (window.location.pathname !== '/outgoing') {
+ if (config.openOutgoingLinksInNewTab) {
+ window.open(this.href, '_blank');
+ e.preventDefault();
+ } else if (config.useOutgoingLinksPage) {
+ ajaxify.go('outgoing?url=' + encodeURIComponent(this.href));
+ e.preventDefault();
+ }
+ }
+ }
+ };
+
if (this.target !== '' || (this.protocol !== 'http:' && this.protocol !== 'https:')) {
return;
}
@@ -311,6 +335,7 @@ $(document).ready(function() {
}
}
+ // Default behaviour for rss feeds
if (internalLink && $(this).attr('href').endsWith('.rss')) {
return;
}
@@ -319,28 +344,19 @@ $(document).ready(function() {
return e.preventDefault();
}
- if (!e.ctrlKey && !e.shiftKey && !e.metaKey && e.which === 1) {
- if (internalLink) {
- var pathname = this.href.replace(rootUrl + RELATIVE_PATH + '/', '');
-
- // Special handling for urls with hashes
- if (window.location.pathname === this.pathname && this.hash.length) {
- window.location.hash = this.hash;
- } else {
- if (ajaxify.go(pathname)) {
- e.preventDefault();
+ if (app.flags && app.flags.hasOwnProperty('_unsaved') && app.flags._unsaved === true) {
+ translator.translate('[[global:unsaved-changes]]', function(text) {
+ bootbox.confirm(text, function(navigate) {
+ if (navigate) {
+ app.flags._unsaved = false;
+ process.call(_self);
}
- }
- } else if (window.location.pathname !== '/outgoing') {
- if (config.openOutgoingLinksInNewTab) {
- window.open(this.href, '_blank');
- e.preventDefault();
- } else if (config.useOutgoingLinksPage) {
- ajaxify.go('outgoing?url=' + encodeURIComponent(this.href));
- e.preventDefault();
- }
- }
+ });
+ });
+ return e.preventDefault();
}
+
+ process.call(_self);
});
}
diff --git a/public/src/modules/settings.js b/public/src/modules/settings.js
index 652398f539..79c150854d 100644
--- a/public/src/modules/settings.js
+++ b/public/src/modules/settings.js
@@ -473,6 +473,12 @@ define('settings', function () {
});
$(window).trigger('action:admin.settingsLoaded');
+ // Handle unsaved changes
+ $(formEl).on('change', 'input, select, textarea', function() {
+ app.flags = app.flags || {};
+ app.flags._unsaved = true;
+ });
+
callback(null, values);
});
},
@@ -498,6 +504,9 @@ define('settings', function () {
hash: hash,
values: values
}, function (err) {
+ // Remove unsaved flag to re-enable ajaxify
+ app.flags._unsaved = false;
+
if (typeof callback === 'function') {
callback();
} else {
diff --git a/src/views/admin/header.tpl b/src/views/admin/header.tpl
index 03cab80005..3d797ed5be 100644
--- a/src/views/admin/header.tpl
+++ b/src/views/admin/header.tpl
@@ -15,7 +15,8 @@
var app = {
template: "{template.name}",
user: JSON.parse('{{userJSON}}'),
- config: JSON.parse(decodeURIComponent("{{adminConfigJSON}}"))
+ config: JSON.parse(decodeURIComponent("{{adminConfigJSON}}")),
+ flags: {}
};
From 0d40542f933b8f12241c4a414c5490dabdf9e2c2 Mon Sep 17 00:00:00 2001
From: Ben Lubar
Date: Thu, 28 Jul 2016 12:21:37 -0500
Subject: [PATCH 09/25] Keep old versions of avatars in the filesystem. Change
the avatar URL each time a new one is uploaded to avoid caching problems.
Closes #4722.
---
src/user/picture.js | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/user/picture.js b/src/user/picture.js
index 385050fcf2..19f6a2bd81 100644
--- a/src/user/picture.js
+++ b/src/user/picture.js
@@ -42,7 +42,7 @@ module.exports = function(User) {
return plugins.fireHook('filter:uploadImage', {image: picture, uid: updateUid}, next);
}
- var filename = updateUid + '-profileimg' + (convertToPNG ? '.png' : extension);
+ var filename = updateUid + '-profileimg-' + Date.now() + (convertToPNG ? '.png' : extension);
async.waterfall([
function(next) {
@@ -68,21 +68,7 @@ module.exports = function(User) {
});
},
function(next) {
- User.getUserField(updateUid, 'uploadedpicture', next);
- },
- function(oldpicture, next) {
- if (!oldpicture) {
- return file.saveFileToLocal(filename, 'profile', picture.path, next);
- }
- var oldpicturePath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), 'profile', path.basename(oldpicture));
-
- fs.unlink(oldpicturePath, function (err) {
- if (err) {
- winston.error(err);
- }
-
- file.saveFileToLocal(filename, 'profile', picture.path, next);
- });
+ file.saveFileToLocal(filename, 'profile', picture.path, next);
},
], next);
},
@@ -181,7 +167,7 @@ module.exports = function(User) {
return plugins.fireHook('filter:uploadImage', {image: image, uid: data.uid}, next);
}
- var filename = data.uid + '-profilecover';
+ var filename = data.uid + '-profilecover-' + Date.now();
async.waterfall([
function (next) {
file.isFileTypeAllowed(data.file.path, next);
From fc387111e29ca61a89745f51207b4c45e7919e5b Mon Sep 17 00:00:00 2001
From: Ben Lubar
Date: Thu, 28 Jul 2016 13:16:38 -0500
Subject: [PATCH 10/25] make keeping avatar versions an option in the ACP that
is turned off by default
---
src/user/picture.js | 6 ++++--
src/views/admin/settings/uploads.tpl | 9 ++++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/user/picture.js b/src/user/picture.js
index 19f6a2bd81..38d013cab0 100644
--- a/src/user/picture.js
+++ b/src/user/picture.js
@@ -25,6 +25,7 @@ module.exports = function(User) {
var updateUid = uid;
var imageDimension = parseInt(meta.config.profileImageDimension, 10) || 128;
var convertToPNG = parseInt(meta.config['profile:convertProfileImageToPNG'], 10) === 1;
+ var keepAllVersions = parseInt(meta.config['profile:keepAllUserImages'], 10) === 1;
var uploadedImage;
async.waterfall([
@@ -42,7 +43,7 @@ module.exports = function(User) {
return plugins.fireHook('filter:uploadImage', {image: picture, uid: updateUid}, next);
}
- var filename = updateUid + '-profileimg-' + Date.now() + (convertToPNG ? '.png' : extension);
+ var filename = updateUid + '-profileimg' + (keepAllVersions ? '-' + Date.now() : '') + (convertToPNG ? '.png' : extension);
async.waterfall([
function(next) {
@@ -120,6 +121,7 @@ module.exports = function(User) {
};
User.updateCoverPicture = function(data, callback) {
+ var keepAllVersions = parseInt(meta.config['profile:keepAllUserImages'], 10) === 1;
var url, md5sum;
if (!data.imageData && data.position) {
@@ -167,7 +169,7 @@ module.exports = function(User) {
return plugins.fireHook('filter:uploadImage', {image: image, uid: data.uid}, next);
}
- var filename = data.uid + '-profilecover-' + Date.now();
+ var filename = data.uid + '-profilecover' + (keepAllVersions ? '-' + Date.now() : '');
async.waterfall([
function (next) {
file.isFileTypeAllowed(data.file.path, next);
diff --git a/src/views/admin/settings/uploads.tpl b/src/views/admin/settings/uploads.tpl
index f5b2e3c5a5..9b76626dd3 100644
--- a/src/views/admin/settings/uploads.tpl
+++ b/src/views/admin/settings/uploads.tpl
@@ -115,6 +115,13 @@
(in kilobytes, default: 2,048 KiB)
+
+
+
+
@@ -132,4 +139,4 @@
-
\ No newline at end of file
+
From 11236bb841d21a9fd3ab31131cee3c7b5b040861 Mon Sep 17 00:00:00 2001
From: barisusakli
Date: Thu, 28 Jul 2016 21:28:18 +0300
Subject: [PATCH 11/25] fix missing callback
---
src/plugins/hooks.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js
index 5bd2ba459e..3e0bdcc848 100644
--- a/src/plugins/hooks.js
+++ b/src/plugins/hooks.js
@@ -14,17 +14,17 @@ module.exports = function(Plugins) {
`data.priority`, the relative priority of the method when it is eventually called (default: 10)
*/
Plugins.registerHook = function(id, data, callback) {
+ callback = callback || function() {};
function register() {
Plugins.loadedHooks[data.hook] = Plugins.loadedHooks[data.hook] || [];
Plugins.loadedHooks[data.hook].push(data);
- if (typeof callback === 'function') {
- callback();
- }
+ callback();
}
if (!data.hook) {
- return winston.warn('[plugins/' + id + '] registerHook called with invalid data.hook', data);
+ winston.warn('[plugins/' + id + '] registerHook called with invalid data.hook', data);
+ return callback();
}
var method;
@@ -69,6 +69,7 @@ module.exports = function(Plugins) {
register();
} else {
winston.warn('[plugins/' + id + '] Hook method mismatch: ' + data.hook + ' => ' + data.method);
+ return callback();
}
}
};
From 2606844d98b47646e021c4c5093608879cfe38fd Mon Sep 17 00:00:00 2001
From: barisusakli
Date: Fri, 29 Jul 2016 14:26:04 +0300
Subject: [PATCH 12/25] closes #4868
---
public/language/en_GB/login.json | 3 ++-
public/src/admin/admin.js | 14 ++++++++++++++
src/middleware/middleware.js | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/public/language/en_GB/login.json b/public/language/en_GB/login.json
index e76658fe3d..97c6dedb37 100644
--- a/public/language/en_GB/login.json
+++ b/public/language/en_GB/login.json
@@ -7,5 +7,6 @@
"alternative_logins": "Alternative Logins",
"failed_login_attempt": "Login Unsuccessful",
"login_successful": "You have successfully logged in!",
- "dont_have_account": "Don't have an account?"
+ "dont_have_account": "Don't have an account?",
+ "logged-out-due-to-inactivity": "You have been logged out due to inactivity"
}
diff --git a/public/src/admin/admin.js b/public/src/admin/admin.js
index 62234df1e9..8a26b91409 100644
--- a/public/src/admin/admin.js
+++ b/public/src/admin/admin.js
@@ -2,9 +2,23 @@
/*global config, translator, componentHandler, define, socket, app, ajaxify, utils, bootbox, Slideout, NProgress, RELATIVE_PATH*/
(function() {
+ var logoutTimer = 0;
+ function startLogoutTimer() {
+ if (logoutTimer) {
+ clearTimeout(logoutTimer);
+ }
+
+ logoutTimer = setTimeout(function() {
+ app.alert({
+ message: '[[login:logged-out-due-to-inactivity]]'
+ });
+ setTimeout(app.logout, 5000);
+ }, 3600000);
+ }
$(window).on('action:ajaxify.end', function() {
showCorrectNavTab();
+ startLogoutTimer();
});
function showCorrectNavTab() {
diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js
index a1c98b0c3d..afae4957ea 100644
--- a/src/middleware/middleware.js
+++ b/src/middleware/middleware.js
@@ -206,6 +206,7 @@ middleware.isAdmin = function(req, res, next) {
var loginTime = req.session.meta ? req.session.meta.datetime : 0;
if (loginTime && parseInt(loginTime, 10) > Date.now() - 3600000) {
+ req.session.meta.datetime += 300000;
return next();
}
From 9ae50d316459d445cdb1d63f69c006417f749a0c Mon Sep 17 00:00:00 2001
From: barisusakli
Date: Fri, 29 Jul 2016 14:41:02 +0300
Subject: [PATCH 13/25] up persona
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 396596205d..3c73cff186 100644
--- a/package.json
+++ b/package.json
@@ -57,7 +57,7 @@
"nodebb-plugin-spam-be-gone": "0.4.9",
"nodebb-rewards-essentials": "0.0.9",
"nodebb-theme-lavender": "3.0.13",
- "nodebb-theme-persona": "4.1.11",
+ "nodebb-theme-persona": "4.1.12",
"nodebb-theme-vanilla": "5.1.3",
"nodebb-widget-essentials": "2.0.10",
"nodemailer": "2.0.0",
From d9dc65720adb96edec14ea22c57449132074d94d Mon Sep 17 00:00:00 2001
From: NodeBB Misty
Date: Fri, 29 Jul 2016 09:04:17 -0400
Subject: [PATCH 14/25] Latest translations and fallbacks
---
public/language/pt_BR/category.json | 8 ++++----
public/language/pt_BR/error.json | 22 +++++++++++-----------
public/language/pt_BR/global.json | 6 +++---
public/language/pt_BR/pages.json | 4 ++--
public/language/pt_BR/register.json | 8 ++++----
public/language/pt_BR/topic.json | 2 +-
public/language/pt_BR/user.json | 18 +++++++++---------
public/language/pt_BR/users.json | 2 +-
public/language/tr/category.json | 8 ++++----
public/language/tr/global.json | 4 ++--
public/language/tr/pages.json | 2 +-
public/language/tr/register.json | 6 +++---
12 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/public/language/pt_BR/category.json b/public/language/pt_BR/category.json
index 9de5c610a7..ad56253599 100644
--- a/public/language/pt_BR/category.json
+++ b/public/language/pt_BR/category.json
@@ -10,10 +10,10 @@
"share_this_category": "Compartilhar esta categoria",
"watch": "Acompanhar",
"ignore": "Ignorar",
- "watching": "Watching",
- "ignoring": "Ignoring",
- "watching.description": "Show topics in unread",
- "ignoring.description": "Do not show topics in unread",
+ "watching": "Assistindo",
+ "ignoring": "Ignorando",
+ "watching.description": "Mostrar tópicos em não-lido",
+ "ignoring.description": "Não mostrar tópicos em não-lido",
"watch.message": "Agora você está acompanhando as atualizações desta categoria",
"ignore.message": "Agora você está ignorando as atualizações desta categoria",
"watched-categories": "Categorias acompanhadas"
diff --git a/public/language/pt_BR/error.json b/public/language/pt_BR/error.json
index be9e3d7492..339dba48e4 100644
--- a/public/language/pt_BR/error.json
+++ b/public/language/pt_BR/error.json
@@ -30,7 +30,7 @@
"user-banned": "Usuário banido",
"user-too-new": "Desculpe, é necessário que você aguarde %1 segundo(s) antes de fazer o seu primeiro post.",
"blacklisted-ip": "Desculpe, o seu endereço IP foi banido desta comunidade. Se você acha que isso é um engano, por favor contate um administrador.",
- "ban-expiry-missing": "Please provide an end date for this ban",
+ "ban-expiry-missing": "Por favor forneça uma data para o fim deste banimento",
"no-category": "A categoria não existe",
"no-topic": "O tópico não existe",
"no-post": "O post não existe",
@@ -47,13 +47,13 @@
"post-edit-duration-expired-hours-minutes": "Você pode apenas editar posts por %1 hora(s) e %2 minuto(s) após postar",
"post-edit-duration-expired-days": "Você pode apenas editar posts por %1 dia(s) após postar",
"post-edit-duration-expired-days-hours": "Você pode apenas editar posts por %1 dia(s) e %2 hora(s) após postar",
- "post-delete-duration-expired": "You are only allowed to delete posts for %1 second(s) after posting",
- "post-delete-duration-expired-minutes": "You are only allowed to delete posts for %1 minute(s) after posting",
- "post-delete-duration-expired-minutes-seconds": "You are only allowed to delete posts for %1 minute(s) %2 second(s) after posting",
- "post-delete-duration-expired-hours": "You are only allowed to delete posts for %1 hour(s) after posting",
- "post-delete-duration-expired-hours-minutes": "You are only allowed to delete posts for %1 hour(s) %2 minute(s) after posting",
- "post-delete-duration-expired-days": "You are only allowed to delete posts for %1 day(s) after posting",
- "post-delete-duration-expired-days-hours": "You are only allowed to delete posts for %1 day(s) %2 hour(s) after posting",
+ "post-delete-duration-expired": "Você só pode deletar posts por %1 segundo(s) depois de postar",
+ "post-delete-duration-expired-minutes": "Você só pode deletar posts por %1 minuto(s) depois de postar",
+ "post-delete-duration-expired-minutes-seconds": "Você só pode deletar posts por %1 minuto(s) e %2 segundo(s) depois de postar",
+ "post-delete-duration-expired-hours": "Você só pode deletar posts por %1 hora(s) depois de postar",
+ "post-delete-duration-expired-hours-minutes": "Você só pode deletar posts por %1 hora(s) e %2 minutos(s) depois de postar",
+ "post-delete-duration-expired-days": "Você só pode deletar posts por %1 dia(s) depois de postar",
+ "post-delete-duration-expired-days-hours": "Você só pode deletar posts por %1 dia(s) e %2 hora(s) depois de postar",
"content-too-short": "Por favor digite um post maior. Posts precisam conter ao menos %1 caractere(s).",
"content-too-long": "Por favor digite um post mais curto. Posts não podem ser maiores que %1 caractere(s)",
"title-too-short": "Por favor digite um título maior. Títulos devem conter no mínimo %1 caractere(s)",
@@ -71,12 +71,12 @@
"already-unfavourited": "Você já removeu este post dos favoritos",
"cant-ban-other-admins": "Você não pode banir outros administradores!",
"cant-remove-last-admin": "Você é o único administrador. Adicione outro usuário como administrador antes de remover a si mesmo como admin",
- "cant-delete-admin": "Remove administrator privileges from this account before attempting to delete it.",
+ "cant-delete-admin": "Remova o privilégio de administrador desta conta antes de tentar deletá-la.",
"invalid-image-type": "Tipo inválido de imagem. Os tipos permitidos são: %1",
"invalid-image-extension": "Extensão de imagem inválida",
"invalid-file-type": "Tipo de arquivo inválido. Os tipos permitidos são: %1",
"group-name-too-short": "Nome do grupo é muito curto",
- "group-name-too-long": "Group name too long",
+ "group-name-too-long": "O nome do grupo é muito extenso",
"group-already-exists": "O grupo já existe",
"group-name-change-not-allowed": "Sem permissão para alterar nome do grupo",
"group-already-member": "Já faz parte deste grupo",
@@ -119,5 +119,5 @@
"not-in-room": "O usuário não está na sala",
"no-users-in-room": "Nenhum usuário nesta sala",
"cant-kick-self": "Você não pode kickar a si mesmo do grupo",
- "no-users-selected": "No user(s) selected"
+ "no-users-selected": "Nenhuma escolha de usuário(s) foi feita"
}
\ No newline at end of file
diff --git a/public/language/pt_BR/global.json b/public/language/pt_BR/global.json
index 21a3afd2e4..115d36e0b3 100644
--- a/public/language/pt_BR/global.json
+++ b/public/language/pt_BR/global.json
@@ -50,9 +50,9 @@
"topics": "Tópicos",
"posts": "Posts",
"best": "Melhor",
- "upvoters": "Upvoters",
+ "upvoters": "Cimavotadores",
"upvoted": "Votado positivamente",
- "downvoters": "Downvoters",
+ "downvoters": "Baixovotadores",
"downvoted": "Votado negativamente",
"views": "Visualizações",
"reputation": "Reputação",
@@ -80,7 +80,7 @@
"language": "Idioma",
"guest": "Visitante",
"guests": "Visitantes",
- "updated.title": "Forum Updated",
+ "updated.title": "Fórum Atualizado",
"updated.message": "Este fórum foi atualizado para sua última versão. Clique aqui para atualizar a página.",
"privacy": "Privacidade",
"follow": "Seguir",
diff --git a/public/language/pt_BR/pages.json b/public/language/pt_BR/pages.json
index aef2f3ea5e..68b771bdb8 100644
--- a/public/language/pt_BR/pages.json
+++ b/public/language/pt_BR/pages.json
@@ -12,7 +12,7 @@
"users/sort-posts": "Usuários com mais posts",
"users/sort-reputation": "Usuários com maior reputação",
"users/banned": "Usuários Banidos",
- "users/most-flags": "Most flagged users",
+ "users/most-flags": "Usuários mais sinalizados",
"users/search": "Pesquisa de Usuários",
"notifications": "Notificações",
"tags": "Tags",
@@ -29,7 +29,7 @@
"account/edit/password": "Editando senha de \"%1\"",
"account/edit/username": "Editando nome de usuário de \"%1\"",
"account/edit/email": "Editando email de \"%1\"",
- "account/info": "Account Info",
+ "account/info": "Informação da Conta",
"account/following": "Pessoas que %1 segue",
"account/followers": "Pessoas que seguem %1",
"account/posts": "Posts feitos por %1",
diff --git a/public/language/pt_BR/register.json b/public/language/pt_BR/register.json
index 85ac0ffec0..1070dce7ec 100644
--- a/public/language/pt_BR/register.json
+++ b/public/language/pt_BR/register.json
@@ -1,6 +1,6 @@
{
"register": "Cadastrar",
- "cancel_registration": "Cancel Registration",
+ "cancel_registration": "Cancelar Cadastro",
"help.email": "Por padrão seu email ficará invisível para o publico.",
"help.username_restrictions": "Um nome de usuário único entre %1 e %2 caracteres. Os outros poderão te mencionar digitando @usuário.",
"help.minimum_password_length": "Sua senha tem que ter no mínimo %1 caracteres.",
@@ -16,8 +16,8 @@
"alternative_registration": "Cadastro Alternativo",
"terms_of_use": "Termos de Uso",
"agree_to_terms_of_use": "Eu concordo com os Termos de Uso",
- "terms_of_use_error": "You must agree to the Terms of Use",
+ "terms_of_use_error": "Você deve concordar com os Termos de Uso",
"registration-added-to-queue": "O seu cadastro foi adicionado à fila de aprovação. Você receberá um email quando ele for aceito por um administrador.",
- "interstitial.intro": "We require some additional information before we can create your account.",
- "interstitial.errors-found": "We could not complete your registration:"
+ "interstitial.intro": "Nós pedimos alguma informação adicional antes que você possa criar a sua conta.",
+ "interstitial.errors-found": "Nós não pudemos completar o seu cadastro:"
}
\ No newline at end of file
diff --git a/public/language/pt_BR/topic.json b/public/language/pt_BR/topic.json
index 0a90dec961..f4a9305d1b 100644
--- a/public/language/pt_BR/topic.json
+++ b/public/language/pt_BR/topic.json
@@ -31,7 +31,7 @@
"flag_success": "Este post foi sinalizado para ser moderado.",
"deleted_message": "Este tópico foi deletado. Apenas usuários com privilégios de moderação de tópico podem vê-lo.",
"following_topic.message": "Agora você receberá notificações quando alguém responder este tópico.",
- "not_following_topic.message": "You will see this topic in the unread topics list, but you will not receive notifications when somebody posts to this topic.",
+ "not_following_topic.message": "Você verá este tópico na lista de tópicos não-lidos, mas você não receberá notificações quendo alguém posta no tópico.",
"ignoring_topic.message": "Você não verá mais este tópico na lista de tópicos não lidos. Você será notificado quando você for mencionado ou sua postagem for votada positivamente.",
"login_to_subscribe": "Por favor se cadastre ou entre para assinar à este tópico.",
"markAsUnreadForAll.success": "Tópico marcado como não lido para todos.",
diff --git a/public/language/pt_BR/user.json b/public/language/pt_BR/user.json
index c8b17f7799..b6ee0c97c4 100644
--- a/public/language/pt_BR/user.json
+++ b/public/language/pt_BR/user.json
@@ -6,7 +6,7 @@
"postcount": "Número de Posts",
"email": "Email",
"confirm_email": "Confirmar Email",
- "account_info": "Account Info",
+ "account_info": "Informação da Conta",
"ban_account": "Banir Conta",
"ban_account_confirm": "Você realmente quer banir esse usuario?",
"unban_account": "Desbanir Conta",
@@ -96,8 +96,8 @@
"delay_image_loading": "Aguardar para Carregar Imagens",
"image_load_delay_help": "Se habilitado, imagens em tópicos não serão carregadas até que eles sejam rolados à visão",
"scroll_to_my_post": "Após postar uma réplica, mostre o novo post",
- "follow_topics_you_reply_to": "Watch topics that you reply to",
- "follow_topics_you_create": "Watch topics you create",
+ "follow_topics_you_reply_to": "Assistir os tópicos que você responde",
+ "follow_topics_you_create": "Assistir aos tópicos que você cria",
"grouptitle": "Título do Grupo",
"no-group-title": "Sem título de grupo",
"select-skin": "Escolha uma Skin",
@@ -109,10 +109,10 @@
"sso.title": "Logar por outros Serviços",
"sso.associated": "Associado com",
"sso.not-associated": "Clique aqui para associar com",
- "info.latest-flags": "Latest Flags",
- "info.no-flags": "No Flagged Posts Found",
- "info.ban-history": "Recent Ban History",
- "info.no-ban-history": "This user has never been banned",
- "info.banned-until": "Banned until %1",
- "info.banned-permanently": "Banned permanently"
+ "info.latest-flags": "Últimas Sinalizações",
+ "info.no-flags": "Nenhum Post Sinalizado Encontrado",
+ "info.ban-history": "Histórico de Banimentos Recentes",
+ "info.no-ban-history": "Este usuário nunca foi banido",
+ "info.banned-until": "Banido até %1",
+ "info.banned-permanently": "Banido permanentemente"
}
\ No newline at end of file
diff --git a/public/language/pt_BR/users.json b/public/language/pt_BR/users.json
index e67604fdba..62aa2b060e 100644
--- a/public/language/pt_BR/users.json
+++ b/public/language/pt_BR/users.json
@@ -2,7 +2,7 @@
"latest_users": "Últimos Usuários",
"top_posters": "Principais Participantes",
"most_reputation": "Maior Reputação",
- "most_flags": "Most Flags",
+ "most_flags": "Mais Sinalizações",
"search": "Pesquisar",
"enter_username": "Digite um nome de usuário para pesquisar",
"load_more": "Carregar Mais",
diff --git a/public/language/tr/category.json b/public/language/tr/category.json
index 921003afaa..98a430ec0e 100644
--- a/public/language/tr/category.json
+++ b/public/language/tr/category.json
@@ -10,10 +10,10 @@
"share_this_category": "Bu kategoriyi paylaş",
"watch": "İzle",
"ignore": "Yoksay",
- "watching": "Watching",
- "ignoring": "Ignoring",
- "watching.description": "Show topics in unread",
- "ignoring.description": "Do not show topics in unread",
+ "watching": "İzleniyor",
+ "ignoring": "Yoksayılıyor",
+ "watching.description": "Okunmamış başlıkları göster",
+ "ignoring.description": "Okunmamış başlıkları gösterme",
"watch.message": "Şuan bu kategorideki güncellemeleri izliyorsunuz",
"ignore.message": "Şuan bu kategoriden güncellemeleri gizliyorsunuz",
"watched-categories": "Takip edilen kategoriler"
diff --git a/public/language/tr/global.json b/public/language/tr/global.json
index 3aafe7ce99..29be110719 100644
--- a/public/language/tr/global.json
+++ b/public/language/tr/global.json
@@ -50,9 +50,9 @@
"topics": "Başlık",
"posts": "İleti",
"best": "En İyi",
- "upvoters": "Upvoters",
+ "upvoters": "Artı",
"upvoted": "Artı",
- "downvoters": "Downvoters",
+ "downvoters": "Eksi",
"downvoted": "Eksi",
"views": "Görünüm",
"reputation": "Saygınlık",
diff --git a/public/language/tr/pages.json b/public/language/tr/pages.json
index e801393479..f3377dd1b4 100644
--- a/public/language/tr/pages.json
+++ b/public/language/tr/pages.json
@@ -29,7 +29,7 @@
"account/edit/password": "\"%1\" parolayı düzenliyor",
"account/edit/username": "\"%1\" kullanıcı adını düzenliyor",
"account/edit/email": "\"%1\" email adresini düzenliyor",
- "account/info": "Account Info",
+ "account/info": "Hesap Hakkında",
"account/following": "%1 tarafından takip edilenler",
"account/followers": "%1 takip edenler",
"account/posts": "%1 tarafından gönderilen iletiler",
diff --git a/public/language/tr/register.json b/public/language/tr/register.json
index 36e7b75786..9015743421 100644
--- a/public/language/tr/register.json
+++ b/public/language/tr/register.json
@@ -1,6 +1,6 @@
{
"register": "Kayıt Ol",
- "cancel_registration": "Cancel Registration",
+ "cancel_registration": "Kaydı İptal Et",
"help.email": "E-posta adresiniz varsayılan olarak topluluktan gizlidir.",
"help.username_restrictions": "%1 ve %2 karakter arası bir kullanıcı ismi. Başkaları sizden @isim kullanarak bahsedebilir.",
"help.minimum_password_length": "Şifreniz en az %1 karakter olmalı",
@@ -16,8 +16,8 @@
"alternative_registration": "Alternatif Kayıt",
"terms_of_use": "Kullanım Şartları",
"agree_to_terms_of_use": "Kullanım Şartlarını kabul ediyorum",
- "terms_of_use_error": "You must agree to the Terms of Use",
+ "terms_of_use_error": "Kullanım şartlarını kabul etmen gerekiyor",
"registration-added-to-queue": "Kayıt olma isteğiniz kabul listesine eklenmiştir. Yönetici tarafından kabul edildiğinizde mail alacaksınız.",
"interstitial.intro": "We require some additional information before we can create your account.",
- "interstitial.errors-found": "We could not complete your registration:"
+ "interstitial.errors-found": "Kaydınınız tamamlanmadı:"
}
\ No newline at end of file
From 514c12aa68c067d9c992ff2023f2b9d8cf13eea1 Mon Sep 17 00:00:00 2001
From: barisusakli
Date: Fri, 29 Jul 2016 16:26:27 +0300
Subject: [PATCH 15/25] closes #4885
---
public/language/en_GB/error.json | 1 +
public/src/app.js | 54 +++++++++++++++++---------------
src/middleware/header.js | 8 +++++
src/user/email.js | 5 +--
4 files changed, 40 insertions(+), 28 deletions(-)
diff --git a/public/language/en_GB/error.json b/public/language/en_GB/error.json
index 76b2bef1a8..fa73ccfa8a 100644
--- a/public/language/en_GB/error.json
+++ b/public/language/en_GB/error.json
@@ -25,6 +25,7 @@
"email-taken": "Email taken",
"email-not-confirmed": "Your email has not been confirmed yet, please click here to confirm your email.",
"email-not-confirmed-chat": "You are unable to chat until your email is confirmed, please click here to confirm your email.",
+ "email-not-confirmed-email-sent": "Your email has not been confirmed yet, please check your inbox for the confirmation email.",
"no-email-to-confirm": "This forum requires email confirmation, please click here to enter an email",
"email-confirm-failed": "We could not confirm your email, please try again later.",
"confirm-email-already-sent": "Confirmation email already sent, please wait %1 minute(s) to send another one.",
diff --git a/public/src/app.js b/public/src/app.js
index 8875bd2d64..e9b52ef0bf 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -473,33 +473,35 @@ app.cacheBuster = null;
if (!config.requireEmailConfirmation || !app.user.uid) {
return;
}
+ var msg = {
+ alert_id: 'email_confirm',
+ type: 'warning',
+ timeout: 0
+ };
+
if (!app.user.email) {
- app.alert({
- alert_id: 'email_confirm',
- message: '[[error:no-email-to-confirm]]',
- type: 'warning',
- timeout: 0,
- clickfn: function() {
- app.removeAlert('email_confirm');
- ajaxify.go('user/' + app.user.userslug + '/edit');
- }
- });
- } else if (!app.user['email:confirmed']) {
- app.alert({
- alert_id: 'email_confirm',
- message: err ? err.message : '[[error:email-not-confirmed]]',
- type: 'warning',
- timeout: 0,
- clickfn: function() {
- app.removeAlert('email_confirm');
- socket.emit('user.emailConfirm', {}, function(err) {
- if (err) {
- return app.alertError(err.message);
- }
- app.alertSuccess('[[notifications:email-confirm-sent]]');
- });
- }
- });
+ msg.message = '[[error:no-email-to-confirm]]';
+ msg.clickfn = function() {
+ app.removeAlert('email_confirm');
+ ajaxify.go('user/' + app.user.userslug + '/edit');
+ };
+ app.alert(msg);
+ } else if (!app.user['email:confirmed'] && !app.user.isEmailConfirmSent) {
+ msg.message = err ? err.message : '[[error:email-not-confirmed]]';
+ msg.clickfn = function() {
+ app.removeAlert('email_confirm');
+ socket.emit('user.emailConfirm', {}, function(err) {
+ if (err) {
+ return app.alertError(err.message);
+ }
+ app.alertSuccess('[[notifications:email-confirm-sent]]');
+ });
+ };
+
+ app.alert(msg);
+ } else if (!app.user['email:confirmed'] && app.user.isEmailConfirmSent) {
+ msg.message = '[[error:email-not-confirmed-email-sent]]';
+ app.alert(msg);
}
};
diff --git a/src/middleware/header.js b/src/middleware/header.js
index ef73610b92..4f25a55ca5 100644
--- a/src/middleware/header.js
+++ b/src/middleware/header.js
@@ -3,6 +3,7 @@
var async = require('async');
var nconf = require('nconf');
+var db = require('../database');
var user = require('../user');
var meta = require('../meta');
var plugins = require('../plugins');
@@ -94,6 +95,12 @@ module.exports = function(app, middleware) {
next(null, userData);
}
},
+ isEmailConfirmSent: function(next) {
+ if (!meta.config.requireEmailConfirmation || !req.uid) {
+ return next(null, false);
+ }
+ db.get('uid:' + req.uid + ':confirm:email:sent', next);
+ },
navigation: async.apply(navigation.get),
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags)
}, function(err, results) {
@@ -110,6 +117,7 @@ module.exports = function(app, middleware) {
results.user.isGlobalMod = results.isGlobalMod;
results.user.uid = parseInt(results.user.uid, 10);
results.user['email:confirmed'] = parseInt(results.user['email:confirmed'], 10) === 1;
+ results.user.isEmailConfirmSent = !!results.isEmailConfirmSent;
if (parseInt(meta.config.disableCustomUserSkins, 10) !== 1 && res.locals.config.bootswatchSkin !== 'default') {
templateValues.bootswatchCSS = '//maxcdn.bootstrapcdn.com/bootswatch/latest/' + res.locals.config.bootswatchSkin + '/bootstrap.min.css';
diff --git a/src/user/email.js b/src/user/email.js
index 4b98cc72aa..902d2ead73 100644
--- a/src/user/email.js
+++ b/src/user/email.js
@@ -28,8 +28,8 @@ var emailer = require('../emailer');
UserEmail.sendValidationEmail = function(uid, email, callback) {
callback = callback || function() {};
- var confirm_code = utils.generateUUID(),
- confirm_link = nconf.get('url') + '/confirm/' + confirm_code;
+ var confirm_code = utils.generateUUID();
+ var confirm_link = nconf.get('url') + '/confirm/' + confirm_code;
var emailInterval = meta.config.hasOwnProperty('emailConfirmInterval') ? parseInt(meta.config.emailConfirmInterval, 10) : 10;
@@ -97,6 +97,7 @@ var emailer = require('../emailer');
async.series([
async.apply(user.setUserField, confirmObj.uid, 'email:confirmed', 1),
async.apply(db.delete, 'confirm:' + code),
+ async.apply(db.delete, 'uid:' + confirmObj.uid + ':confirm:email:sent'),
function(next) {
db.sortedSetRemove('users:notvalidated', confirmObj.uid, next);
}
From 2cc804084ff02cdc586b7e10ab9ef222aea45726 Mon Sep 17 00:00:00 2001
From: barisusakli
Date: Fri, 29 Jul 2016 16:40:10 +0300
Subject: [PATCH 16/25] closes #4890
---
public/less/admin/header.less | 5 +++++
src/views/admin/partials/menu.tpl | 15 ++++++++-------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/public/less/admin/header.less b/public/less/admin/header.less
index 8ccf535c30..5dd2c21aa1 100644
--- a/public/less/admin/header.less
+++ b/public/less/admin/header.less
@@ -29,6 +29,11 @@
}
}
+ .fa-home {
+ margin-top: 12px;
+ font-size: 25px;
+ }
+
#user_dropdown {
font-size: 25px;
color: #eee;
diff --git a/src/views/admin/partials/menu.tpl b/src/views/admin/partials/menu.tpl
index 38c5e5eeb8..e35b41847c 100644
--- a/src/views/admin/partials/menu.tpl
+++ b/src/views/admin/partials/menu.tpl
@@ -118,15 +118,9 @@