Ticket #3266: secret_same_as_extension.3.patch
| File secret_same_as_extension.3.patch, 2.8 kB (added by acaley, 3 years ago) |
|---|
-
amp_conf/htdocs/admin/modules/core/functions.inc.php
old new 4076 4076 $msgInvalidChannel = _("Please enter the channel for this device"); 4077 4077 $msgConfirmSecret = _("You have not entered a Secret for this device, although this is possible it is generally bad practice to not assign a Secret to a device. Are you sure you want to leave the Secret empty?"); 4078 4078 $msgInvalidSecret = _("Please enter a Secret for this device"); 4079 4079 4080 $msgSecretSameAsExtension = _("You have set your secret and device/extension to the same value. This can be a serious security vulnerability resulting in a hacker compromising your system to make free phone calls. There are many known instances where this has already occurred"); 4081 4080 4082 // zap 4081 4083 $tmparr = array(); 4082 4084 $tmparr['channel'] = array('value' => '', 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel); … … 4094 4096 $tmparr['mailbox'] = array('value' => '', 'level' => 1); 4095 4097 $currentcomponent->addgeneralarrayitem('devtechs', 'zap', $tmparr); 4096 4098 unset($tmparr); 4097 4099 4100 if ($_REQUEST['extdisplay']) $ext = $_REQUEST['extdisplay']; 4101 else $ext = 'document.getElementById("deviceid").value'; 4102 4098 4103 // iax2 4099 4104 $tmparr = array(); 4100 $tmparr['secret'] = array('value' => '', 'level' => 0, 'jsvalidation' => 'isEmpty() && !confirm("'.$msgConfirmSecret.'")', 'failvalidationmsg' => $msgInvalidSecret);4105 $tmparr['secret'] = array('value' => '', 'level' => 0, 'jsvalidation' => '(' . $ext . ' == theForm.devinfo_secret.value && !confirm("' . $msgSecretSameAsExtension . '")) || isEmpty() && !confirm("'.$msgConfirmSecret.'")', 'failvalidationmsg' => $msgInvalidSecret); 4101 4106 $tmparr['notransfer'] = array('value' => 'yes', 'level' => 1); 4102 4107 $tmparr['context'] = array('value' => 'from-internal', 'level' => 1); 4103 4108 $tmparr['host'] = array('value' => 'dynamic', 'level' => 1); … … 4114 4119 4115 4120 // sip 4116 4121 $tmparr = array(); 4117 $tmparr['secret'] = array('value' => '', 'level' => 0, 'jsvalidation' => ' isEmpty() && !confirm("'.$msgConfirmSecret.'")', 'failvalidationmsg' => $msgInvalidSecret);4122 $tmparr['secret'] = array('value' => '', 'level' => 0, 'jsvalidation' => '(' . $ext . ' == theForm.devinfo_secret.value && !confirm("' . $msgSecretSameAsExtension . '")) || isEmpty() && !confirm("'.$msgConfirmSecret.'")', 'failvalidationmsg' => $msgInvalidSecret); 4118 4123 $tmparr['dtmfmode'] = array('value' => 'rfc2833', 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidDTMFMODE ); 4119 4124 $tmparr['canreinvite'] = array('value' => 'no', 'level' => 1); 4120 4125 $tmparr['context'] = array('value' => 'from-internal', 'level' => 1);
