* XMPP sessions now honor the nologin flag. Resolves bug #421.
authorArt Cancro <ajc@citadel.org>
Wed, 11 Feb 2009 01:46:19 +0000 (01:46 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 11 Feb 2009 01:46:19 +0000 (01:46 +0000)
citadel/modules/jabber/xmpp_sasl_service.c

index 78eab97fc6dc7c2cf1a54fdb68170738f5b9e29f..6497f8101ca4db4aa405ce01437b2e39304856c6 100644 (file)
@@ -118,7 +118,13 @@ void xmpp_sasl_auth(char *sasl_auth_mech, char *authstring) {
 
         if (CC->logged_in) logout();  /* Client may try to log in twice.  Handle this. */
 
-       if (xmpp_auth_plain(authstring) == 0) {
+       if (CC->nologin) {
+               cprintf("<failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">");
+               cprintf("<system-shutdown/>");
+               cprintf("</failure>");
+       }
+
+       else if (xmpp_auth_plain(authstring) == 0) {
                cprintf("<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"/>");
        }