From 00d7b29a56dd23f39589743b9640207c70a14a78 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 28 Jul 2017 16:31:26 -0600 Subject: [PATCH] Update provision.php --- app/provision/resources/classes/provision.php | 138 +++++++++--------- 1 file changed, 67 insertions(+), 71 deletions(-) diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php index c58e34e514..690cd17695 100644 --- a/app/provision/resources/classes/provision.php +++ b/app/provision/resources/classes/provision.php @@ -544,81 +544,77 @@ include "root.php"; } else { //use the user_agent to pre-assign a template for 1-hit provisioning. Enter the a unique string to match in the user agent, and the template it should match. - $template_list=array( - "Linksys/SPA-2102"=>"linksys/spa2102", - "Linksys/SPA-3102"=>"linksys/spa3102", - "Linksys/SPA-9212"=>"linksys/spa921", - "Cisco/SPA301"=>"cisco/spa301", - "Cisco/SPA301D"=>"cisco/spa302d", - "Cisco/SPA303"=>"cisco/spa303", - "Cisco/SPA501G"=>"cisco/spa501g", - "Cisco/SPA502G"=>"cisco/spa502g", - "Cisco/SPA504G"=>"cisco/spa504g", - "Cisco/SPA508G"=>"cisco/spa508g", - "Cisco/SPA509G"=>"cisco/spa509g", - "Cisco/SPA512G"=>"cisco/spa512g", - "Cisco/SPA514G"=>"cisco/spa514g", - "Cisco/SPA525G2"=>"cisco/spa525g2", - "snom300-SIP"=>"snom/300", - "snom320-SIP"=>"snom/320", - "snom360-SIP"=>"snom/360", - "snom370-SIP"=>"snom/370", - "snom820-SIP"=>"snom/820", - "snom-m3-SIP"=>"snom/m3", - "yealink SIP-CP860"=>"yealink/cp860", - "yealink SIP-T19p"=>"yealink/t19p", - "yealink SIP-T20p"=>"yealink/t20p", - "yealink SIP-T21p"=>"yealink/t21p", - "yealink SIP-T22p"=>"yealink/t22p", - "yealink SIP-T23p"=>"yealink/t23p", - "yealink SIP-T23g"=>"yealink/t23g", - "yealink SIP-T27g"=>"yealink/t27g", - "yealink SIP-T26p"=>"yealink/t26p", - "yealink SIP-T28p"=>"yealink/t28p", - "yealink SIP-T29p"=>"yealink/t29p", - "Yealink SIP-T32g"=>"yealink/t32g", - "Yealink SIP-T38g"=>"yealink/t38g", - "Yealink SIP-T40p"=>"yealink/t40p", - "Yealink SIP-T41p"=>"yealink/t41p", - "Yealink SIP-T41g"=>"yealink/t41g", - "Yealink SIP-T41s"=>"yealink/t41s", - "Yealink SIP-T42g"=>"yealink/t42g", - "Yealink SIP-T46g"=>"yealink/t46g", - "Yealink SIP-T46s"=>"yealink/t46s", - "Yealink SIP-T48g"=>"yealink/t48g", - "Yealink SIP-T48s"=>"yealink/t48s", - "Yealink SIP-T49g"=>"yealink/t49g", - "Yealink SIP-VP530"=>"yealink/vp530", - "Yealink SIP-W52p"=>"yealink/w52p", - "Yealink SIP-W56p"=>"yealink/w56p", - "HW DP750"=>"grandstream/dp750", - "HW GXP1450"=>"grandstream/gxp1450", - "HW GXP1628"=>"grandstream/gxp16xx", - "HW GXP1610"=>"grandstream/gxp16xx", - "HW GXP1620"=>"grandstream/gxp16xx", - "HW GXP1625"=>"grandstream/gxp16xx", - "HW GXP1628"=>"grandstream/gxp16xx", - "HW GXP1630"=>"grandstream/gxp16xx", - "HW GXP2124"=>"grandstream/gxp2124", - "HW GXP2130"=>"grandstream/gxp2130", - "HW GXP2135"=>"grandstream/gxp2135", - "HW GXP2140"=>"grandstream/gxp2140", - "HW GXP2160"=>"grandstream/gxp2160", - "HW GXP2170"=>"grandstream/gxp2170", - "HW GXV3140"=>"grandstream/gxv3140", - "HW GXV3240"=>"grandstream/gxv3240", - "HW GXV3175"=>"grandstream/gxv3175", - "Vesa VCS754"=>"vtech/vcs754", - "Wget/1.11.3"=>"konftel/kt300ip" - ); - - foreach ($template_list as $key=>$val){ + $templates['Linksys/SPA-2102'] = 'linksys/spa2102'; + $templates['Linksys/SPA-3102'] = 'linksys/spa3102'; + $templates['Linksys/SPA-9212'] = 'linksys/spa921'; + $templates['Cisco/SPA301'] = 'cisco/spa301'; + $templates['Cisco/SPA301D'] = 'cisco/spa302d'; + $templates['Cisco/SPA303'] = 'cisco/spa303'; + $templates['Cisco/SPA501G'] = 'cisco/spa501g'; + $templates['Cisco/SPA502G'] = 'cisco/spa502g'; + $templates['Cisco/SPA504G'] = 'cisco/spa504g'; + $templates['Cisco/SPA508G'] = 'cisco/spa508g'; + $templates['Cisco/SPA509G'] = 'cisco/spa509g'; + $templates['Cisco/SPA512G'] = 'cisco/spa512g'; + $templates['Cisco/SPA514G'] = 'cisco/spa514g'; + $templates['Cisco/SPA525G2'] = 'cisco/spa525g2'; + $templates['snom300-SIP'] = 'snom/300'; + $templates['snom320-SIP'] = 'snom/320'; + $templates['snom360-SIP'] = 'snom/360'; + $templates['snom370-SIP'] = 'snom/370'; + $templates['snom820-SIP'] = 'snom/820'; + $templates['snom-m3-SIP'] = 'snom/m3'; + $templates['yealink SIP-CP860'] = 'yealink/cp860'; + $templates['yealink SIP-T19p'] = 'yealink/t19p'; + $templates['yealink SIP-T20p'] = 'yealink/t20p'; + $templates['yealink SIP-T21p'] = 'yealink/t21p'; + $templates['yealink SIP-T22p'] = 'yealink/t22p'; + $templates['yealink SIP-T23p'] = 'yealink/t23p'; + $templates['yealink SIP-T23g'] = 'yealink/t23g'; + $templates['yealink SIP-T27g'] = 'yealink/t27g'; + $templates['yealink SIP-T26p'] = 'yealink/t26p'; + $templates['yealink SIP-T28p'] = 'yealink/t28p'; + $templates['yealink SIP-T29p'] = 'yealink/t29p'; + $templates['Yealink SIP-T32g'] = 'yealink/t32g'; + $templates['Yealink SIP-T38g'] = 'yealink/t38g'; + $templates['Yealink SIP-T40p'] = 'yealink/t40p'; + $templates['Yealink SIP-T41p'] = 'yealink/t41p'; + $templates['Yealink SIP-T41g'] = 'yealink/t41g'; + $templates['Yealink SIP-T41s'] = 'yealink/t41s'; + $templates['Yealink SIP-T42g'] = 'yealink/t42g'; + $templates['Yealink SIP-T46g'] = 'yealink/t46g'; + $templates['Yealink SIP-T46s'] = 'yealink/t46s'; + $templates['Yealink SIP-T48g'] = 'yealink/t48g'; + $templates['Yealink SIP-T48s'] = 'yealink/t48s'; + $templates['Yealink SIP-T49g'] = 'yealink/t49g'; + $templates['Yealink SIP-VP530'] = 'yealink/vp530'; + $templates['Yealink SIP-W52p'] = 'yealink/w52p'; + $templates['Yealink SIP-W56p'] = 'yealink/w56p'; + $templates['HW DP750'] = 'grandstream/dp750'; + $templates['HW GXP1450'] = 'grandstream/gxp1450'; + $templates['HW GXP1628'] = 'grandstream/gxp16xx'; + $templates['HW GXP1610'] = 'grandstream/gxp16xx'; + $templates['HW GXP1620'] = 'grandstream/gxp16xx'; + $templates['HW GXP1625'] = 'grandstream/gxp16xx'; + $templates['HW GXP1630'] = 'grandstream/gxp16xx'; + $templates['HW GXP2124'] = 'grandstream/gxp2124'; + $templates['HW GXP2130'] = 'grandstream/gxp2130'; + $templates['HW GXP2135'] = 'grandstream/gxp2135'; + $templates['HW GXP2140'] = 'grandstream/gxp2140'; + $templates['HW GXP2160'] = 'grandstream/gxp2160'; + $templates['HW GXP2170'] = 'grandstream/gxp2170'; + $templates['HW GXV3140'] = 'grandstream/gxv3140'; + $templates['HW GXV3240'] = 'grandstream/gxv3240'; + $templates['HW GXV3175'] = 'grandstream/gxv3175'; + $templates['Vesa VCS754'] = 'vtech/vcs754'; + $templates['Wget/1.11.3'] = 'konftel/kt300ip'; + foreach ($templates as $key=>$value){ if(stripos($_SERVER['HTTP_USER_AGENT'],$key)!== false) { - $device_template = $val; + $device_template = $value; break; } } - unset($template_list); + unset($templates); //mac address does not exist in the table so add it if ($_SESSION['provision']['auto_insert_enabled']['boolean'] == "true" and strlen($domain_uuid) > 0) {