Changeset 8609
- Timestamp:
- 01/14/10 13:16:51 (3 years ago)
- Files:
-
- modules/branches/2.7/fax/functions.inc.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.7/fax/functions.inc.php
r8608 r8609 34 34 35 35 $currentcomponent->addguielem($section, new gui_checkbox('faxenabled',$faxenabled,_('Enabled'), _('Enable this user to recive faxes'),'true','',$toggleemail)); 36 $currentcomponent->addguielem($section, new gui_textbox('faxemail', $faxemail, _('Fax Email'), _('Enter an email address where faxes sent to this extension will be delivered.'), '!isEmail()', _('Please Enter a valid email address for fax delivery.'), TRUE, '', ($faxenabled == ' true')?'':'true'));36 $currentcomponent->addguielem($section, new gui_textbox('faxemail', $faxemail, _('Fax Email'), _('Enter an email address where faxes sent to this extension will be delivered.'), '!isEmail()', _('Please Enter a valid email address for fax delivery.'), TRUE, '', ($faxenabled == 'yes')?'':'true')); 37 37 } 38 38 } … … 65 65 function fax_delete_incoming($extdisplay){ 66 66 $opts=explode('/', $extdisplay);$extension=$opts['0'];$cidnum=$opts['1']; //set vars 67 sql("DELETE FROM fax_incoming WHERE cidnum = '". mysql_real_escape_string($cidnum)."' and extension = '".mysql_real_escape_string($extension)."'");67 sql("DELETE FROM fax_incoming WHERE cidnum = '".escapeSimple($cidnum)."' and extension = '".escapeSimple($extension)."'"); 68 68 } 69 69 … … 267 267 $fax=fax_detect(); 268 268 if(!$fax['module']){//error message if there are no modules loaded in asterisk 269 $html .= '<table><tr><td><style>.faxerror{color:red; '.(($faxenabled == ' false')?'':'display: none;').'}</style><span class=faxerror>'._('It seems that you dont have fax receving modules installed in Asterisk or Asterisk is unreachable.<br/> Fax-related dialplan will <strong>NOT</strong> be generated!<br /> Please contact your vendor for more information.').'</span></td></tr></table>';269 $html .= '<table><tr><td><style>.faxerror{color:red; '.(($faxenabled == 'no')?'':'display: none;').'}</style><span class=faxerror>'._('It seems that you dont have fax receving modules installed in Asterisk or Asterisk is unreachable.<br/> Fax-related dialplan will <strong>NOT</strong> be generated!<br /> Please contact your vendor for more information.').'</span></td></tr></table>'; 270 270 } 271 271 if($fax['module'] == 'res_fax' && $fax['license'] < 1){//error message if there are no fax licenses 272 $html .= '<table><tr><td><style>.faxerror{color:red; '.(($faxenabled == ' false')?'':'display: none;').'}</style><span class=faxerror>'._('It seems that you dont have any fax licenses on this system. Fax-related dialplan will <strong>NOT</strong> be generated!<br /> Please contact your vendor for more information.').'</span></td></tr></table>';272 $html .= '<table><tr><td><style>.faxerror{color:red; '.(($faxenabled == 'no')?'':'display: none;').'}</style><span class=faxerror>'._('It seems that you dont have any fax licenses on this system. Fax-related dialplan will <strong>NOT</strong> be generated!<br /> Please contact your vendor for more information.').'</span></td></tr></table>'; 273 273 } 274 274 $html .= '<tr>'; … … 289 289 }"; 290 290 $html .= '<td><input type="radio" name="faxenabled" value="false" CHECKED onclick="'.$js.'"/>No'; 291 $html .= '<input type="radio" name="faxenabled" value="true" '.(($faxenabled == ' true')?'CHECKED':'').' onclick="'.$js.'"/>Yes</td></tr>';291 $html .= '<input type="radio" name="faxenabled" value="true" '.(($faxenabled == 'yes')?'CHECKED':'').' onclick="'.$js.'"/>Yes</td></tr>'; 292 292 $html .= '</table>'; 293 293 … … 366 366 //remove mature entry on edit or delete 367 367 if (isset($action) && (($action == 'edtIncoming')||($action == 'delIncoming')) ){fax_delete_incoming($extdisplay);} 368 if (isset($faxenabled, $extension) && $faxenabled == ' true'){368 if (isset($faxenabled, $extension) && $faxenabled == 'yes'){ 369 369 fax_save_incoming($cidnum,$extension,$faxenabled,$faxdetection,$faxdetectionwait,$$dest); 370 370 } … … 374 374 375 375 function fax_save_incoming($cidnum,$extension,$faxenabled,$faxdetection,$faxdetectionwait,$dest){ 376 sql("INSERT INTO fax_incoming (cidnum, extension, faxenabled, faxdetection, faxdetectionwait, faxdestination) VALUES ('". mysql_real_escape_string($cidnum)."', '".mysql_real_escape_string($extension)."', '".mysql_real_escape_string($faxenabled)."', '".mysql_real_escape_string($faxdetection)."', '".mysql_real_escape_string($faxdetectionwait)."', '".mysql_real_escape_string($dest)."')");376 sql("INSERT INTO fax_incoming (cidnum, extension, faxenabled, faxdetection, faxdetectionwait, faxdestination) VALUES ('".escapeSimple($cidnum)."', '".escapeSimple($extension)."', '".escapeSimple($faxenabled)."', '".escapeSimple($faxdetection)."', '".escapeSimple($faxdetectionwait)."', '".escapeSimple($dest)."')"); 377 377 } 378 378 379 379 function fax_save_settings($settings){ 380 380 foreach($settings as $key => $value){ 381 sql("REPLACE INTO fax_details (`key`, `value`) VALUES ('".$key."','". mysql_real_escape_string($value)."')");381 sql("REPLACE INTO fax_details (`key`, `value`) VALUES ('".$key."','".escapeSimple($value)."')"); 382 382 } 383 383 } 384 384 385 385 function fax_save_user($faxext,$faxenabled,$faxemail){ 386 $faxext= mysql_real_escape_string($faxext);387 $faxenabled= mysql_real_escape_string($faxenabled);388 $faxemail= mysql_real_escape_string($faxemail);386 $faxext=escapeSimple($faxext); 387 $faxenabled=escapeSimple($faxenabled); 388 $faxemail=escapeSimple($faxemail); 389 389 sql('REPLACE INTO fax_users (user, faxenabled, faxemail) VALUES ("'.$faxext.'","'.$faxenabled.'","'.$faxemail.'")'); 390 390 }
