Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F7312486
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/provisioning.phtml b/provisioning.phtml
index 3e1eed1..46ea46c 100644
--- a/provisioning.phtml
+++ b/provisioning.phtml
@@ -1,159 +1,160 @@
<?php
-/*
- Copyright (c) 2007-2016 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
-*/
+/**
+ *
+ * Copyright (c) 2007-2018 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 = "Provisioning";
if (is_readable("/etc/cdrtool/local/header.phtml")) {
include("/etc/cdrtool/local/header.phtml");
} else {
include("header.phtml");
}
$perm->check("provisioning");
if ($_REQUEST['action'] == 'PerformActions' && $_REQUEST['sub_action'] == 'export') {
$export = true;
}
if ($export) {
Header("Content-type: application/json");
Header("Content-Disposition: attachment; filename=ngnpro_export.json");
} else {
$layout = new pageLayoutLocal();
$layout->showTopMenu($title);
}
global $CDRTool;
$login_credentials=array();
$login_credentials['username']=$auth->auth["uname"];
if ($CDRTool['impersonate']) {
if (preg_match("/^([0-9]*)\.([0-9]*)$/", $CDRTool['impersonate'], $m)) {
- $_customer=$m[1];
- $_reseller=$m[2];
-
+ $_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';
- $login_credentials['reseller']= '0';
+ if ($_customer == "0" && $_reseller == "0") {
+ $login_credentials['login_type'] = 'admin';
+ $login_credentials['reseller'] = '0';
} else if ($_customer == $_reseller) {
- $login_credentials=array(
+ $login_credentials = array(
'soap_username' => $CDRTool['soap_username'],
'soap_password' => $CDRTool['soap_password'],
'customer' => $_customer,
'reseller' => $_reseller,
'login_type' => 'reseller'
);
} else {
- $login_credentials=array(
+ $login_credentials = array(
'soap_username' => $CDRTool['soap_username'],
'soap_password' => $CDRTool['soap_password'],
'customer' => $_customer,
'reseller' => $_reseller,
'login_type' => 'customer'
);
}
$login_credentials['username'] = $auth->auth["uname"];
} 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 (array_key_exists($login_credentials['reseller'], $resellerFilters)) {
$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'] = isset($resellerFilters['default']['record_generator']) ? $resellerFilters['default']['record_generator'] : '';
$login_credentials['name_servers'] = isset($resellerFilters['default']['name_servers']) ? $resellerFilters['default']['name_servers'] : '' ;
}
$login_credentials['reseller_filters'] = $resellerFilters;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if (isset($_REQUEST['generatorId'])) {
$generator = new recordGenerator($_REQUEST['generatorId'], $recordGenerators, $soapEngines, $login_credentials);
if ($action == 'Generate') {
$generator->generateRecords();
$generator->showGeneratorForm();
} else {
$generator->showGeneratorForm();
}
} else {
$service = isset($_REQUEST['service']) ? $_REQUEST['service'] : '' ;
$SoapEngine = new SoapEngine($service, $soapEngines, $login_credentials);
$_class = $SoapEngine->records_class;
$RECORDS = new $_class($SoapEngine);
$RECORDS->showWelcomeMessage();
- if ($action=='Add') {
+ if ($action =='Add') {
$RECORDS->addRecord();
}
- if ($action=='Copy') {
+ if ($action =='Copy') {
$RECORDS->copyRecord();
}
- if ($action=='Delete') {
+ if ($action =='Delete') {
$RECORDS->deleteRecord();
}
- if ($action=='Update') {
+ if ($action =='Update') {
$RECORDS->updateRecord();
}
if ($action == 'PerformActions') {
$RECORDS->executeActions();
} else {
$RECORDS->listRecords();
}
}
if (!$export) {
$layout->showFooter();
echo "
</body>
</html>
";
}
page_close();
?>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Feb 1, 6:31 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3488860
Default Alt Text
(5 KB)
Attached To
Mode
rCDRT CDRTool
Attached
Detach File
Event Timeline
Log In to Comment