public function doConfigPageInit($page) { switch ($page) { case 'fax': $request = $_REQUEST; $get_vars = array('ecm' => '', 'fax_rx_email' => '', 'force_detection' => 'no', 'headerinfo' => '', 'legacy_mode' => 'no', 'localstationid' => '', 'maxrate' => '', 'minrate' => '', 'modem' => '', 'sender_address' => '', 'papersize' => 'letter'); foreach ($get_vars as $k => $v) { $fax[$k] = isset($request[$k]) ? $request[$k] : $v; } // get/put options if (isset($request['action']) && $request['action'] == 'edit') { fax_save_settings($fax); } break; case "did": $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; $cidnum = isset($_REQUEST['cidnum']) ? $_REQUEST['cidnum'] : ''; $extension = isset($_REQUEST['extension']) ? $_REQUEST['extension'] : ''; $extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : ''; $enabled = isset($_REQUEST['faxenabled']) ? $_REQUEST['faxenabled'] : 'false'; $detection = isset($_REQUEST['faxdetection']) ? $_REQUEST['faxdetection'] : ''; $ring = isset($_REQUEST['faxring']) ? $_REQUEST['faxring'] : ''; $detectionwait = isset($_REQUEST['faxdetectionwait']) ? $_REQUEST['faxdetectionwait'] : ''; $dest = isset($_REQUEST['gotoFAX']) ? $_REQUEST['gotoFAX'] . 'FAX' : null; $dest = isset($_REQUEST[$dest]) ? $_REQUEST[$dest] : ''; if ($enabled != 'legacy') { $legacy_email = null; } else { $legacy_email = isset($_REQUEST['legacy_email']) ? $_REQUEST['legacy_email'] : ''; } switch ($action) { case "edtIncoming": fax_delete_incoming($extdisplay); //fall through to next level on purpose //fall through to next level on purpose case "addIncoming": if ($enabled != 'false') { fax_save_incoming($cidnum, $extension, $enabled, $detection, $detectionwait, $dest, $legacy_email, $ring); } break; case "delIncoming": fax_delete_incoming($extdisplay); break; } break; } }
/** * Updates the fax settings * @verb POST * @returns - the freshly created settings * @uri /fax */ function post_fax($params) { return fax_save_settings($params); }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ $tabindex = 0; // get/put options if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') { needreload(); $options = array("headerinfo", "localstationid", "ecm", "maxrate", "minrate", "modem", "sender_address", "fax_rx_email"); foreach ($options as $option) { $fax[$option] = isset($_REQUEST[$option]) ? $_REQUEST[$option] : ''; } $fax['legacy_mode'] = isset($_REQUEST['legacy_mode']) ? $_REQUEST['legacy_mode'] : 'no'; $fax['force_detection'] = isset($_REQUEST['force_detection']) ? $_REQUEST['force_detection'] : 'no'; fax_save_settings($fax); } else { $fax = fax_get_settings(); $fax['legacy_mode'] = isset($fax['legacy_mode']) ? $fax['legacy_mode'] : 'no'; $fax['force_detection'] = isset($fax['force_detection']) ? $fax['force_detection'] : 'no'; $action = ''; //no action to do } $fax_detect = fax_detect(); ?> <h2><?php echo _("Fax Options"); ?> </h2> <form name=edit enctype="multipart/form-data" action="<?php