diff --git a/public/src/app.js b/public/src/app.js index 435e667cb1..0fdd83a550 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -126,14 +126,6 @@ var socket, // Posting jQuery('#post_window').slideToggle(0); - - // Logout - logoutEl.addEventListener('click', function() { - socket.emit('api:user.logout'); - }); - socket.on('api:user.logout', function(data) { - if (data.status === 'ok') alert('Logged out.'); - }); }) diff --git a/public/templates/403.tpl b/public/templates/403.tpl new file mode 100644 index 0000000000..4cbd7e91dc --- /dev/null +++ b/public/templates/403.tpl @@ -0,0 +1,4 @@ +<div class="alert alert-error"> + <strong>Access Denied</strong> + <p>You seem to have stumbled upon a page that you do not have access to. Perhaps you should <a href="/login">try logging in?</a></p> +</div> \ No newline at end of file diff --git a/public/templates/header.tpl b/public/templates/header.tpl index bc132a5004..6c0a7e95bc 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -117,7 +117,8 @@ <li><a href="/login">Login</a></li> </ul> <ul class="nav pull-right"> - <li><a href="/logout" id="logout">Log out</a></li> + <li><a href="/account">Account</a></li> + <li><a href="/logout">Log out</a></li> </ul> </div> </div> diff --git a/src/templates.js b/src/templates.js index 4cd4ae86bf..c66932fcff 100644 --- a/src/templates.js +++ b/src/templates.js @@ -27,7 +27,7 @@ var fs = require('fs'); loadTemplates([ 'header', 'footer', 'register', 'home', 'login', 'reset', 'reset_code', 'account_settings', - 'logout', + 'logout', '403', 'emails/reset', 'emails/reset_plaintext' ]); } diff --git a/src/webserver.js b/src/webserver.js index 82381a5121..683dcd7e98 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -103,7 +103,7 @@ var express = require('express'), }); app.get('/403', function(req, res) { - res.send(403, 'You are not authorized to view this page'); + res.send(templates['header'] + templates['403'] + templates['footer']); }); module.exports.init = function() {