mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 03:18:30 +00:00
simplify logic in preparation to reduce indentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -862,11 +862,13 @@ static int authenticate(struct mansession *s, struct message *m)
|
|||||||
cfg = ast_config_load("manager.conf");
|
cfg = ast_config_load("manager.conf");
|
||||||
if (!cfg)
|
if (!cfg)
|
||||||
return -1;
|
return -1;
|
||||||
cat = ast_category_browse(cfg, NULL);
|
cat = NULL;
|
||||||
while (cat) {
|
while ( (cat = ast_category_browse(cfg, cat)) ) {
|
||||||
if (strcasecmp(cat, "general")) {
|
if (!strcasecmp(cat, "general") || strcasecmp(cat, user))
|
||||||
/* This is a user */
|
continue; /* skip 'general' and non-matching sections */
|
||||||
if (!strcasecmp(cat, user)) {
|
|
||||||
|
/* XXX fix indentation */
|
||||||
|
{
|
||||||
struct ast_variable *v;
|
struct ast_variable *v;
|
||||||
struct ast_ha *ha = NULL;
|
struct ast_ha *ha = NULL;
|
||||||
char *password = NULL;
|
char *password = NULL;
|
||||||
@@ -931,8 +933,6 @@ static int authenticate(struct mansession *s, struct message *m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cat = ast_category_browse(cfg, cat);
|
|
||||||
}
|
|
||||||
if (cat) {
|
if (cat) {
|
||||||
ast_copy_string(s->username, cat, sizeof(s->username));
|
ast_copy_string(s->username, cat, sizeof(s->username));
|
||||||
s->readperm = get_perm(ast_variable_retrieve(cfg, cat, "read"));
|
s->readperm = get_perm(ast_variable_retrieve(cfg, cat, "read"));
|
||||||
|
|||||||
Reference in New Issue
Block a user