MDXMLINT-45 Allow setting of global realm without a global user
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10920 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
e6db92f66b
commit
c071132041
|
@ -95,11 +95,13 @@ static switch_status_t do_config(void)
|
||||||
if (!globals.port) {
|
if (!globals.port) {
|
||||||
globals.port = 8080;
|
globals.port = 8080;
|
||||||
}
|
}
|
||||||
if (user && pass && realm) {
|
if (realm) {
|
||||||
set_global_realm(realm);
|
set_global_realm(realm);
|
||||||
|
if (user && pass) {
|
||||||
set_global_user(user);
|
set_global_user(user);
|
||||||
set_global_pass(pass);
|
set_global_pass(pass);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
switch_xml_free(xml);
|
switch_xml_free(xml);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -194,6 +196,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!switch_strlen_zero(globals.user)) {
|
||||||
switch_snprintf(z, sizeof(z), "%s:%s", globals.user, globals.pass);
|
switch_snprintf(z, sizeof(z), "%s:%s", globals.user, globals.pass);
|
||||||
Base64Encode(z, t);
|
Base64Encode(z, t);
|
||||||
|
|
||||||
|
@ -201,6 +204,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
||||||
r->requestInfo.user = strdup(user);
|
r->requestInfo.user = strdup(user);
|
||||||
goto authed;
|
goto authed;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||||
switch_assert(params);
|
switch_assert(params);
|
||||||
|
@ -496,7 +500,7 @@ abyss_bool handler_hook(TSession * r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fs_user || !strcmp(fs_user, globals.user)) {
|
if (!fs_user || (!switch_strlen_zero(globals.user) && !strcmp(fs_user, globals.user))) {
|
||||||
auth = 1;
|
auth = 1;
|
||||||
} else {
|
} else {
|
||||||
if (!j) {
|
if (!j) {
|
||||||
|
|
Loading…
Reference in New Issue