mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
show admin link in header if user is admin, closes #459
This commit is contained in:
@@ -85,9 +85,20 @@ var express = require('express'),
|
||||
navigation: custom_header.navigation
|
||||
};
|
||||
|
||||
translator.translate(templates.header.parse(templateValues), function(template) {
|
||||
callback(null, template);
|
||||
});
|
||||
var uid = '0';
|
||||
|
||||
if(options.req.user && options.req.user.uid)
|
||||
uid = options.req.user.uid;
|
||||
|
||||
user.isAdministrator(uid, function(isAdmin) {
|
||||
templateValues.adminDisplay = isAdmin ? 'show' : 'hide';
|
||||
|
||||
translator.translate(templates.header.parse(templateValues), function(template) {
|
||||
callback(null, template);
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user