Page MenuHomePhabricator

provisioning.phtml
No OneTemporary

provisioning.phtml

<?
/*
Copyright (c) 2007-2009 AG Projects
http://ag-projects.com
This page provides the functions for managing SIP accounts,
ENUM ranges, ENUM numbers, Trusted Peers, LCR, Rating plans
on a remote NGNPro server
*/
require("/etc/cdrtool/global.inc");
require("ngnpro_client.php");
set_time_limit(600);
page_open(
array("sess" => "CDRTool_Session",
"auth" => "CDRTool_Auth",
"perm" => "CDRTool_Perm")
);
$title="Platform provisioning";
if (is_readable("/etc/cdrtool/local/header.phtml")) {
include("/etc/cdrtool/local/header.phtml");
} else {
include("header.phtml");
}
$perm->check("provisioning");
$layout = new pageLayoutLocal();
$layout->showTopMenu($title);
global $CDRTool;
$login_credentials=array();
if ($CDRTool['impersonate']) {
if (preg_match("/^([0-9]*)\.([0-9]*)$/",$CDRTool['impersonate'],$m)) {
$_customer=$m[1];
$_reseller=$m[2];
} else {
page_close();
printf ("Error: Invalid impersonate value %s",$CDRTool['impersonate']);
exit;
}
if ($_customer == "0" && $_reseller == "0" ) {
$login_credentials['login_type']= 'admin';
} else if ($_customer == $_reseller) {
$login_credentials=array(
'soap_username' => $CDRTool['soap_username'],
'soap_password' => $CDRTool['soap_password'],
'customer' => $_customer,
'reseller' => $_reseller,
'login_type' => 'reseller'
);
} else {
$login_credentials=array(
'soap_username' => $CDRTool['soap_username'],
'soap_password' => $CDRTool['soap_password'],
'customer' => $_customer,
'reseller' => $_reseller,
'login_type' => 'customer'
);
}
} else {
page_close();
printf ("Please define impersonate field for login account <b>%s</b>",$auth->auth["uname"]);
exit;
}
if (file_exists("/etc/cdrtool/ngnpro_engines.inc")) {
require("/etc/cdrtool/ngnpro_engines.inc");
} else {
page_close();
printf ("Error: you must copy setup/ngnpro_engines.inc.sample to /etc/cdrtool/ngnpro_engines.inc and edit it before trying again");
exit;
}
if ($resellerFilters[$login_credentials['reseller']]) {
$login_credentials['soap_filter'] = $resellerFilters[$login_credentials['reseller']]['soap_filter'];
$login_credentials['record_generator'] = $resellerFilters[$login_credentials['reseller']]['record_generator'];
$login_credentials['name_servers'] = $resellerFilters[$login_credentials['reseller']]['name_servers'];
} else if ($resellerFilters['default']) {
$login_credentials['soap_filter'] = $resellerFilters['default']['soap_filter'];
$login_credentials['record_generator'] = $resellerFilters['default']['record_generator'];
$login_credentials['name_servers'] = $resellerFilters['default']['name_servers'];
}
$login_credentials['reseller_filters'] = $resellerFilters;
if ($_REQUEST['generatorId']) {
$generator = new recordGenerator($_REQUEST['generatorId'],$recordGenerators,$soapEngines,$login_credentials);
if ($_REQUEST['action']=='Generate') {
$generator->generateRecords();
$generator->showGeneratorForm();
} else {
$generator->showGeneratorForm();
}
} else {
$SoapEngine = new SoapEngine($_REQUEST['service'],$soapEngines,$login_credentials);
$_class = $SoapEngine->records_class;
$RECORDS = new $_class(&$SoapEngine);
$RECORDS->showWelcomeMessage();
if ($_REQUEST['action']=='Add') $RECORDS->addRecord();
if ($_REQUEST['action']=='Copy') $RECORDS->copyRecord();
if ($_REQUEST['action']=='Delete') $RECORDS->deleteRecord();
if ($_REQUEST['action']=='Update') $RECORDS->updateRecord();
if ($_REQUEST['action']=='PerformActions') {
$RECORDS->executeActions();
} else {
$RECORDS->listRecords();
}
}
$layout->showFooter();
print "
</body>
</html>
";
page_close();
?>

File Metadata

Mime Type
text/x-php
Expires
Sat, Feb 1, 5:44 AM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3488801
Default Alt Text
provisioning.phtml (4 KB)

Event Timeline