public function doConfigPageInit($page) { $request = $_REQUEST; isset($request['action']) ? $action = $request['action'] : ($action = ''); isset($request['view']) ? $view = $request['view'] : ($view = 'form'); isset($request['itemid']) ? $itemid = $request['itemid'] : ($itemid = ''); if (isset($request['action'])) { switch ($action) { case "add": cidlookup_add($request); needreload(); redirect_standard(); break; case "delete": cidlookup_del($itemid); needreload(); redirect_standard(); break; case "edit": cidlookup_edit($itemid, $request); needreload(); redirect_standard('itemid'); break; case "getJSON": switch ($request['jdata']) { case "cid_modules": header('Content-Type: application/json'); echo json_encode($this->cid_modules); exit; break; default: header('Content-Type: application/json'); echo json_encode(array('status' => 'ERROR', 'message' => 'Invalid Request')); exit; break; } break; } } }
// //This program is distributed in the hope that it will be useful, //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. isset($_REQUEST['action']) ? $action = $_REQUEST['action'] : ($action = ''); //the item we are currently displaying isset($_REQUEST['itemid']) ? $itemid = $_REQUEST['itemid'] : ($itemid = ''); $dispnum = "cidlookup"; //used for switch on config.php $tabindex = 0; //if submitting form, update database if (isset($_POST['action'])) { switch ($action) { case "add": cidlookup_add($_POST); needreload(); redirect_standard(); break; case "delete": cidlookup_del($itemid); needreload(); redirect_standard(); break; case "edit": cidlookup_edit($itemid, $_POST); needreload(); redirect_standard('itemid'); break; } }
$sql = "SELECT * FROM `cidlookup` WHERE `description` = 'Caller ID Superfecta' LIMIT 1;"; $res = $db->query($sql); if($res->numRows() != 1) { $cids_lookup_array = array( 'sourcetype' => 'http', 'cache' => 0, 'http_host' => 'localhost', 'http_path' => '/admin/modules/superfecta/bin/callerid.php', 'http_query' => 'thenumber=[NUMBER]', 'description' => 'Caller ID Superfecta', 'http_username' => $_SERVER["PHP_AUTH_USER"], 'http_password' => $_SERVER["PHP_AUTH_PW"] ); cidlookup_add($cids_lookup_array); print 'Adding Caller ID Superfecta Lookup Source.<br> <strong>You may need to add your "maint" user\'s<br> ID and Password in the General Options<br> section of the Caller ID Superfecta Module\'s<br> gui.</strong><br> Note: If your password contains any non<br> alphanumeric characters, you may need to<br> <a href="http://meyerweb.com/eric/tools/dencoder/" target="_blank">URL Encode</a> it first.<br> Hopfully this will be fixed in future<br> versions of FreePBX Caller ID Lookup.<br>'; } else { if($row = $res->fetchRow(DB_FETCHMODE_ASSOC)){