mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-13 04:57:05 +00:00
MDXMLINT-54
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14580 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
eb3e186b17
commit
b24a2863c0
1 file changed
+15
-5
@@ -253,8 +253,17 @@ static abyss_bool is_authorized (const TSession *r, const char *command)
|
|||||||
int argc;
|
int argc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!r || !r->requestInfo.user)
|
if (!r) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (switch_strlen_zero(globals.realm) && switch_strlen_zero(globals.user)) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!r->requestInfo.user) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
user = strdup(r->requestInfo.user);
|
user = strdup(r->requestInfo.user);
|
||||||
|
|
||||||
@@ -263,15 +272,16 @@ static abyss_bool is_authorized (const TSession *r, const char *command)
|
|||||||
domain_name = dp;
|
domain_name = dp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!switch_strlen_zero(globals.realm) && !switch_strlen_zero(globals.user) && !strcmp(user, globals.user)) {
|
||||||
|
switch_safe_free(user);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (switch_strlen_zero(user) || switch_strlen_zero(domain_name)) {
|
if (switch_strlen_zero(user) || switch_strlen_zero(domain_name)) {
|
||||||
switch_safe_free(user);
|
switch_safe_free(user);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!switch_strlen_zero(globals.realm) && !switch_strlen_zero(globals.user) && !strcmp(user, globals.user)) {
|
|
||||||
switch_safe_free(user);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!user_attributes (user, domain_name, NULL, NULL, NULL, &allowed_commands)) {
|
if (!user_attributes (user, domain_name, NULL, NULL, NULL, &allowed_commands)) {
|
||||||
switch_safe_free(user);
|
switch_safe_free(user);
|
||||||
|
|||||||
Reference in new issue
Block a user