Baris Soner Usakli 11 years ago
commit fac2cd9464

@ -52,12 +52,6 @@ define(function() {
});
document.querySelector('#content input').focus();
if(!config.emailSetup)
$('#reset-link').addClass('hide');
else
$('#reset-link').removeClass('hide');
};
return Login;

@ -1097,7 +1097,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
var insertAfter = findInsertionPoint();
parseAndTranslatePosts(data.posts, function(translatedHTML) {
parseAndTranslatePosts(data, function(translatedHTML) {
var translated = $(translatedHTML);
if(!infiniteLoaded) {
@ -1112,8 +1112,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
});
}
function parseAndTranslatePosts(posts, callback) {
var html = templates.prepare(templates['topic'].blocks['posts']).parse({posts: posts});
function parseAndTranslatePosts(data, callback) {
var html = templates.prepare(templates['topic'].blocks['posts']).parse(data);
var regexp = new RegExp("<!--[\\s]*IF @first[\\s]*-->([\\s\\S]*?)<!--[\\s]*ENDIF @first[\\s]*-->", 'g');
html = html.replace(regexp, '');

@ -41,7 +41,10 @@
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<hr />
<button class="btn btn-primary btn-lg btn-block" id="login" type="submit">[[login:login]]</button> &nbsp; <a id="reset-link" class="hide" href="{relative_path}/reset">[[login:forgot_password]]</a>
<button class="btn btn-primary btn-lg btn-block" id="login" type="submit">[[login:login]]</button>
<!-- IF showResetLink -->
&nbsp; <a id="reset-link" href="{relative_path}/reset">[[login:forgot_password]]</a>
<!-- ENDIF showResetLink -->
</div>
</div>
<input type="hidden" name="_csrf" value="{token}" id="csrf-token" />

@ -202,6 +202,10 @@ var fs = require('fs'),
} else return;
};
Plugins.hasListeners = function(hook) {
return (Plugins.loadedHooks[hook] && Plugins.loadedHooks[hook].length > 0);
};
Plugins.fireHook = function(hook, args, callback) {
hookList = Plugins.loadedHooks[hook];

@ -11,10 +11,11 @@ var path = require('path'),
posts = require('../posts'),
categories = require('../categories'),
categoryTools = require('../categoryTools')
meta = require('../meta'),
Plugins = require('../plugins'),
utils = require('../../public/src/utils'),
translator = require('../../public/src/translator'),
pkg = require('../../package.json'),
meta = require('../meta');
pkg = require('../../package.json');
(function (Api) {
@ -46,7 +47,6 @@ var path = require('path'),
config.topicsPerPage = meta.config.topicsPerPage || 20;
config.postsPerPage = meta.config.postsPerPage || 20;
config.maximumFileSize = meta.config.maximumFileSize;
config.emailSetup = !!meta.config['email:from'];
config.defaultLang = meta.config.defaultLang || 'en';
res.json(200, config);
@ -116,7 +116,8 @@ var path = require('path'),
app.get('/login', function (req, res) {
var data = {},
login_strategies = auth.get_login_strategies(),
num_strategies = login_strategies.length;
num_strategies = login_strategies.length,
emailersPresent = Plugins.hasListeners('action:email.send');
if (num_strategies == 0) {
data = {
@ -131,8 +132,8 @@ var path = require('path'),
}
data.authentication = login_strategies;
data.token = res.locals.csrf_token;
data.showResetLink = emailersPresent;
res.json(data);
});

@ -1,6 +1,9 @@
var topics = require('../topics'),
threadTools = require('../threadTools'),
index = require('./index'),
async = require('async'),
SocketTopics = {};
SocketTopics.post = function(socket, data, callback) {
@ -236,12 +239,15 @@ SocketTopics.loadMore = function(socket, data, callback) {
var start = data.after,
end = start + postsPerPage - 1;
topics.getTopicPosts(data.tid, start, end, socket.uid, function(err, posts) {
if(err) {
return callback(err);
async.parallel({
posts: function(next) {
topics.getTopicPosts(data.tid, start, end, socket.uid, next);
},
privileges: function(next) {
threadTools.privileges(data.tid, socket.uid, next);
}
callback(err, {posts: posts});
}, function(err, results) {
callback(err, results);
});
};

@ -886,6 +886,10 @@ var bcrypt = require('bcrypt'),
User.email = {
verify: function(uid, email) {
if (!plugins.hasListeners('action:email.send')) {
return;
}
var confirm_code = utils.generateUUID(),
confirm_link = nconf.get('url') + '/confirm/' + confirm_code;

Loading…
Cancel
Save