diff --git a/index.phtml b/index.phtml index 20d465a..e94ea08 100644 --- a/index.phtml +++ b/index.phtml @@ -1,87 +1,87 @@ - "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm") ); $loginname=$auth->auth["uname"]; $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)); if ($db->query($query)) { 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

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);
         while ($buffer = fgets($fp,1024)) {
             if (!preg_match("/(<\?)|(\?>)/",$buffer)) {
                 print "$buffer";
             }
         }
         print "
"; } } print " "; ?> diff --git a/logout.phtml b/logout.phtml index 857b3c2..a9ae402 100644 --- a/logout.phtml +++ b/logout.phtml @@ -1,29 +1,32 @@ - "CDRTool_Session", - "auth" => "CDRTool_Auth", - "perm" => "CDRTool_Perm")); +page_open( + array( + "sess" => "CDRTool_Session", + "auth" => "CDRTool_Auth", + "perm" => "CDRTool_Perm" + ) +); -$loginname=$auth->auth["uname"]; +$loginname = $auth->auth["uname"]; $auth->logout(); $sess->delete(); -$title="Logout"; +$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/mysql_replication_status.phtml b/mysql_replication_status.phtml index f839fc7..cc624cc 100644 --- a/mysql_replication_status.phtml +++ b/mysql_replication_status.phtml @@ -1,35 +1,35 @@ - "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm")); $perm->check("admin"); $title="MySQL replication status"; if (is_readable("/etc/cdrtool/local/header.phtml")) { include("/etc/cdrtool/local/header.phtml"); } else { include("header.phtml"); } $layout = new pageLayoutLocal(); $layout->showTopMenu($title); require("mysql_replication.php"); $ReplicationOverview = new ReplicationOverview($replicated_databases); $ReplicationOverview->showOverview(); $layout->showFooter(); print " "; page_close(); -?> \ No newline at end of file +?> diff --git a/prepaid_cards.phtml b/prepaid_cards.phtml index 308f9f9..45dd691 100644 --- a/prepaid_cards.phtml +++ b/prepaid_cards.phtml @@ -1,61 +1,61 @@ - "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm") ); require("prepaid.php"); $loginname=$auth->auth["uname"]; $perm->check("rates"); $title="Prepaid card generator"; $action = $_REQUEST['action']; $batch = $_REQUEST['batch']; $confirm = $_REQUEST['confirm']; if ($action != "export") { if (is_readable("/etc/cdrtool/local/header.phtml")) { include("/etc/cdrtool/local/header.phtml"); } else { include("header.phtml"); } $layout = new pageLayoutLocal(); $layout->showTopMenu($title); } else { Header("Content-type: text/plain"); Header("Content-Disposition: inline; filename=$batch.txt"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Pragma: no-cache"); } $PrepaidCards = new PrepaidCards(); if ($action == "generate") { $PrepaidCards->generate(); $PrepaidCards->showGenerateForm(); $PrepaidCards->showBatches(); } elseif ($action == "delete") { $PrepaidCards->showGenerateForm(); $PrepaidCards->deleteBatch($batch,$confirm); $PrepaidCards->showBatches(); } elseif ($action == "export") { $PrepaidCards->export($batch); } else { $PrepaidCards->showGenerateForm(); $PrepaidCards->showBatches(); } if ($action != "export") { print " "; } page_close(); ?> diff --git a/rating_tables.phtml b/rating_tables.phtml index 2364b0b..d7d28a5 100644 --- a/rating_tables.phtml +++ b/rating_tables.phtml @@ -1,52 +1,52 @@ - "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm")); $perm->check("rates"); include("rating.php"); if ($perm->have_perm("readonly")) { $RatingTables=new RatingTables('readonly'); } else { $RatingTables=new RatingTables(); } if (!$_REQUEST['export']) { $title="Rating tables"; if (is_readable("/etc/cdrtool/local/header.phtml")) { include("/etc/cdrtool/local/header.phtml"); } else { include("header.phtml"); } $layout = new pageLayoutLocal(); $layout->showTopMenu($title); } else { print $RatingTables->table_to_csv_name[$_REQUEST['table']]; Header("Content-type: text/csv"); $h=sprintf("Content-Disposition: inline; filename=%s",$RatingTables->csv_export[$_REQUEST['table']]); Header($h); } if ($_REQUEST['import'] && $_REQUEST['table']) { $RatingTables->importTable($_REQUEST['table']); } $RatingTables->updateTable(); $RatingTables->showTable(); if (!$_REQUEST['export']) { $layout->showFooter(); print " "; } page_close(); -?> \ No newline at end of file +?> diff --git a/sip_enrollment.phtml b/sip_enrollment.phtml index 5ccf82b..0947188 100644 --- a/sip_enrollment.phtml +++ b/sip_enrollment.phtml @@ -1,19 +1,19 @@ -createAccount(); ?> diff --git a/sip_header.phtml b/sip_header.phtml index 4a68ed8..6af79d4 100644 --- a/sip_header.phtml +++ b/sip_header.phtml @@ -1,16 +1,16 @@ - CDRTool - $title ",$CDRTool['tld'] ); printf (""); printf (""); ?> diff --git a/sip_login.phtml b/sip_login.phtml index be66b48..aec7b15 100644 --- a/sip_login.phtml +++ b/sip_login.phtml @@ -1,155 +1,155 @@ - -

