v1.18.x
barisusakli 10 years ago
parent 22e20b961e
commit 7ae7c50f56

@ -85,12 +85,15 @@ var socket,
reconnecting = false;
socket.on('event:connect', function (data) {
// TODO : deprecate in 0.7.0, use app.user
app.username = data.username;
app.userslug = data.userslug;
app.picture = data.picture;
app.uid = data.uid;
app.isAdmin = data.isAdmin;
app.user = data;
templates.setGlobal('loggedIn', parseInt(data.uid, 10) !== 0);
app.showLoginMessage();

@ -463,7 +463,7 @@ define('composer', dependencies, function(taskbar, controls, uploads, formatting
function showEmailConfirmAlert(err) {
app.alert({
id: 'email_confirm',
alert_id: 'email_confirm',
title: '[[global:alert.error]]',
message: err.message,
type: 'danger',

@ -65,7 +65,7 @@ function onConnect(socket) {
async.parallel({
user: function(next) {
user.getUserFields(socket.uid, ['username', 'userslug', 'picture', 'status'], next);
user.getUserFields(socket.uid, ['username', 'userslug', 'picture', 'status', 'email:confirmed'], next);
},
isAdmin: function(next) {
user.isAdministrator(socket.uid, next);
@ -74,13 +74,10 @@ function onConnect(socket) {
if (err || !userData.user) {
return;
}
socket.emit('event:connect', {
username: userData.user.username,
userslug: userData.user.userslug,
picture: userData.user.picture,
isAdmin: userData.isAdmin,
uid: socket.uid
});
userData.user.uid = socket.uid;
userData.user.isAdmin = userData.isAdmin;
userData.user['email:confirmed'] = parseInt(userData.user['email:confirmed'], 10) === 1;
socket.emit('event:connect', userData.user);
socket.broadcast.emit('event:user_status_change', {uid: socket.uid, status: userData.user.status});
});

@ -66,6 +66,8 @@ var async = require('async'),
plugins.fireHook('action:user.verify', {uid: uid, data: data});
} else if (plugins.hasListeners('action:email.send')) {
emailer.send('welcome', uid, data);
} else {
winston.warn('No emailer to send verification email!');
}
});
});

Loading…
Cancel
Save