From 3df14551c048728a9fa505fa4f25a8a22864edfe Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 18 Jul 2014 04:12:06 +0000 Subject: [PATCH] A1 Hash the extension and voicemail passwords'; --- app/extensions/resources/classes/extension.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/extensions/resources/classes/extension.php b/app/extensions/resources/classes/extension.php index c2c87a20a5..b03fe61ea1 100644 --- a/app/extensions/resources/classes/extension.php +++ b/app/extensions/resources/classes/extension.php @@ -167,6 +167,9 @@ $user_context = $_SESSION['domains'][$domain_uuid]['domain_name']; } + //get the domain_name + $domain_name = $_SESSION['domains'][$domain_uuid]['domain_name']; + //delete all old extensions to prepare for new ones $dialplan_list = glob($_SESSION['switch']['extensions']['dir']."/".$user_context."/v_*.xml"); foreach($dialplan_list as $name => $value) { @@ -200,6 +203,7 @@ } $call_timeout = $row['call_timeout']; $user_context = $row['user_context']; + $password = $row['password']; $voicemail_password = $row['voicemail_password']; //$voicemail_password = str_replace("#", "", $voicemail_password); //preserves leading zeros @@ -220,6 +224,10 @@ } } + //set the password hashes + $a1_hash = md5($extension.":".$domain_name.":".$password); + $vm_a1_hash = md5($extension.":".$domain_name.":".$voicemail_password); + $xml .= "\n"; $cidr = ''; if (strlen($row['cidr']) > 0) { @@ -231,10 +239,12 @@ } $xml .= " \n"; $xml .= " \n"; - $xml .= " \n"; + $xml .= " \n"; + //$xml .= " \n"; //voicemail settings - $xml .= " \n"; + $xml .= " \n"; + //$xml .= " \n"; switch ($row['voicemail_enabled']) { case "true": $xml .= " \n";