From 227666087c89aeee8abfcb0de97d52e0ba4633b8 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 21 Oct 2016 15:43:58 +0100 Subject: [PATCH] don't show register when external auth is used --- server-ce/package.json | 3 ++- server-ce/settings.coffee | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server-ce/package.json b/server-ce/package.json index e1efb9b159..d3c19d112f 100644 --- a/server-ce/package.json +++ b/server-ce/package.json @@ -7,6 +7,7 @@ "grunt-contrib-rename": "0.0.3", "grunt-docker-io": "^0.7.0", "grunt-github-api": "^0.2.3", - "simple-git": "^1.32.1" + "simple-git": "^1.32.1", + "underscore": "^1.8.3" } } diff --git a/server-ce/settings.coffee b/server-ce/settings.coffee index c9d99521bd..81395d8b2e 100644 --- a/server-ce/settings.coffee +++ b/server-ce/settings.coffee @@ -1,4 +1,5 @@ Path = require('path') +_ = require("underscore") # These credentials are used for authenticating api requests # between services that may need to go over public channels @@ -391,6 +392,7 @@ if parse(process.env["SHARELATEX_IS_SERVER_PRO"]) == true if process.env["SHARELATEX_LDAP_HOST"] + settings.externalAuth = true settings.ldap = host: process.env["SHARELATEX_LDAP_HOST"] dn: process.env["SHARELATEX_LDAP_DN"] @@ -424,6 +426,9 @@ if process.env["SHARELATEX_LDAP_HOST"] rejectUnauthorized: process.env["SHARELATEX_LDAP_TLS_OPTS_REJECT_UNAUTH"] == "true" ca:ca_paths # e.g.'/etc/ldap/ca_certs.pem' +if settings.externalAuth + settings.nav.header = _.filter settings.nav.header, (button)-> button.url != "/register" + # Compiler # -------- if process.env["SANDBOXED_COMPILES"] == "true"