"; print _("Login"); print "

"; ?> -"; print _("Either your SIP account or password are invalid"); print "

$login_msg

"; } ?>
- "; ?>
auth["uname"]; } else if (isset($_REQUEST['username'])) { print $_REQUEST['username']; } ?>" placeholder="Example: " size=35 maxlength=50 class='span11'>
"; ?>
>
"; } else { print '

'; print _("SIP address or password forgotten?"); print "

"; } $sess->hidden_session(); ?>

SIP address or password forgotten?

-
diff --git a/sip_login_reminder.phtml b/sip_login_reminder.phtml index c83a174..e30ad1c 100644 --- a/sip_login_reminder.phtml +++ b/sip_login_reminder.phtml @@ -1,234 +1,234 @@ - 'admin'); $SoapEngine = new SoapEngine('sip_accounts',$soapEngines,$login_credentials); $_class = $SoapEngine->records_class; $RECORDS = new $_class($SoapEngine); $login_credentials['sip_engine'] = $RECORDS->SoapEngine->sip_engine; if ($_REQUEST['id']){ $id = $_REQUEST['id']; $db = new DB_CDRTool(); $query="delete from memcache where `key` LIKE 'email_%' and NOW() >= `expire`"; if (!$db->query($query)) { $log=sprintf ("Database error for query %s: %s (%s)\n",$query,$db->Error,$db->Errno); syslog(LOG_NOTICE,$log); } else { $log=sprintf ("Purged %d records from memcache\n",$db->affected_rows()); syslog(LOG_NOTICE,$log); } $query=sprintf("select * from memcache where `key`='email_%s'", addslashes($id)); if (!$db->query($query)) return false; if ($db->num_rows()) { $db->next_record(); $account = json_decode($db->f('value'),true); if (!($_REQUEST['sip_password'] || $_REQUEST['web_password'])){ $RECORDS->showPasswordReminderUpdateFormEncrypted($_REQUEST['id'],$account['sip_account']); } else { $SipSettings = new SipSettings($account['sip_account'],$login_credentials,$soapEngines); dprint_r($SipSettings->result); if($_REQUEST['sip_password']){ //print "$SipSettings->password"; if ($SipSettings->store_clear_text_passwords) { $SipSettings->result->password=$_REQUEST['sip_password']; } else { $md1=strtolower($SipSettings->result->id->username).':'.strtolower($SipSettings->result->id->domain).':'.$sip_password; dprint($md1); dprint(md5($md1)); $md2=strtolower($SipSettings->result->id->username).'@'.strtolower($SipSettings->result->id->domain).':'.strtolower($SipSettings->result->id->domain).':'.$_REQUEST['sip_password']; $SipSettings->result->password=md5($md1).':'.md5($md2); } } if($_REQUEST['web_password']){ //dprint_r($SipSettings->result->properties); if ($SipSettings->store_clear_text_passwords) { $web_password_new=$_REQUEST['web_password']; } else { $md1=strtolower($SipSettings->result->id->username).':'.strtolower($SipSettings->result->id->domain).':'.$_REQUEST['web_password']; $md2=strtolower($SipSettings->result->id->username).'@'.strtolower($SipSettings->result->id->domain).':'.strtolower($SipSettings->result->id->domain).':'.$_REQUEST['web_password']; $web_password_new=md5($md1).':'.md5($md2); } foreach (array_keys($SipSettings->result->properties) as $_key) { $_prop=$SipSettings->result->properties[$_key]; if ($_prop->name == 'web_password') { $newProperties[]=array( 'name'=> 'web_password', 'value' => $web_password_new); $found=1; } else { $newProperties[]=$_prop; } } if (!$found) { $newProperties[]=array('name' => 'web_password', 'value' => $web_password_new); } //if ($SipSettings->result->properties!=$newProperties) $this->somethingChanged=1; if (!$newProperties) $newProperties = array(); $SipSettings->result->properties=$newProperties; //setPreference1('web_password',$_REQUEST['web_password']); } dprint_r($SipSettings->result); $SipSettings->SipPort->addHeader($SipSettings->SoapAuth); $result = $SipSettings->SipPort->updateAccount($SipSettings->result); dprint_r($SipSettings->result); print "

"; print _("Update passwords"); print "

"; if ((new PEAR)->isError($result)) { $error_msg = $result->getMessage(); $error_fault= $result->getFault(); $error_code = $result->getCode(); printf ("
"); printf ("Error (SipPort):
%s (%s): %s
",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); return false; } else { printf ("
"); print _("Success"); print "
"; print _("The password(s) have been updated"); print "
"; $query="delete from memcache where `key` LIKE 'email_$id'"; if (!$db->query($query)) { $log=sprintf ("Database error for query %s: %s (%s)\n",$query,$db->Error,$db->Errno); syslog(LOG_NOTICE,$log); } flush(); } unset($SipSettings); } } else { print "

"; print _("Update passwords"); print "

"; printf ("
"); print _("Error"); print "
"; print _("ID not found in the database"); print "
"; print _("or the password changing session has expired"); print "
"; flush(); } print "

Found a SIP account having email address set to '%s':

",trim($_REQUEST['email_filter'])); } else { printf ("

Found multiple SIP accounts having email address set to '%s':

",trim($_REQUEST['email_filter'])); } //printf ("

Found a SIP account having email address set to '%s'",trim($_REQUEST['email_filter'])); print ""; print "

Processing...

"; print "
    "; print "
  • "; foreach ($accounts as $_account) { $account=$_account['username'].'@'.$_account['domain']; //if ($account == $_REQUEST['sip_filter']) { $SipSettings = new SipSettings($account,$login_credentials,$soapEngines); $success = $success + $SipSettings->sendEmail(true); //print "$sucess"; sleep(1); flush(); //} } if ($success >= "1"){ if ($success > "1"){ print "Login reminders and password resets have been sent to "; } else { print "Login reminder and password reset have been sent to "; } print $_REQUEST['email_filter']; print "
  • "; print ""; } print "
"; } } print "

Back to login page"; } print " "; ?> diff --git a/sip_settings.phtml b/sip_settings.phtml index 419e195..97f65d0 100644 --- a/sip_settings.phtml +++ b/sip_settings.phtml @@ -1,118 +1,118 @@ - "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm")); $account = $_REQUEST['account']; $reseller = $_REQUEST['reseller']; $customer = $_REQUEST['customer']; $sip_engine = $_REQUEST['sip_engine']; if ($reseller && !$customer) { $customer = $reseller; } else if ($customer && !$reseller) { $reseller = $customer; } $perm->check("provisioning"); global $CDRTool; if ($CDRTool['impersonate']) { if (preg_match("/^([1-9][0-9]*)\.([1-9][0-9]*)$/",$CDRTool['impersonate'],$m)) { $_customer=$m[1]; $_reseller=$m[2]; if ($_customer == $_reseller) { $login_type = 'reseller'; } else { $login_type = 'customer'; } $login_credentials=array( 'customer' => $_customer, 'reseller' => $_reseller, 'login_type' => $login_type ); } else if ($CDRTool['impersonate'] == '0' || $CDRTool['impersonate'] = '0.0') { $login_credentials=array( 'customer' => $customer, 'reseller' => $reseller, 'login_type' => 'admin' ); } else { page_close(); printf ("Error: Invalid impersonate value %s",$CDRTool['impersonate']); exit; } } else { page_close(); printf ("Error: Missing impersonate setting"); exit; } } else { page_open(array("sess" => "SIP_Subscriber_Session", "auth" => "SIP_Subscriber_Auth") ); $account = $SIP['account']; $reseller = $SIP['reseller']; $customer = $SIP['customer']; $sip_engine = $SIP['engine']; $login_type = "subscriber"; $login_credentials=array( 'login_type' => $login_type, 'customer' => $customer, 'reseller' => $reseller, 'sip_engine' => $sip_engine ); } $_class='SipSettings'; $_reseller_class=$_class.$reseller; if (class_exists($_reseller_class)) { $SipSettings_class=$_reseller_class; } else { $SipSettings_class=$_class; } if ($resellerFilters[$login_credentials['reseller']]['sip_engine']) { $login_credentials['sip_engine'] = $resellerFilters[$login_credentials['reseller']]['sip_engine']; } else if ($_REQUEST['sip_engine']) { $login_credentials['sip_engine']=$_REQUEST['sip_engine']; } else if ($resellerFilters['default']['sip_engine']) { $login_credentials['sip_engine'] = $resellerFilters['default']['sip_engine']; } renderUI($SipSettings_class,$account,$login_credentials,$soapEngines); page_close(); ?> diff --git a/sip_settings_digest.phtml b/sip_settings_digest.phtml index 5c74abd..5e87823 100644 --- a/sip_settings_digest.phtml +++ b/sip_settings_digest.phtml @@ -1,49 +1,49 @@ - $reseller, 'customer' => $customer, 'login_type' => $login_type, 'sip_engine' => $sip_engine, 'templates_path' => './templates' ); renderUI($SipSettings_class,$account,$login_credentials,$soapEngines); ?> diff --git a/sip_settings_tlscert.phtml b/sip_settings_tlscert.phtml index 8be5e1c..53b950e 100644 --- a/sip_settings_tlscert.phtml +++ b/sip_settings_tlscert.phtml @@ -1,45 +1,45 @@ - $reseller, 'customer' => $customer, 'login_type' => $login_type, 'sip_engine' => $sip_engine, 'templates_path' => './templates' ); renderUI($SipSettings_class,$account,$login_credentials,$soapEngines); ?>