Example #1
0
 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;
         }
     }
 }
Example #2
0
$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;
    }
}
//get list of callerid lookup sources
$cidsources = cidlookup_list();
?>

</div> <!-- end content div so we can display rnav properly-->

<!-- right side menu -->
<div class="rnav"><ul>
    <li><a id="<?php 
echo $itemid == '' ? 'current' : '';
		'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)){
		$row['http_path'] = '/admin/modules/superfecta/bin/callerid.php';
		$row['sourcetype'] = 'http';
		$row['cache'] = '0';
		$row['http_query'] = 'thenumber=[NUMBER]';
		$row['description'] = 'Caller ID Superfecta';
		$row['http_host'] = 'localhost';
		cidlookup_edit($row['cidlookup_id'],$row);
	}
}
?>