X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fxmpp%2Fxmpp_sasl_service.c;fp=citadel%2Fmodules%2Fxmpp%2Fxmpp_sasl_service.c;h=e7ad1a2b19f40e035750d0d2b750a9abc8957856;hp=5e53ceb4cc08d6d60bc4221a0ab34fbddab6b48c;hb=e7c125bafc3bd24fd9cfb18c39b29abd19c7478f;hpb=2975015a8e6b00893a0ba003f3b086132fb858c8
diff --git a/citadel/modules/xmpp/xmpp_sasl_service.c b/citadel/modules/xmpp/xmpp_sasl_service.c
index 5e53ceb4c..e7ad1a2b1 100644
--- a/citadel/modules/xmpp/xmpp_sasl_service.c
+++ b/citadel/modules/xmpp/xmpp_sasl_service.c
@@ -127,9 +127,9 @@ int xmpp_auth_plain(char *authstring)
* Output the list of SASL mechanisms offered by this stream.
*/
void xmpp_output_auth_mechs(void) {
- XPUT(""
- "PLAIN"
- "");
+ cprintf("");
+ cprintf("PLAIN");
+ cprintf("");
}
/*
@@ -138,28 +138,28 @@ void xmpp_output_auth_mechs(void) {
void xmpp_sasl_auth(char *sasl_auth_mech, char *authstring) {
if (strcasecmp(sasl_auth_mech, "PLAIN")) {
- XPUT(""
- ""
- "");
+ cprintf("");
+ cprintf("");
+ cprintf("");
return;
}
if (CC->logged_in) CtdlUserLogout(); /* Client may try to log in twice. Handle this. */
if (CC->nologin) {
- XPUT(""
- ""
- "");
+ cprintf("");
+ cprintf("");
+ cprintf("");
}
else if (xmpp_auth_plain(authstring) == 0) {
- XPUT("");
+ cprintf("");
}
else {
- XPUT(""
- ""
- "");
+ cprintf("");
+ cprintf("");
+ cprintf("");
}
}
@@ -168,8 +168,9 @@ void xmpp_sasl_auth(char *sasl_auth_mech, char *authstring) {
/*
* Non-SASL authentication
*/
-void xmpp_non_sasl_authenticate(StrBuf *IQ_id, char *username, char *password, char *resource) {
+void xmpp_non_sasl_authenticate(char *iq_id, char *username, char *password, char *resource) {
int result;
+ char xmlbuf[256];
if (CC->logged_in) CtdlUserLogout(); /* Client may try to log in twice. Handle this. */
@@ -177,23 +178,16 @@ void xmpp_non_sasl_authenticate(StrBuf *IQ_id, char *username, char *password, c
if (result == login_ok) {
result = CtdlTryPassword(password, strlen(password));
if (result == pass_ok) {
- XPrint(HKEY("iq"), XCLOSED,
- XCPROPERTY("type", "result"),
- XSPROPERTY("ID", IQ_id),
- TYPE_ARGEND);
- /* success */
+ cprintf("", xmlesc(xmlbuf, iq_id, sizeof xmlbuf)); /* success */
return;
}
}
/* failure */
- XPrint(HKEY("iq"), 0,
- XCPROPERTY("type", "error"),
- XSPROPERTY("ID", IQ_id),
- TYPE_ARGEND);
- XPUT(""
- ""
- ""
- ""
+ cprintf("", xmlesc(xmlbuf, iq_id, sizeof xmlbuf));
+ cprintf(""
+ ""
+ ""
+ ""
);
}