psychobunny 12 years ago
commit d622c9e100

@ -0,0 +1,18 @@
<h1>Account Settings</h1>
<div class="well">
<div class="alert" id="message" style="display:none">
<button type="button" class="close" data-dismiss="message">&times;</button>
<strong></strong>
<p></p>
</div>
<label for="email">Email Address</label><input type="text" placeholder="Enter Email Address" id="email" /><br />
<button class="btn btn-primary" id="reset" type="submit">Reset Password</button>
<p>
If you see this, you are logged in.
</p>
</div>
<script type="text/javascript">
(function() {
// ...
}());
</script>

@ -30,7 +30,7 @@
<li class="active"><a href="/">Forum</a></li> <li class="active"><a href="/">Forum</a></li>
</ul> </ul>
<ul class="nav pull-right" id="right-menu"> <ul class="nav pull-right" id="right-menu">
<li><a href="#" id="user_label"></a></li> <li><a href="/account" id="user_label"></a></li>
</ul> </ul>
</div> </div>
</div> </div>

@ -25,7 +25,7 @@
Templates.init = function() { Templates.init = function() {
loadTemplates([ loadTemplates([
'header', 'footer', 'register', 'home', 'topic', 'header', 'footer', 'register', 'home', 'topic', 'account',
'login', 'reset', 'reset_code', 'logout', 'login', 'reset', 'reset_code', 'logout',
'403', '403',
'emails/reset', 'emails/reset_plaintext' 'emails/reset', 'emails/reset_plaintext'

@ -78,14 +78,6 @@ passport.deserializeUser(function(uid, done) {
(function(app) { (function(app) {
var templates = global.templates; var templates = global.templates;
function refreshTemplates() {
//need a better solution than copying this code on every call. is there an "onconnect" event?
if (DEVELOPMENT === true) {
// refreshing templates
modules.templates.init();
}
}
// Middlewares // Middlewares
app.use(express.favicon()); // 2 args: string path and object options (i.e. expire time etc) app.use(express.favicon()); // 2 args: string path and object options (i.e. expire time etc)
app.use(require('less-middleware')({ src: path.join(__dirname, '../', '/public') })); app.use(require('less-middleware')({ src: path.join(__dirname, '../', '/public') }));
@ -259,8 +251,11 @@ passport.deserializeUser(function(uid, done) {
}); });
app.get('/account', function(req, res) { app.get('/account', function(req, res) {
refreshTemplates();
res.send(templates['header'] + templates['account_settings'] + templates['footer']); if (req.user === undefined)
return res.redirect('/403');
res.send(templates['header'] + templates['account'] + templates['footer']);
}); });
app.get('/users', function(req, res) { app.get('/users', function(req, res) {

Loading…
Cancel
Save