mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 07:11:17 +08:00
Merge pull request #957 from chrishunt/chrishunt/lock-down-the-base
Add 'login required' site setting
This commit is contained in:
@ -166,6 +166,16 @@ Discourse = Ember.Application.createWithMixins({
|
||||
return loginController.authenticationComplete(options);
|
||||
},
|
||||
|
||||
loginRequired: function() {
|
||||
return (
|
||||
Discourse.SiteSettings.login_required && !Discourse.User.current()
|
||||
);
|
||||
}.property(),
|
||||
|
||||
redirectIfLoginRequired: function(route) {
|
||||
if(this.get('loginRequired')) { route.transitionTo('login'); }
|
||||
},
|
||||
|
||||
/**
|
||||
Our own $.ajax method. Makes sure the .then method executes in an Ember runloop
|
||||
for performance reasons. Also automatically adjusts the URL to support installs
|
||||
|
Reference in New Issue
Block a user