Firing new hook `filter:auth.list`

This new plugins allows SSO services to list whether a
user has authenticated via that service, and will display
as such in the user's profile editing screen.
v1.18.x
Julian Lam 9 years ago
parent fa109241cc
commit 78863a438f

@ -101,5 +101,9 @@
"grouptitle": "Select the group title you would like to display",
"no-group-title": "No group title",
"select-skin": "Select a Skin"
"select-skin": "Select a Skin",
"sso.title": "Single Sign-on Services",
"sso.associated": "Associated with",
"sso.not-associated": "Click here to associate with"
}

@ -49,7 +49,11 @@ function getUserDataByUserSlug(userslug, callerUID, callback) {
},
groups: function(next) {
groups.getUserGroups([uid], next);
}
},
sso: async.apply(plugins.fireHook, 'filter:auth.list', {
uid: uid,
associations: []
})
}, function(err, results) {
if (err || !results.userData) {
return callback(err || new Error('[[error:invalid-uid]]'));
@ -88,6 +92,7 @@ function getUserDataByUserSlug(userslug, callerUID, callback) {
userData.disableSignatures = meta.config.disableSignatures !== undefined && parseInt(meta.config.disableSignatures, 10) === 1;
userData['email:confirmed'] = !!parseInt(userData['email:confirmed'], 10);
userData.profile_links = results.profile_links;
userData.sso = results.sso.associations;
userData.status = require('../socket.io').isUserOnline(userData.uid) ? (userData.status || 'online') : 'offline';
userData.banned = parseInt(userData.banned, 10) === 1;
userData.website = validator.escape(userData.website);

@ -55,7 +55,7 @@ file.isFileTypeAllowed = function(path, allowedExtensions, callback) {
var uploadedFileExtension = mime.extension(mimeType);
if (allowedExtensions.indexOf(uploadedFileExtension) === -1) {
return callback(new Error('[[error:invalid-file-type, ' + allowedExtensions.join('-') + ']]'));
return callback(new Error('[[error:invalid-file-type, ' + allowedExtensions.join(', ') + ']]'));
}
callback();

Loading…
Cancel
Save