mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-20 15:05:43 +00:00
Rename setting and use Features.hasFeatures
This commit is contained in:
parent
dd619f44dd
commit
5bb06915cc
2 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
logger = require('logger-sharelatex')
|
||||
Settings = require('settings-sharelatex')
|
||||
_ = require('underscore')
|
||||
Features = require "../../infrastructure/Features"
|
||||
|
||||
Path = require "path"
|
||||
fs = require "fs"
|
||||
|
@ -21,7 +22,7 @@ module.exports = HomeController =
|
|||
HomeController.home(req, res)
|
||||
|
||||
home: (req, res)->
|
||||
if Settings.showHomepage and homepageExists
|
||||
if Features.hasFeature('homepage') and homepageExists
|
||||
res.render 'external/home'
|
||||
else
|
||||
res.redirect "/login"
|
||||
|
|
|
@ -6,6 +6,8 @@ module.exports = Features =
|
|||
|
||||
hasFeature: (feature) ->
|
||||
switch feature
|
||||
when 'homepage'
|
||||
return Settings.enableHomepage
|
||||
when 'registration'
|
||||
return not Features.externalAuthenticationSystemUsed()
|
||||
when 'github-sync'
|
||||
|
|
Loading…
Add table
Reference in a new issue