diff --git a/callsearch.phtml b/callsearch.phtml index b6677c5..9927862 100644 --- a/callsearch.phtml +++ b/callsearch.phtml @@ -1,103 +1,106 @@ "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm" ) ); -$loginname=$auth->auth["uname"]; +$loginname = $auth->auth["uname"]; $perm->check('callsearch'); $export = isset($_REQUEST['export']) ? $_REQUEST['export'] : ''; $cdr_source = isset($_REQUEST["cdr_source"]) ? $_REQUEST['cdr_source'] : ''; $trace = isset($_REQUEST["trace"])? $_REQUEST['trace'] : ''; $action = isset($_REQUEST["action"])? $_REQUEST['action'] : ''; $previous_page = isset($_REQUEST['previous_page']) ? $_REQUEST['previous_page'] : ''; require 'cdr_generic.php'; require 'rating.php'; set_time_limit(1800); if (!$export) { $title="CDRTool call search "; if (is_readable("/etc/cdrtool/local/header.phtml")) { include '/etc/cdrtool/local/header.phtml'; } else { include 'header.phtml'; } if ($previous_page == 'license_page') { $db = new DB_CDRTool(); $query = sprintf( "insert into settings (billing_party, var_module,var_name,var_value) values ('%s','login','I_agree_with_license','True')", $auth->auth["uname"] ); $db->query($query); } } else { Header("Content-type: text/plain"); Header("Content-Disposition: inline; filename=cdr.txt"); } if (isset($CDRTool['dataSourcesAllowed'])) { - while (list($k,$v)=each($CDRTool['dataSourcesAllowed'])) { - $cdr_source_els[]=array("label"=>$DATASOURCES[$v]['name'],"value"=>$v); + while (list($k,$v) = each($CDRTool['dataSourcesAllowed'])) { + $cdr_source_els[] = array( + "label" => $DATASOURCES[$v]['name'], + "value" => $v + ); } if (!$cdr_source) { $cdr_source = $cdr_source_els[0]['value']; } } -$CDR_class=$DATASOURCES[$cdr_source]["class"]; +$CDR_class = $DATASOURCES[$cdr_source]["class"]; if (!$export && !$trace) { $layout = new pageLayoutLocal(); if ($CDRTool['filter']['aNumber']) { $layout->showHeader(); $layout->showTopMenuSubscriber(); } else { $layout->showTopMenu(); } } if (is_array($DATASOURCES[$cdr_source])) { if (class_exists($CDR_class)) { $CDRS = new $CDR_class($cdr_source); - if ($action=='edit' || !$action) { + if ($action =='edit' || !$action) { if ($CDRTool['filter']['aNumber']) { $CDRS->searchFormSubscriber(); } else { $CDRS->searchForm(); } - } elseif ($action==search) { + } elseif ($action == search) { $CDRS->show(); } if (!$export && !$trace) { $layout->showFooter(); } } else { $log = sprintf("Error initializing datasource '%s', class '%s' is not defined", $cdr_source, $CDR_class); print "

$log

"; } } else { $log = sprintf("Error: datasource '%s' is not defined", $cdr_source); print "

$log

"; } if (!$export && !$trace) { print " "; } page_close(); ?> diff --git a/index.phtml b/index.phtml index d28ee95..37fb99e 100644 --- a/index.phtml +++ b/index.phtml @@ -1,87 +1,91 @@ "CDRTool_Session", - "auth" => "CDRTool_Auth", - "perm" => "CDRTool_Perm") - ); - $loginname=$auth->auth["uname"]; + page_open( + array( + "sess" => "CDRTool_Session", + "auth" => "CDRTool_Auth", + "perm" => "CDRTool_Perm" + ) + ); + $loginname = $auth->auth["uname"]; - $title="Legal notice"; + $title = "Legal notice"; $db = new DB_CDRTool(); - $query=sprintf("select * from settings - where billing_party = '%s' - and var_module= 'login' - and var_name = 'I_agree_with_license'",addslashes($loginname)); + $query = sprintf( + "select * from settings + where billing_party = '%s' + and var_module= 'login' + and var_name = 'I_agree_with_license'", + addslashes($loginname) + ); if ($db->query($query)) { - if ($db->num_rows()) { - $refreshURL='callsearch.phtml'; - $refreshTime=0; + if ($db->num_rows()) { + $refreshURL = 'callsearch.phtml'; + $refreshTime = 0; } } if (is_readable("/etc/cdrtool/local/header.phtml")) { include_once '/etc/cdrtool/local/header.phtml'; } else { include_once 'header.phtml'; } $layout = new pageLayoutLocal(); $layout->showHeader(); $layout->showLegalNotice(); $layout->showFooter(); page_close(); - } else { $Setup = new SETUP (); $Setup->showIntro(); } class SETUP { function showIntro() { print " CDRTool setup

CDRTool setup

CDRTool has not been setup on this machine yet.

- You must first setup php, apache and to create the cdrtool database. - Detailed installation instructions are available in doc/INSTALL.txt + You must first setup php, apache and to create the cdrtool database. + Detailed installation instructions are available in doc/INSTALL.txt

Once the database is available, create the cdrtool configuration file by copying the sample configuration file:

cp setup/global.inc.simple.sample /etc/cdrtool/global.inc

Then edit the configuration file global.inc to reflect your platform setup. This is the content of the current sample configuration file: "; print "

";
-        $fp=fopen("setup/global.inc.simple.sample",r);
+        $fp = fopen("setup/global.inc.simple.sample",r);
         while ($buffer = fgets($fp,1024)) {
             if (!preg_match("/(<\?)|(\?>)/",$buffer)) {
                 print "$buffer";
             }
         }
         print "
"; } } print " - + "; ?> diff --git a/logout.phtml b/logout.phtml index 1424de5..6c2e1ec 100644 --- a/logout.phtml +++ b/logout.phtml @@ -1,32 +1,32 @@ "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm" ) ); $loginname = $auth->auth["uname"]; $auth->logout(); $sess->delete(); $title = "Logout"; if (is_readable("/etc/cdrtool/local/header.phtml")) { include '/etc/cdrtool/local/header.phtml'; } else { include 'header.phtml'; } $layout = new pageLayoutLocal(); $layout->showLogout($loginname); $layout->showFooter(); print " - + "; ?> diff --git a/media_sessions.phtml b/media_sessions.phtml index cff1847..da1e2bb 100644 --- a/media_sessions.phtml +++ b/media_sessions.phtml @@ -1,73 +1,73 @@ "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm" ) ); $perm->check("statistics"); require 'media_sessions.php'; $title = "Media sessions"; include 'header.phtml'; global $CDRTool; $allowedDomains = array(); if (strlen($CDRTool['filter']['domain'])) { $allowedDomains = explode(' ', $CDRTool['filter']['domain']); } $layout = new pageLayoutLocal(); $layout->showTopMenu($title); if (isset($_REQUEST['datasource'])) { $datasources = array($_REQUEST['datasource']); } else { $datasources = array_keys($DATASOURCES); } $user = isset($_REQUEST['user']) ? $_REQUEST['user'] : ''; foreach ($datasources as $datasource) { if (in_array($datasource, $CDRTool['dataSourcesAllowed'])) { if (array_key_exists('mediaSessions', $DATASOURCES[$datasource])) { // MediaProxy 2 over NGNPro printf("

%s (MediaProxy 2)


", $DATASOURCES[$datasource]['name']); $filters = array('user' => $user); $MediaSessions = new MediaSessionsNGNPro($DATASOURCES[$datasource]['mediaSessions'], $allowedDomains, $filters); $MediaSessions->getSessions(); $MediaSessions->showAll(); } else if (array_key_exists('mediaDispatcher', $DATASOURCES[$datasource])) { // MediaProxy 2 via dispatcher tcp socket printf("

%s (MediaProxy 2.x)


", $DATASOURCES[$datasource]['name']); $filters = array('user' => $user); $MediaSessions = new MediaSessions($DATASOURCES[$datasource]['mediaDispatcher'], $allowedDomains, $filters); $MediaSessions->getSessions(); $MediaSessions->showAll(); } else if (array_key_exists('mediaServers', $DATASOURCES[$datasource])) { // MediaProxy 1 via relay tcp socket printf("

%s (MediaProxy 1.x)


", $DATASOURCES[$datasource]['name']); $MediaSessions = new MediaSessions1($DATASOURCES[$datasource]['mediaServers'], $allowedDomains); $MediaSessions->getSessions(); $MediaSessions->show(); } } } $layout->showFooter(); print " - + "; page_close(); ?> diff --git a/media_trace.phtml b/media_trace.phtml index b08e6f1..414d387 100644 --- a/media_trace.phtml +++ b/media_trace.phtml @@ -1,37 +1,36 @@ "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm" ) ); $title = sprintf("CDRTool media trace for session %s", $callid); include 'header.phtml'; $cdr_source = $_REQUEST['cdr_source']; if (in_array($cdr_source,$CDRTool['dataSourcesAllowed'])) { $proxyIP = $_REQUEST['proxyIP']; $callid = $_REQUEST['callid']; $fromtag = $_REQUEST['fromtag']; $totag = $_REQUEST['totag']; require 'cdr_generic.php'; $mediaTrace = new Media_trace($cdr_source); $mediaTrace->show($proxyIP, $callid, $fromtag, $totag); - } else { printf("Error: Invalid datasource '%s' for user '%s'", $cdr_source, $auth->auth["uname"]); } print " - + "; page_close(); ?>