mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #138 from sharelatex/ja-disable-github
Add feature flag for github sync
This commit is contained in:
commit
fae2d7dbdd
2 changed files with 7 additions and 2 deletions
|
@ -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")
|
||||
|
|
|
@ -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}")
|
||||
|
|
Loading…
Reference in a new issue