Skip to content

Node.js based forum software built for the modern web

plugins - filter:admin.header.build (pre-existing hook) now allows you to add menu items to the social authentication panel as well

psychobunnyc16f04bbcf37
diff --git a/public/templates/admin/header.tpl b/public/templates/admin/header.tpl
index 9e9e393984..786b8bcfaa 100644
--- a/public/templates/admin/header.tpl
+++ b/public/templates/admin/header.tpl
@@ -116,6 +116,11 @@
<li><a href='{relative_path}/admin/twitter'><i class='fa fa-twitter-square'></i> Twitter</a></li>
<li><a href='{relative_path}/admin/facebook'><i class='fa fa-facebook-square'></i> Facebook</a></li>
<li><a href='{relative_path}/admin/gplus'><i class='fa fa-google-plus-square'></i> Google+</a></li>
+ <!-- BEGIN authentication -->
+ <li>
+ <a href='{relative_path}/admin{authentication.route}'><i class="fa {authentication.icon}"></i> {authentication.name}</a>
+ </li>
+ <!-- END authentication -->
</ul>
</div>
<div class="well sidebar-nav">
diff --git a/src/routes/admin.js b/src/routes/admin.js
index ec3d8b8c80..e3d4a23db1 100644
--- a/src/routes/admin.js
+++ b/src/routes/admin.js
@@ -21,7 +21,8 @@ var user = require('./../user.js'),
Admin.buildHeader = function (req, res, callback) {
var custom_header = {
- 'plugins': []
+ 'plugins': [],
+ 'authentication': []
};
user.getUserFields(req.user.uid, ['username', 'userslug', 'picture'], function(err, userData) {
@@ -31,6 +32,7 @@ var user = require('./../user.js'),
csrf: res.locals.csrf_token,
relative_path: nconf.get('relative_path'),
plugins: custom_header.plugins,
+ authentication: custom_header.authentication,
userpicture: userData.picture,
username: userData.username,
userslug: userData.userslug