diff --git a/services/web/app/coffee/Features/StaticPages/HomeController.coffee b/services/web/app/coffee/Features/StaticPages/HomeController.coffee index c1a8c46323..9a8f5ced41 100755 --- a/services/web/app/coffee/Features/StaticPages/HomeController.coffee +++ b/services/web/app/coffee/Features/StaticPages/HomeController.coffee @@ -1,5 +1,7 @@ logger = require('logger-sharelatex') +Settings = require('settings-sharelatex') _ = require('underscore') +Features = require "../../infrastructure/Features" Path = require "path" fs = require "fs" @@ -20,12 +22,11 @@ module.exports = HomeController = HomeController.home(req, res) home: (req, res)-> - if homepageExists + if Features.hasFeature('homepage') and homepageExists res.render 'external/home' else res.redirect "/login" - externalPage: (page, title) -> return (req, res, next = (error) ->) -> path = Path.resolve(__dirname + "/../../../views/external/#{page}.pug") diff --git a/services/web/app/coffee/infrastructure/Features.coffee b/services/web/app/coffee/infrastructure/Features.coffee index e4a8fefbe8..7047826bbb 100644 --- a/services/web/app/coffee/infrastructure/Features.coffee +++ b/services/web/app/coffee/infrastructure/Features.coffee @@ -6,7 +6,11 @@ module.exports = Features = hasFeature: (feature) -> switch feature + when 'homepage' + return Settings.enableHomepage when 'registration' return not Features.externalAuthenticationSystemUsed() + when 'github-sync' + return Settings.enableGithubSync else throw new Error("unknown feature: #{feature}")