提交 7afabe3c authored 作者: Anthony Minessale's avatar Anthony Minessale

apply patch from MODAPP-156

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10199 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 0a5a5172
...@@ -245,22 +245,24 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name) ...@@ -245,22 +245,24 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
} }
} }
if (!(mypass1 && mypass2)) { if (!switch_strlen_zero(mypass2) && !strcasecmp(mypass2, "user-choose")) {
mypass2 = NULL;
}
if (!mypass1) {
r->requestInfo.user = strdup(user); r->requestInfo.user = strdup(user);
goto authed; goto authed;
} else { } else {
if (mypass1) { if (at) {
if (at) { switch_snprintf(z, sizeof(z), "%s@%s:%s", user, domain_name, mypass1);
switch_snprintf(z, sizeof(z), "%s@%s:%s", user, domain_name, mypass1); } else {
} else { switch_snprintf(z, sizeof(z), "%s:%s", user, mypass1);
switch_snprintf(z, sizeof(z), "%s:%s", user, mypass1); }
} Base64Encode(z, t);
Base64Encode(z, t);
if (!strcmp(p, t)) { if (!strcmp(p, t)) {
r->requestInfo.user = strdup(box ? box : user); r->requestInfo.user = strdup(box ? box : user);
goto authed; goto authed;
}
} }
if (mypass2) { if (mypass2) {
...@@ -278,18 +280,16 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name) ...@@ -278,18 +280,16 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
} }
if (box) { if (box) {
if (mypass1) { if (at) {
if (at) { switch_snprintf(z, sizeof(z), "%s@%s:%s", box, domain_name, mypass1);
switch_snprintf(z, sizeof(z), "%s@%s:%s", box, domain_name, mypass1); } else {
} else { switch_snprintf(z, sizeof(z), "%s:%s", box, mypass1);
switch_snprintf(z, sizeof(z), "%s:%s", box, mypass1); }
} Base64Encode(z, t);
Base64Encode(z, t);
if (!strcmp(p, t)) { if (!strcmp(p, t)) {
r->requestInfo.user = strdup(box); r->requestInfo.user = strdup(box);
goto authed; goto authed;
}
} }
if (mypass2) { if (mypass2) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论