users.conf: Remove deprecated users.conf integration.

users.conf was deprecated in Asterisk 21 and is now being removed
for Asterisk 23, in accordance with the Asterisk deprecation policy.

This consists of:
* Removing integration with app_directory, app_voicemail, chan_dahdi,
  chan_iax2, and AMI.
* users.conf was also partially used for res_phoneprov, and this remaining
  functionality is consolidated to a separate phoneprov_users.conf,
  used only by res_phoneprov.

Resolves: #1292

UpgradeNote: users.conf has been removed and all channel drivers must
be configured using their specific configuration files. The functionality
previously in users.conf for res_phoneprov is now in phoneprov_users.conf.
This commit is contained in:
Naveen Albert
2025-07-09 09:30:43 -04:00
committed by github-actions[bot]
parent 5963e624e2
commit 415daae95f
13 changed files with 82 additions and 728 deletions

View File

@@ -193,39 +193,6 @@ sub check_login($$)
}
}
close(VMAIL);
return check_login_users();
}
sub check_login_users {
my ($mbox, $context) = split(/\@/, param('mailbox'));
my $pass = param('password');
my ($found, $fullname) = (0, "");
open VMAIL, "</etc/asterisk/users.conf";
while (<VMAIL>) {
chomp;
if (m/\[(.*)\]/) {
if ($1 eq $mbox) {
$found = 1;
} elsif ($found == 2) {
close VMAIL;
return (($fullname ? $fullname : "Extension $mbox in $context"), $context);
} else {
$found = 0;
}
} elsif ($found) {
my ($var, $value) = split /\s*=\s*/, $_, 2;
if ($var eq 'vmsecret' and $value eq $pass) {
$found = 2;
} elsif ($var eq 'fullname') {
$fullname = $value;
if ($found == 2) {
close VMAIL;
return ($fullname, $context);
}
}
}
}
close VMAIL;
return ("", "");
}