mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 04:46:29 +00:00
Don't prompt for password if one is not needed (bug #2385)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3617,6 +3617,12 @@ static int vm_execmain(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
if (useadsi)
|
if (useadsi)
|
||||||
adsi_password(chan);
|
adsi_password(chan);
|
||||||
|
if (!skipuser)
|
||||||
|
vmu = find_user(&vmus, context, vms.username);
|
||||||
|
if (vmu && vmu->password[0] == '\0') {
|
||||||
|
/* saved password is blank, so don't bother asking */
|
||||||
|
password[0] = '\0';
|
||||||
|
} else {
|
||||||
if (ast_streamfile(chan, "vm-password", chan->language)) {
|
if (ast_streamfile(chan, "vm-password", chan->language)) {
|
||||||
ast_log(LOG_WARNING, "Unable to stream password file\n");
|
ast_log(LOG_WARNING, "Unable to stream password file\n");
|
||||||
goto out;
|
goto out;
|
||||||
@@ -3625,14 +3631,13 @@ static int vm_execmain(struct ast_channel *chan, void *data)
|
|||||||
ast_log(LOG_WARNING, "Unable to read password\n");
|
ast_log(LOG_WARNING, "Unable to read password\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
char fullusername[80] = "";
|
char fullusername[80] = "";
|
||||||
strncpy(fullusername, prefixstr, sizeof(fullusername) - 1);
|
strncpy(fullusername, prefixstr, sizeof(fullusername) - 1);
|
||||||
strncat(fullusername, vms.username, sizeof(fullusername) - 1);
|
strncat(fullusername, vms.username, sizeof(fullusername) - 1);
|
||||||
strncpy(vms.username, fullusername, sizeof(vms.username) - 1);
|
strncpy(vms.username, fullusername, sizeof(vms.username) - 1);
|
||||||
}
|
}
|
||||||
if (!skipuser)
|
|
||||||
vmu = find_user(&vmus, context, vms.username);
|
|
||||||
if (vmu && !strcmp(vmu->password, password))
|
if (vmu && !strcmp(vmu->password, password))
|
||||||
valid++;
|
valid++;
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user