[Freeswitch-svn] [commit] r10199 - freeswitch/trunk/src/mod/xml_int/mod_xml_rpc

Freeswitch SVN anthm at freeswitch.org
Wed Oct 29 20:52:12 EDT 2008


Author: anthm
Date: Wed Oct 29 20:52:11 2008
New Revision: 10199

Modified:
   freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c

Log:
apply patch from MODAPP-156

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	(original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	Wed Oct 29 20:52:11 2008
@@ -245,22 +245,24 @@
 					}
 				}
 
-				if (!(mypass1 && mypass2)) {
+				if (!switch_strlen_zero(mypass2) && !strcasecmp(mypass2, "user-choose")) {
+					mypass2 = NULL;
+				}
+
+				if (!mypass1) {
 					r->requestInfo.user = strdup(user);
 					goto authed;
 				} else {
-					if (mypass1) {
-						if (at) {
-							switch_snprintf(z, sizeof(z), "%s@%s:%s", user, domain_name, mypass1);
-						} else {
-							switch_snprintf(z, sizeof(z), "%s:%s", user, mypass1);
-						}
-						Base64Encode(z, t);
+					if (at) {
+						switch_snprintf(z, sizeof(z), "%s@%s:%s", user, domain_name, mypass1);
+					} else {
+						switch_snprintf(z, sizeof(z), "%s:%s", user, mypass1);
+					}
+					Base64Encode(z, t);
 
-						if (!strcmp(p, t)) {
-							r->requestInfo.user = strdup(box ? box : user);
-							goto authed;
-						}
+					if (!strcmp(p, t)) {
+						r->requestInfo.user = strdup(box ? box : user);
+						goto authed;
 					}
 
 					if (mypass2) {
@@ -278,18 +280,16 @@
 					}
 
 					if (box) {
-						if (mypass1) {
-							if (at) {
-								switch_snprintf(z, sizeof(z), "%s@%s:%s", box, domain_name, mypass1);
-							} else {
-								switch_snprintf(z, sizeof(z), "%s:%s", box, mypass1);
-							}
-							Base64Encode(z, t);
+						if (at) {
+							switch_snprintf(z, sizeof(z), "%s@%s:%s", box, domain_name, mypass1);
+						} else {
+							switch_snprintf(z, sizeof(z), "%s:%s", box, mypass1);
+						}
+						Base64Encode(z, t);
 
-							if (!strcmp(p, t)) {
-								r->requestInfo.user = strdup(box);
-								goto authed;
-							}
+						if (!strcmp(p, t)) {
+							r->requestInfo.user = strdup(box);
+							goto authed;
 						}
 
 						if (mypass2) {



More information about the Freeswitch-svn mailing list