reduce a level of indentation

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@101745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2008-02-01 06:20:24 +00:00
parent 7382e9425f
commit 574b5e2a2e

View File

@@ -119,8 +119,15 @@ static int auth_exec(struct ast_channel *chan, void *data)
for (retries = 0; retries < 3; retries++) {
if ((res = ast_app_getdata(chan, prompt, passwd, maxdigits, 0)) < 0)
break;
res = 0;
if (arglist.password[0] == '/') {
if (arglist.password[0] != '/') {
/* Compare against a fixed password */
if (!strcmp(passwd, arglist.password))
break;
}
if (ast_test_flag(&flags,OPT_DATABASE)) {
char tmp[256];
/* Compare against a database key */
@@ -146,10 +153,9 @@ static int auth_exec(struct ast_channel *chan, void *data)
buf[strlen(buf) - 1] = '\0';
if (ast_test_flag(&flags,OPT_MULTIPLE)) {
md5secret = strchr(buf, ':');
if (md5secret == NULL)
if (!md5secret)
continue;
*md5secret = '\0';
md5secret++;
*md5secret++ = '\0';
ast_md5_hash(md5passwd, passwd);
if (!strcmp(md5passwd, md5secret)) {
if (ast_test_flag(&flags,OPT_ACCOUNT))
@@ -165,7 +171,9 @@ static int auth_exec(struct ast_channel *chan, void *data)
}
}
}
fclose(f);
if (!ast_strlen_zero(buf)) {
if (ast_test_flag(&flags,OPT_MULTIPLE)) {
if (md5secret && !strcmp(md5passwd, md5secret))
@@ -176,13 +184,9 @@ static int auth_exec(struct ast_channel *chan, void *data)
}
}
}
} else {
/* Compare against a fixed password */
if (!strcmp(passwd, arglist.password))
break;
}
prompt = "auth-incorrect";
}
if ((retries < 3) && !res) {
if (ast_test_flag(&flags,OPT_ACCOUNT) && !ast_test_flag(&flags,OPT_MULTIPLE))
ast_cdr_setaccount(chan, passwd);