From c79411ec7ea9267ae762ee7decc4f72d63870b03 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 2 Mar 2006 04:05:02 +0000 Subject: [PATCH] Made the 'New User' button disappear when it is not allowed. --- webcit/auth.c | 8 ++++++++ webcit/serv_func.c | 3 +++ webcit/static/login.html | 2 ++ webcit/webcit.h | 1 + 4 files changed, 14 insertions(+) diff --git a/webcit/auth.c b/webcit/auth.c index eec2a6912..0f594e163 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -75,6 +75,14 @@ void display_login(char *mesg) svprintf("BOXTITLE", WCS_STRING, _("%s - powered by Citadel"), serv_info.serv_humannode); svcallback("DO_LANGUAGE_BOX", offer_languages); + if (serv_info.serv_newuser_disabled) { + svprintf("NEWUSER_BUTTON_PRE", WCS_STRING, "
"); + svprintf("NEWUSER_BUTTON_POST", WCS_STRING, "
"); + } + else { + svprintf("NEWUSER_BUTTON_PRE", WCS_STRING, ""); + svprintf("NEWUSER_BUTTON_POST", WCS_STRING, ""); + } do_template("login"); diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 9f946ddbc..05574c266 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -86,6 +86,9 @@ void get_serv_info(char *browser_host, char *user_agent) case 14: serv_info.serv_supports_ldap = atoi(buf); break; + case 15: + serv_info.serv_newuser_disabled = atoi(buf); + break; } ++a; } diff --git a/webcit/static/login.html b/webcit/static/login.html index c2692c817..6ec9261b3 100644 --- a/webcit/static/login.html +++ b/webcit/static/login.html @@ -17,7 +17,9 @@ + + diff --git a/webcit/webcit.h b/webcit/webcit.h index dc6791d4e..869979a68 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -231,6 +231,7 @@ struct serv_info { char serv_moreprompt[SIZ]; /**< Whats the commandline textprompt */ int serv_ok_floors; /**< nonzero == server supports floors */ int serv_supports_ldap; /**< is the server linked against an ldap tree for adresses? */ + int serv_newuser_disabled; /**< Has the server disabled self-service new user creation? */ }; -- 2.39.2