Ticket #3053: cidfix.patch
| File cidfix.patch, 5.0 kB (added by p_lindheimer, 4 years ago) |
|---|
-
page.did.php
old new 333 333 warnInvalid(theForm.extension, msgConfirmDIDNoSlash); 334 334 return false; 335 335 } 336 if (!isDialpattern(theForm.cidnum.value) )336 if (!isDialpattern(theForm.cidnum.value) && theForm.cidnum.value != "Private" && theForm.cidnum.value != "Blocked" && theForm.cidnum.value != "Unknown" && theForm.cidnum.value != "Restricted" && theForm.cidnum.value != "Unavailable") 337 337 return warnInvalid(theForm.cidnum, msgInvalidCIDNum); 338 338 339 339 if (!isEmail(theForm.faxemail.value)) -
functions.inc.php
old new 2514 2514 $newdid_name = isset($newdid_name) ? addslashes($newdid_name) : ''; 2515 2515 $newdid = isset($newdid) ? $newdid : ''; 2516 2516 $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 2517 2517 2518 $newdidcid = isset($newdidcid) ? $newdidcid : ''; 2518 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdidcid)); 2519 $newdidcid = trim($newdidcid); 2520 switch ($newdidcid) { 2521 case 'Unknown': 2522 case 'Private': 2523 case 'Blocked': 2524 case 'Restricted': 2525 case 'Unavailable': 2526 break; 2527 default: 2528 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 2529 break; 2530 } 2519 2531 2520 2532 // Well more ugliness since the javascripts are already in here 2521 2533 if ($newdid != '' || $newdidcid != '') { … … 2750 2762 $newdid_name = isset($newdid_name) ? addslashes($newdid_name) : ''; 2751 2763 $newdid = isset($vars['newdid']) ? $vars['newdid'] : ''; 2752 2764 $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 2765 2753 2766 $newdidcid = isset($vars['newdidcid']) ? $vars['newdidcid'] : ''; 2754 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdidcid)); 2767 $newdidcid = trim($newdidcid); 2768 switch ($newdidcid) { 2769 case 'Unknown': 2770 case 'Private': 2771 case 'Blocked': 2772 case 'Restricted': 2773 case 'Unavailable': 2774 break; 2775 default: 2776 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 2777 break; 2778 } 2755 2779 2756 2780 // Well more ugliness since the javascripts are already in here 2757 2781 if ($newdid != '' || $newdidcid != '') { … … 4041 4065 } 4042 4066 $currentcomponent->setoptlistopts('ringtime', 'sort', false); 4043 4067 4068 // Special CID handling to deal with Private, etc. 4069 // 4070 $js = 'if (isDialpattern(mycid) || mycid == "Private" || mycid == "Blocked" || mycid == "Unknown" || mycid == "Restricted" || mycid == "Unavailable") { return true } else { return false };'; 4071 $currentcomponent->addjsfunc('isValidCID(mycid)', $js); 4072 4044 4073 // Add the 'proces' functions 4045 4074 $currentcomponent->addguifunc('core_users_configpageload'); 4046 4075 // Ensure users is called in middle order ($sortorder = 5), this is to allow … … 4134 4163 $msgInvalidDispName = _("Please enter a valid Display Name"); 4135 4164 $msgInvalidOutboundCID = _("Please enter a valid Outbound CID"); 4136 4165 $msgInvalidPause = _("Please enter a valid pause time in seconds, using digits only"); 4137 $msgInvalidDIDNum = _("You have entered a non-standard dialpattern for your DID. You can only enter standard dialpatterns. You must use the inbound routing form to enter non-standard patterns");4166 $msgInvalidDIDNum = _("You have entered a non-standard dialpattern for your DID. You can only enter standard dialpatterns. You must use the inbound routing form to enter non-standard patterns"); 4138 4167 $msgInvalidCIDNum = _("Please enter a valid Caller ID Number or leave it blank for your Assigned DID/CID pair"); 4139 4168 4140 4169 // This is the actual gui stuff … … 4204 4233 $section = _("Assigned DID/CID"); 4205 4234 $currentcomponent->addguielem($section, new gui_textbox('newdid_name', $newdid_name, _("DID Description"), _("A description for this DID, such as \"Fax\"")), 4); 4206 4235 $currentcomponent->addguielem($section, new gui_textbox('newdid', $newdid, _("Add Inbound DID"), _("A direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>.An optional CID can also be associated with this DID by setting the next box"),'!isDialpattern()',$msgInvalidDIDNum,true), 4); 4207 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A CID must be specified in the above Add DID box"),'!isDialpattern()',$msgInvalidCIDNum,true), 4); 4236 //$currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A CID must be specified in the above Add DID box"),'!isDialpattern()',$msgInvalidCIDNum,true), 4); 4237 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A CID must be specified in the above Add DID box"),"!frm_${display}_isValidCID()",$msgInvalidCIDNum,true), 4); 4208 4238 4209 4239 $dids = core_did_list('extension'); 4210 4240 $did_count = 0;
