diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-10-06 20:16:13 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-10-06 20:16:13 +0000 |
commit | acd10739092cb0e1160733615aa24ddcd5fb87f1 (patch) | |
tree | 14e65c24102977c0eeba36e50628b736c316a390 /main | |
parent | 85625f350563ca7209001df4bd538627748725f9 (diff) |
simplify logic in preparation to reduce indentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/manager.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/main/manager.c b/main/manager.c index f0fa6400c..0a6b098e5 100644 --- a/main/manager.c +++ b/main/manager.c @@ -862,11 +862,13 @@ static int authenticate(struct mansession *s, struct message *m) cfg = ast_config_load("manager.conf"); if (!cfg) return -1; - cat = ast_category_browse(cfg, NULL); - while (cat) { - if (strcasecmp(cat, "general")) { - /* This is a user */ - if (!strcasecmp(cat, user)) { + cat = NULL; + while ( (cat = ast_category_browse(cfg, cat)) ) { + if (!strcasecmp(cat, "general") || strcasecmp(cat, user)) + continue; /* skip 'general' and non-matching sections */ + + /* XXX fix indentation */ + { struct ast_variable *v; struct ast_ha *ha = NULL; char *password = NULL; @@ -929,9 +931,7 @@ static int authenticate(struct mansession *s, struct message *m) ast_config_destroy(cfg); return -1; } - } } - cat = ast_category_browse(cfg, cat); } if (cat) { ast_copy_string(s->username, cat, sizeof(s->username)); |