Fix password when the permission is not assigned

This commit is contained in:
FusionPBX 2025-02-07 17:34:01 -07:00 committed by GitHub
parent 8ab4b2b6c2
commit 9da6a9b19c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -401,6 +401,19 @@
//extension exists
}
else {
//password permission not assigned get the password from the database
if ($action == "update" && !permission_exists('extension_password')) {
$sql = "select password from v_extensions ";
$sql .= "where extension_uuid = :extension_uuid ";
$sql .= "and domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $domain_uuid;
$parameters['extension_uuid'] = $extension_uuid;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
$password = $row["password"];
}
unset($sql, $parameters, $row);
}
//get the password length and strength
$password_length = $_SESSION["extension"]["password_length"]["numeric"];