Made the 'New User' button disappear when it is not allowed.
authorArt Cancro <ajc@citadel.org>
Thu, 2 Mar 2006 04:05:02 +0000 (04:05 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 2 Mar 2006 04:05:02 +0000 (04:05 +0000)
webcit/auth.c
webcit/serv_func.c
webcit/static/login.html
webcit/webcit.h

index eec2a691271e2e06cd8bb8ccf380a5b814ff5bd0..0f594e163105f87dc7f0e78d5d844945bc133499 100644 (file)
@@ -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, "<div style=\"display:none;\">");
+               svprintf("NEWUSER_BUTTON_POST", WCS_STRING, "</div>");
+       }
+       else {
+               svprintf("NEWUSER_BUTTON_PRE", WCS_STRING, "");
+               svprintf("NEWUSER_BUTTON_POST", WCS_STRING, "");
+       }
 
        do_template("login");
 
index 9f946ddbc19e27266f0ed9471f976986cc78a6c9..05574c2660b41b70d7a1a857758adf3d2a89bece 100644 (file)
@@ -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;
        }
index c2692c817f0dc32eed2807197b7d225e961dcacc..6ec9261b39399073f53aa6dd7d8e80f588fe2228 100644 (file)
@@ -17,7 +17,9 @@
 
        <tr><td align=center colspan=2>
        <input type="submit" name="login_action" value="<?LOGIN_BUTTON>">
+       <?NEWUSER_BUTTON_PRE>
        <input type="submit" name="newuser_action" value="<?NEWUSER_BUTTON>">
+       <?NEWUSER_BUTTON_POST>
        <input type="submit" name="exit_action" value="<?EXIT_BUTTON>">
        </td></tr>
 
index dc6791d4e921180ee331a11fd725fc78c925b645..869979a68538ff3c4b7cb2ffe2a4432cf3a127e0 100644 (file)
@@ -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? */
 };