Page MenuHomePhabricator

No OneTemporary

diff --git a/library/NGNPro/Records/EnumRanges.php b/library/NGNPro/Records/EnumRanges.php
index d203a06..5077304 100644
--- a/library/NGNPro/Records/EnumRanges.php
+++ b/library/NGNPro/Records/EnumRanges.php
@@ -1,713 +1,815 @@
<?php
class EnumRanges extends Records
{
- var $selectionActiveExceptions=array('tld');
- var $record_generator='';
+ var $selectionActiveExceptions = array('tld');
+ var $record_generator = '';
// only admin can add prefixes below
- var $deniedPrefixes=array('1','20','210','211','212','213','214','215','216','217','218','219','220','221','222','223','224','225','226','227','228','229','230','231','232','233','234','235','236','237','238','239','240','241','242','243','244','245','246','247','248','249','250','251','252','253','254','255','256','257','258','259','260','261','262','263','264','265','266','267','268','269','27','280','281','282','283','284','285','286','287','288','289','290','291','292','293','294','295','296','297','298','299','30','31','32','33','34','350','351','352','353','354','355','356','357','358','359','36','370','371','372','373','374','375','376','377','378','379','380','381','382','383','384','385','386','387','388','389','39','40','41','420','421','422','423','424','425','426','427','428','429','43','44','45','46','47','48','49','500','501','502','503','504','505','506','507','508','509','51','52','53','54','55','56','57','58','590','591','592','593','594','595','596','597','598','599','60','61','62','63','64','65','66','670','671','672','673','674','675','676','677','678','679','680','681','682','683','684','685','686','687','688','689','690','691','692','693','694','695','696','697','698','699','7','800','801','802','803','804','805','806','807','808','809','81','82','830','831','832','833','834','835','836','837','838','839','84','850','851','852','853','854','855','856','857','858','859','86','870','871','872','873','874','875','876','877','878','879','880','881','882','883','884','885','886','887','888','889','890','891','892','893','894','895','896','897','898','899','90','91','92','93','94','95','960','961','962','963','964','965','966','967','968','969','970','971','972','973','974','975','976','977','978','979','98','990','991','992','993','994','995','996','997','998','999');
-
- var $FieldsAdminOnly=array(
- 'reseller' => array('type'=>'integer',
- 'help' => 'Range owner')
- );
-
- var $Fields=array(
- 'customer' => array('type'=>'integer',
- 'help' => 'Range owner'
- ),
- 'serial' => array('type'=>'integer',
- 'help'=>'DNS serial number',
- 'readonly' => 1
- ),
- 'ttl' => array('type'=>'integer',
- 'help'=>'Cache period in DNS clients'
- ),
- 'info' => array('type'=>'string',
- 'help' =>'Range description'
- ),
- 'size' => array('type'=>'integer',
- 'help'=>'Maximum number of telephone numbers'
- ),
- 'minDigits' => array('type'=>'integer',
- 'help'=>'Minimum number of digits for telephone numbers'
- ),
- 'maxDigits' => array('type'=>'integer',
- 'help'=>'Maximum number of digits for telephone numbers'
- )
- );
+ var $deniedPrefixes = array(
+ '1','20','210','211','212','213','214','215','216','217','218','219','220','221','222','223','224','225','226',
+ '227','228','229','230','231','232','233','234','235','236','237','238','239','240','241','242','243','244',
+ '245','246','247','248','249','250','251','252','253','254','255','256','257','258','259','260','261','262',
+ '263','264','265','266','267','268','269','27','280','281','282','283','284','285','286','287','288','289',
+ '290','291','292','293','294','295','296','297','298','299','30','31','32','33','34','350','351','352','353',
+ '354','355','356','357','358','359','36','370','371','372','373','374','375','376','377','378','379','380',
+ '381','382','383','384','385','386','387','388','389','39','40','41','420','421','422','423','424','425','426',
+ '427','428','429','43','44','45','46','47','48','49','500','501','502','503','504','505','506','507','508',
+ '509','51','52','53','54','55','56','57','58','590','591','592','593','594','595','596','597','598','599','60',
+ '61','62','63','64','65','66','670','671','672','673','674','675','676','677','678','679','680','681','682',
+ '683','684','685','686','687','688','689','690','691','692','693','694','695','696','697','698','699','7',
+ '800','801','802','803','804','805','806','807','808','809','81','82','830','831','832','833','834','835',
+ '836','837','838','839','84','850','851','852','853','854','855','856','857','858','859','86','870','871',
+ '872','873','874','875','876','877','878','879','880','881','882','883','884','885','886','887','888','889',
+ '890','891','892','893','894','895','896','897','898','899','90','91','92','93','94','95','960','961','962',
+ '963','964','965','966','967','968','969','970','971','972','973','974','975','976','977','978','979','98',
+ '990','991','992','993','994','995','996','997','998','999'
+ );
+
+ var $FieldsAdminOnly = array(
+ 'reseller' => array(
+ 'type'=>'integer',
+ 'help' => 'Range owner'
+ )
+ );
+
+ var $Fields = array(
+ 'customer' => array('type'=>'integer',
+ 'help' => 'Range owner'
+ ),
+ 'serial' => array('type'=>'integer',
+ 'help'=>'DNS serial number',
+ 'readonly' => 1
+ ),
+ 'ttl' => array('type'=>'integer',
+ 'help'=>'Cache period in DNS clients'
+ ),
+ 'info' => array('type'=>'string',
+ 'help' =>'Range description'
+ ),
+ 'size' => array('type'=>'integer',
+ 'help'=>'Maximum number of telephone numbers'
+ ),
+ 'minDigits' => array('type'=>'integer',
+ 'help'=>'Minimum number of digits for telephone numbers'
+ ),
+ 'maxDigits' => array('type'=>'integer',
+ 'help'=>'Maximum number of digits for telephone numbers'
+ )
+ );
public function __construct($SoapEngine)
{
dprint("init EnumRanges");
- $this->filters = array('prefix' => trim(ltrim($_REQUEST['prefix_filter']),'+'),
- 'tld' => trim($_REQUEST['tld_filter']),
- 'info' => trim($_REQUEST['info_filter'])
- );
+ $this->filters = array(
+ 'prefix' => trim(ltrim($_REQUEST['prefix_filter']), '+'),
+ 'tld' => trim($_REQUEST['tld_filter']),
+ 'info' => trim($_REQUEST['info_filter'])
+ );
parent::__construct($SoapEngine);
- $this->sortElements=array('changeDate' => 'Change date',
- 'prefix' => 'Prefix',
- 'tld' => 'TLD'
- );
+ $this->sortElements = array(
+ 'changeDate' => 'Change date',
+ 'prefix' => 'Prefix',
+ 'tld' => 'TLD'
+ );
/*
$this->Fields['nameservers'] = array('type'=>'text',
'name'=>'Name servers',
'help'=>'Name servers authoritative for this DNS zone'
);
*/
if ($this->login_credentials['reseller_filters'][$this->reseller]['record_generator']) {
- //printf ("Engine: %s",$this->SoapEngine->soapEngine);
+ //printf("Engine: %s",$this->SoapEngine->soapEngine);
if (is_array($this->login_credentials['reseller_filters'][$this->reseller]['record_generator'])) {
- $_rg=$this->login_credentials['reseller_filters'][$this->reseller]['record_generator'];
+ $_rg = $this->login_credentials['reseller_filters'][$this->reseller]['record_generator'];
if ($_rg[$this->SoapEngine->soapEngine]) {
- $this->record_generator=$_rg[$this->SoapEngine->soapEngine];
+ $this->record_generator = $_rg[$this->SoapEngine->soapEngine];
}
} else {
- $this->record_generator=$this->login_credentials['reseller_filters'][$this->reseller]['record_generator'];
+ $this->record_generator = $this->login_credentials['reseller_filters'][$this->reseller]['record_generator'];
}
- } else if (strlen($this->SoapEngine->record_generator)) {
- $this->record_generator=$this->SoapEngine->record_generator;
+ } elseif (strlen($this->SoapEngine->record_generator)) {
+ $this->record_generator = $this->SoapEngine->record_generator;
}
}
function listRecords()
{
$this->getAllowedDomains();
$this->showSeachForm();
// Filter
- $filter=array('prefix' => $this->filters['prefix'],
- 'tld' => $this->filters['tld'],
- 'info' => $this->filters['info'],
- 'customer' => intval($this->filters['customer']),
- 'reseller' => intval($this->filters['reseller'])
- );
+ $filter = array(
+ 'prefix' => $this->filters['prefix'],
+ 'tld' => $this->filters['tld'],
+ 'info' => $this->filters['info'],
+ 'customer' => intval($this->filters['customer']),
+ 'reseller' => intval($this->filters['reseller'])
+ );
// Range
- $range=array('start' => intval($this->next),
- 'count' => intval($this->maxrowsperpage)
- );
+ $range = array(
+ 'start' => intval($this->next),
+ 'count' => intval($this->maxrowsperpage)
+ );
// Order
if (!$this->sorting['sortBy']) $this->sorting['sortBy'] = 'changeDate';
if (!$this->sorting['sortOrder']) $this->sorting['sortOrder'] = 'DESC';
- $orderBy = array('attribute' => $this->sorting['sortBy'],
- 'direction' => $this->sorting['sortOrder']
- );
+ $orderBy = array(
+ 'attribute' => $this->sorting['sortBy'],
+ 'direction' => $this->sorting['sortOrder']
+ );
// Compose query
- $Query=array('filter' => $filter,
- 'orderBy' => $orderBy,
- 'range' => $range
- );
+ $Query = array(
+ 'filter' => $filter,
+ 'orderBy' => $orderBy,
+ 'range' => $range
+ );
$this->SoapEngine->soapclient->addHeader($this->SoapEngine->SoapAuth);
$this->log_action('getRanges');
$result = $this->SoapEngine->soapclient->getRanges($Query);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
-
$this->rows = $result->total;
if ($this->rows && $_REQUEST['action'] != 'PerformActions' && $_REQUEST['action'] != 'Delete') {
$this->showActionsForm();
}
- print "
- <div class=\"alert alert-success\"><center>$this->rows records found</center></div>
- <p>
- <table class='table table-striped table-condensed' width=100%>
- <thead>
+ print <<< END
+<div class="alert alert-success">
+ <center>$this->rows records found</center>
+</div>
+<p>
+ <table class='table table-striped table-condensed' width=100%>
+ <thead>
<tr>
- <th>Id</th>
- <th>Owner</th>
- <th>Prefix </th>
- <th>TLD</th>
- <th>Serial</th>
- <th>TTL</th>
- <th>Info</th>
- <th>Min</th>
- <th>Max</th>
- <th>Size</th>
- <th colspan=2>Used</th>
- <th>Change date</th>
- <th>Actions</th>
- </tr></thead>
- ";
+ <th>Id</th>
+ <th>Owner</th>
+ <th>Prefix </th>
+ <th>TLD</th>
+ <th>Serial</th>
+ <th>TTL</th>
+ <th>Info</th>
+ <th>Min</th>
+ <th>Max</th>
+ <th>Size</th>
+ <th colspan=2>Used</th>
+ <th>Change date</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+END;
if (!$this->next) $this->next=0;
- if ($this->rows > $this->maxrowsperpage) {
+ if ($this->rows > $this->maxrowsperpage) {
$maxrows = $this->maxrowsperpage + $this->next;
if ($maxrows > $this->rows) $maxrows = $this->maxrowsperpage;
} else {
- $maxrows=$this->rows;
+ $maxrows = $this->rows;
}
$i=0;
if ($this->rows) {
while ($i < $maxrows) {
if (!$result->ranges[$i]) break;
$range = $result->ranges[$i];
$index=$this->next+$i+1;
$_url = $this->url.sprintf("&service=%s&action=Delete&prefix_filter=%s&tld_filter=%s",
urlencode($this->SoapEngine->service),
urlencode($range->id->prefix),
urlencode($range->id->tld)
);
if ($this->adminonly) $_url.= sprintf ("&reseller_filter=%s",$range->reseller);
if ($_REQUEST['action'] == 'Delete' &&
$_REQUEST['prefix_filter'] == $range->id->prefix &&
$_REQUEST['tld_filter'] == $range->id->tld) {
$_url .= "&confirm=1";
$actionText = "<font color=red>Confirm</font>";
} else {
$actionText = "Delete";
}
if ($this->adminonly) {
$range_url=sprintf('<a href=%s&service=%s&reseller_filter=%s&prefix_filter=%s&tld_filter=%s>%s</a>',$this->url, $this->SoapEngine->service, $range->reseller, $range->id->prefix, $range->id->tld, $range->id->prefix);
} else {
$range_url=sprintf('<a href=%s&&service=%s&prefix_filter=%s&tld_filter=%s>%s</a>',$this->url, $this->SoapEngine->service, $range->id->prefix, $range->id->tld, $range->id->prefix);
}
if ($this->record_generator) {
$generator_url=sprintf('<a class="btn-small btn-primary" href=%s&generatorId=%s&range=%s@%s&number_length=%s&reseller_filter=%s target=generator>+Numbers</a>',$this->url, $this->record_generator, $range->id->prefix, $range->id->tld, $range->maxDigits, $range->reseller);
} else {
$generator_url='';
}
if ($range->size) {
- $usage=intval(100*$range->used/$range->size);
- $bar=$this->makebar($usage);
+ $usage = intval(100 * $range->used / $range->size);
+ $bar = $this->makebar($usage);
} else {
$bar="";
}
$_customer_url = $this->url.sprintf("&service=customers@%s&customer_filter=%s",
urlencode($this->SoapEngine->customer_engine),
urlencode($range->customer)
);
$_nameservers='';
foreach ($range->nameservers as $_ns) {
$_nameservers.= $_ns.' ';
}
- printf("
+ printf(
+ "
<tr>
<td>%s</td>
<td><a href=%s>%s.%s</a></td>
<td>+%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td><a class='btn-small btn-danger' href=%s>%s</a>%s</td>
- </tr>",
+ </tr>
+ ",
$index,
$_customer_url,
$range->customer,
$range->reseller,
$range_url,
$range->id->tld,
$range->serial,
$range->ttl,
$range->info,
$range->minDigits,
$range->maxDigits,
$range->size,
$range->used,
$bar,
$range->changeDate,
$_url,
$actionText,
$generator_url
);
$i++;
}
}
print "</table>";
if ($this->rows == 1) {
$this->showRecord($range);
} else {
$this->showPagination($maxrows);
}
return true;
}
}
function deleteRecord($dictionary = array())
{
if (!$dictionary['confirm'] && !$_REQUEST['confirm']) {
print "<p><font color=red>Please press on Confirm to confirm the delete. </font>";
return true;
}
if (!strlen($this->filters['prefix']) || !strlen($this->filters['tld'])) {
print "<p><font color=red>Error: missing ENUM range id </font>";
return false;
}
- $rangeId=array('prefix'=>$this->filters['prefix'],
+ $rangeId = array('prefix'=>$this->filters['prefix'],
'tld'=>$this->filters['tld']);
- $function=array('commit' => array('name' => 'deleteRange',
- 'parameters' => array($rangeId),
- 'logs' => array('success' => sprintf('ENUM range +%s under %s has been deleted',$this->filters['prefix'], $this->filters['tld'])
- )
- )
- );
+ $function = array(
+ 'commit' => array(
+ 'name' => 'deleteRange',
+ 'parameters' => array($rangeId),
+ 'logs' => array(
+ 'success' => sprintf(
+ 'ENUM range +%s under %s has been deleted',
+ $this->filters['prefix'],
+ $this->filters['tld']
+ )
+ )
+ )
+ );
- unset($this->filters);
+ unset($this->filters);
$result = $this->SoapEngine->execute($function, $this->html);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
return true;
}
}
function showAddForm()
{
if ($this->selectionActive) return;
- printf ("<form class='form-inline' method=post name=addform action=%s>",$_SERVER['PHP_SELF']);
+ printf("<form class='form-inline' method=post name=addform action=%s>",$_SERVER['PHP_SELF']);
- print "
- <div class='well well-small'>
- ";
+ print "<div class='well well-small'>";
+
+ print "<input type=submit class='btn btn-warning' name=action value=Add>";
- print "
- <input type=submit class='btn btn-warning' name=action value=Add>
- ";
$this->showCustomerTextBox();
- printf ("</div> <div class='input-prepend'><span class='add-on'>Prefix +</span><input type=text class=input-medium size=15 name=prefix value='%s'></div>",$_REQUEST['prefix']);
- printf (" <div class='input-prepend'><span class='add-on'>TLD</span>");
+ printf(
+ "
+ </div>
+ <div class='input-prepend'>
+ <span class='add-on'>Prefix +</span><input type=text class=input-medium size=15 name=prefix value='%s'>
+ </div>
+ ",
+ $_REQUEST['prefix']
+ );
+ print "<div class='input-prepend'><span class='add-on'>TLD</span>";
if ($_REQUEST['tld']) {
- printf ("<input class=span2 type=text size=15 name=tld value='%s'></div>",$_REQUEST['tld']);
- } else if ($this->filters['tld']) {
- printf ("<input class=span2 type=text size=15 name=tld value='%s'></div>",$this->filters['tld']);
- } else if ($_tld=$this->getCustomerProperty('enum_ranges_last_tld')) {
- printf ("<input class=span2 type=text size=15 name=tld value='%s'></div>",$_tld);
+ printf("<input class=span2 type=text size=15 name=tld value='%s'></div>", $_REQUEST['tld']);
+ } elseif ($this->filters['tld']) {
+ printf("<input class=span2 type=text size=15 name=tld value='%s'></div>", $this->filters['tld']);
+ } elseif ($_tld = $this->getCustomerProperty('enum_ranges_last_tld')) {
+ printf("<input class=span2 type=text size=15 name=tld value='%s'></div>", $_tld);
} else {
- printf ("<input class=span2 type=text size=15 name=tld></div>");
+ printf("<input class=span2 type=text size=15 name=tld></div>");
}
- printf (" <div class='input-prepend'><span class='add-on'>TTL</span><input class=span1 type=text size=5 name=ttl value=3600></div>");
- printf (" <div class='input-prepend'><span class='add-on'>Min Digits</span><input class=span1 type=text size=3 name=minDigits value=11></div>");
- printf (" <div class='input-prepend'><span class='add-on'>Max Digits</span><input class=span1 type=text size=3 name=maxDigits value=11></div>");
- printf (" <div class='input-prepend'><span class='add-on'>Info</span><input type=text size=15 name=info class=span2 value='%s'></div>",$_REQUEST['info']);
+ print <<< END
+<div class='input-prepend'><span class='add-on'>TTL</span><input class=span1 type=text size=5 name=ttl value=3600></div>
+<div class='input-prepend'>
+ <span class='add-on'>Min Digits</span><input class=span1 type=text size=3 name=minDigits value=11>
+</div>
+<div class='input-prepend'>
+ <span class='add-on'>Max Digits</span><input class=span1 type=text size=3 name=maxDigits value=11>
+</div>
+END;
+ printf(
+ "<div class='input-prepend'><span class='add-on'>Info</span><input type=text size=15 name=info class=span2 value='%s'></div>",
+ $_REQUEST['info']
+ );
$this->printHiddenFormElements();
print "
</div>
</form>
";
}
- function addRecord($dictionary=array())
+ function addRecord($dictionary = array())
{
$tld = trim($_REQUEST['tld']);
$prefix = trim($_REQUEST['prefix']);
$size = trim($_REQUEST['size']);
$info = trim($_REQUEST['info']);
if (!strlen($tld)) {
- $tld=$this->SoapEngine->default_enum_tld;
+ $tld = $this->SoapEngine->default_enum_tld;
}
if (!strlen($tld) || !strlen($prefix) || !is_numeric($prefix)) {
printf("<p><font color=red>Error: Missing TLD or prefix. </font>");
return false;
}
if (!$this->adminonly) {
if (in_array($prefix, $this->deniedPrefixes)) {
print "<p><font color=red>Error: Only an administrator account can create the prefix coresponding to a country code.</font>";
return false;
}
}
list($customer, $reseller)=$this->customerFromLogin($dictionary);
if (!trim($_REQUEST['ttl'])) {
$ttl = 3600;
} else {
$ttl = intval(trim($_REQUEST['ttl']));
}
$range = array(
'id' => array(
'prefix' => $prefix,
'tld' => $tld
),
'ttl' => $ttl,
'info' => $info,
'minDigits' => intval(trim($_REQUEST['minDigits'])),
'maxDigits' => intval(trim($_REQUEST['maxDigits'])),
'size' => intval($size),
'customer' => intval($customer),
'reseller' => intval($reseller)
);
$deleteRange = array(
'prefix'=>$prefix,
'tld'=>$tld
);
$_p = array(
array(
'name' => 'enum_ranges_last_tld',
'category' => 'web',
'value' => "$tld",
'permission' => 'customer'
)
);
$this->setCustomerProperties($_p);
$function = array(
'commit' => array(
'name' => 'addRange',
'parameters' => array($range),
- 'logs' => array('success' => sprintf('ENUM range +%s under %s has been added',$prefix, $tld))
+ 'logs' => array('success' => sprintf('ENUM range +%s under %s has been added', $prefix, $tld))
)
);
$result = $this->SoapEngine->execute($function, $this->html);
dprint_r($result);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
return true;
}
}
function showSeachFormCustom()
{
- printf (" <div class='input-prepend'><span class='add-on'>Prefix</span><input class=span2 type=text size=15 name=prefix_filter value='%s'></div>",$this->filters['prefix']);
- printf (" <div class='input-prepend'><span class='add-on'>TLD</span>");
+ printf(
+ "
+ <div class='input-prepend'>
+ <span class='add-on'>Prefix</span>
+ <input class = span2 type=text size=15 name=prefix_filter value='%s'>
+ </div>
+ ",
+ $this->filters['prefix']
+ );
+ print "<div class='input-prepend'><span class='add-on'>TLD</span>";
if (count($this->allowedDomains) > 0) {
$selected_tld[$this->filters['tld']]='selected';
- printf ("<select class=span2 name=tld_filter>
- <option>");
+ print <<< END
+<select class=span2 name=tld_filter>
+ <option>
+END;
foreach ($this->allowedDomains as $_tld) {
- printf ("<option value='%s' %s>%s",$_tld, $selected_tld[$_tld], $_tld);
+ printf("<option value='%s' %s>%s", $_tld, $selected_tld[$_tld], $_tld);
}
- printf ("</select></div>");
+ printf("</select></div>");
} else {
- printf ("<input class=span2 type=text size=20 name=tld_filter value='%s'></div>",$this->filters['tld']);
+ printf("<input class=span2 type=text size=20 name=tld_filter value='%s'></div>", $this->filters['tld']);
}
- printf (" <div class='input-prepend'><span class='add-on'>Info</span><input class=span2 type=text size=10 name=info_filter value='%s'></div>",$this->filters['info']);
+ printf(
+ "
+ <div class='input-prepend'>
+ <span class='add-on'>Info</span>
+ <input class=span2 type=text size=10 name=info_filter value='%s'>
+ </div>
+ ",
+ $this->filters['info']
+ );
}
function getAllowedDomains()
{
// Filter
- $filter=array('prefix' => '');
+ $filter = array(
+ 'prefix' => ''
+ );
// Range
- $range=array('start' => 0,
- 'count' => 500
- );
+ $range = array(
+ 'start' => 0,
+ 'count' => 500
+ );
// Order
if (!$this->sorting['sortBy']) $this->sorting['sortBy'] = 'changeDate';
if (!$this->sorting['sortOrder']) $this->sorting['sortOrder'] = 'DESC';
- $orderBy = array('attribute' => $this->sorting['sortBy'],
- 'direction' => $this->sorting['sortOrder']
- );
+ $orderBy = array(
+ 'attribute' => $this->sorting['sortBy'],
+ 'direction' => $this->sorting['sortOrder']
+ );
// Compose query
- $Query=array('filter' => $filter,
- 'orderBy' => $orderBy,
- 'range' => $range
- );
+ $Query = array(
+ 'filter' => $filter,
+ 'orderBy' => $orderBy,
+ 'range' => $range
+ );
$this->SoapEngine->soapclient->addHeader($this->SoapEngine->SoapAuth);
$this->log_action('getRanges');
- $result = $this->SoapEngine->soapclient->getRanges($Query);
+ $result = $this->SoapEngine->soapclient->getRanges($Query);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
- foreach($result->ranges as $range) {
- $this->ranges[]=array('prefix' => $range->id->prefix,
- 'tld' => $range->id->tld,
- 'minDigits' => $range->minDigits,
- 'maxDigits' => $range->maxDigits
- );
+ foreach ($result->ranges as $range) {
+ $this->ranges[] = array(
+ 'prefix' => $range->id->prefix,
+ 'tld' => $range->id->tld,
+ 'minDigits' => $range->minDigits,
+ 'maxDigits' => $range->maxDigits
+ );
if (in_array($range->id->tld, $this->allowedDomains)) continue;
- $this->allowedDomains[]=$range->id->tld;
+ $this->allowedDomains[] = $range->id->tld;
$seen[$range->id->tld]++;
}
if (!$seen[$this->SoapEngine->default_enum_tld]) {
- $this->allowedDomains[]=$this->SoapEngine->default_enum_tld;
+ $this->allowedDomains[] = $this->SoapEngine->default_enum_tld;
}
}
}
function showRecord($range)
{
- print "<table border=0 cellpadding=10>";
- print "
- <tr>
+ print <<< END
+<table border=0 cellpadding=10>
+ <tr>
<td valign=top>
- <table border=0>";
- printf ("<form method=post name=addform action=%s>",$_SERVER['PHP_SELF']);
- print "<input type=hidden name=action value=Update>";
-
- print "<tr>
- <td colspan=2><input type=submit value=Update>
- </td></tr>";
-
- printf ("<tr><td class=border>DNS zone</td><td class=border>%s</td></td>",
- $this->tel2enum($range->id->prefix, $range->id->tld));
+ <table border=0>
+END;
+ printf("<form method=post name=addform action=%s>", $_SERVER['PHP_SELF']);
+ print <<< END
+ <input type=hidden name=action value=Update>
+ <tr>
+ <td colspan=2><input type=submit value=Update></td>
+ </tr>
+END;
+
+ printf(
+ "<tr><td class=border>DNS zone</td><td class=border>%s</td></td>",
+ $this->tel2enum($range->id->prefix, $range->id->tld)
+ );
if ($this->adminonly) {
-
foreach (array_keys($this->FieldsAdminOnly) as $item) {
if ($item == 'nameservers') {
+ $nameservers = '';
foreach ($range->$item as $_item) {
- $nameservers.=$_item."\n";
+ $nameservers .= $_item."\n";
}
- $item_value=$nameservers;
+ $item_value = $nameservers;
} else {
- $item_value=$range->$item;
+ $item_value = $range->$item;
}
if ($this->FieldsAdminOnly[$item]['name']) {
- $item_name=$this->FieldsAdminOnly[$item]['name'];
+ $item_name = $this->FieldsAdminOnly[$item]['name'];
} else {
$item_name=ucfirst($item);
}
if ($this->FieldsAdminOnly[$item]['type'] == 'text') {
- printf ("<tr>
- <td class=border valign=top>%s</td>
- <td class=border><textarea cols=30 name=%s_form rows=7>%s</textarea></td>
- <td class=border valign=top>%s</td>
- </tr>",
- $item_name,
- $item,
- $item_value,
- $this->FieldsAdminOnly[$item]['help']
+ printf(
+ "
+ <tr>
+ <td class=border valign=top>%s</td>
+ <td class=border><textarea cols=30 name=%s_form rows=7>%s</textarea></td>
+ <td class=border valign=top>%s</td>
+ </tr>
+ ",
+ $item_name,
+ $item,
+ $item_value,
+ $this->FieldsAdminOnly[$item]['help']
);
} else {
- printf ("<tr>
- <td class=border valign=top>%s</td>
- <td class=border><input name=%s_form size=30 type=text value='%s'></td>
- <td class=border>%s</td>
- </tr>",
- $item_name,
- $item,
- $item_value,
- $this->FieldsAdminOnly[$item]['help']
+ printf(
+ "
+ <tr>
+ <td class=border valign=top>%s</td>
+ <td class=border><input name=%s_form size=30 type=text value='%s'></td>
+ <td class=border>%s</td>
+ </tr>
+ ",
+ $item_name,
+ $item,
+ $item_value,
+ $this->FieldsAdminOnly[$item]['help']
);
}
}
}
foreach (array_keys($this->Fields) as $item) {
if ($this->Fields[$item]['name']) {
- $item_name=$this->Fields[$item]['name'];
+ $item_name = $this->Fields[$item]['name'];
} else {
- $item_name=ucfirst($item);
+ $item_name = ucfirst($item);
}
if ($item == 'nameservers') {
+ $nameservers = '';
foreach ($range->$item as $_item) {
$nameservers.=$_item."\n";
}
- $item_value=$nameservers;
+ $item_value = $nameservers;
} else {
- $item_value=$range->$item;
+ $item_value = $range->$item;
}
if ($this->Fields[$item]['type'] == 'text') {
- printf ("<tr>
- <td class=border valign=top>%s</td>
- <td class=border><textarea cols=30 name=%s_form rows=7>%s</textarea></td>
- <td class=border valign=top>%s</td>
- </tr>",
- $item_name,
- $item,
- $item_value,
- $this->Fields[$item]['help']
+ printf(
+ "
+ <tr>
+ <td class=border valign=top>%s</td>
+ <td class=border><textarea cols=30 name=%s_form rows=7>%s</textarea></td>
+ <td class=border valign=top>%s</td>
+ </tr>
+ ",
+ $item_name,
+ $item,
+ $item_value,
+ $this->Fields[$item]['help']
);
- }else if ($this->Fields[$item]['readonly']) {
- printf ("<tr>
- <td class=border valign=top>%s</td>
- <td class=border>%s</td>
- <td class=border valign=top>%s</td>
- </tr>",
- $item_name,
- $item_value,
- $this->Fields[$item]['help']
+ } elseif ($this->Fields[$item]['readonly']) {
+ printf(
+ "
+ <tr>
+ <td class=border valign=top>%s</td>
+ <td class=border>%s</td>
+ <td class=border valign=top>%s</td>
+ </tr>
+ ",
+ $item_name,
+ $item_value,
+ $this->Fields[$item]['help']
);
} else {
- printf ("<tr>
- <td class=border valign=top>%s</td>
- <td class=border><input name=%s_form size=30 type=text value='%s'></td>
- <td class=border>%s</td>
- </tr>",
- $item_name,
- $item,
- $item_value,
- $this->Fields[$item]['help']
+ printf(
+ "
+ <tr>
+ <td class=border valign=top>%s</td>
+ <td class=border><input name=%s_form size=30 type=text value='%s'></td>
+ <td class=border>%s</td>
+ </tr>
+ ",
+ $item_name,
+ $item,
+ $item_value,
+ $this->Fields[$item]['help']
);
}
}
- printf ("<input type=hidden name=tld_filter value='%s'>",$range->id->tld);
- printf ("<input type=hidden name=prefix_filter value='%s'>",$range->id->prefix);
+ printf("<input type=hidden name=tld_filter value='%s'>", $range->id->tld);
+ printf("<input type=hidden name=prefix_filter value='%s'>", $range->id->prefix);
$this->printFiltersToForm();
$this->printHiddenFormElements();
- print "</form>";
- print "
- </table>
- ";
+ print <<< END
+ </form>
+</table>
+END;
}
function updateRecord()
{
//print "<p>Updating range ...";
if (!$_REQUEST['prefix_filter'] || !$_REQUEST['tld_filter']) return;
- $rangeid=array('prefix' => $_REQUEST['prefix_filter'],
- 'tld' => $_REQUEST['tld_filter']
- );
+ $rangeid = array(
+ 'prefix' => $_REQUEST['prefix_filter'],
+ 'tld' => $_REQUEST['tld_filter']
+ );
if (!$range = $this->getRecord($rangeid)) {
return false;
}
- $range_old=$range;
+ $range_old = $range;
foreach (array_keys($this->Fields) as $item) {
- $var_name=$item.'_form';
- //printf ("<br>%s=%s",$var_name, $_REQUEST[$var_name]);
+ $var_name = $item.'_form';
+ //printf("<br>%s=%s",$var_name, $_REQUEST[$var_name]);
if ($this->Fields[$item]['type'] == 'integer') {
$range->$item = intval($_REQUEST[$var_name]);
- } else if ($item == 'nameservers') {
- $_txt=trim($_REQUEST[$var_name]);
+ } elseif ($item == 'nameservers') {
+ $_txt = trim($_REQUEST[$var_name]);
if (!strlen($_txt)) {
unset($range->$item);
} else {
- $_nameservers=array();
- $_lines=explode("\n",$_txt);
+ $_nameservers = array();
+ $_lines = explode("\n", $_txt);
foreach ($_lines as $_line) {
- $_ns=trim($_line);
- $_nameservers[]=$_ns;
+ $_ns = trim($_line);
+ $_nameservers[] = $_ns;
}
- $range->$item=$_nameservers;
+ $range->$item = $_nameservers;
}
} else {
$range->$item = trim($_REQUEST[$var_name]);
}
}
if ($this->adminonly) {
foreach (array_keys($this->FieldsAdminOnly) as $item) {
- $var_name=$item.'_form';
+ $var_name = $item.'_form';
if ($this->FieldsAdminOnly[$item]['type'] == 'integer') {
$range->$item = intval($_REQUEST[$var_name]);
} else {
$range->$item = trim($_REQUEST[$var_name]);
}
}
}
- $function=array('commit' => array('name' => 'updateRange',
- 'parameters' => array($range),
- 'logs' => array('success' => sprintf('ENUM range +%s under %s has been updated',$rangeid['prefix'], $rangeid['tld'])))
- );
+ $function = array('commit' => array(
+ 'name' => 'updateRange',
+ 'parameters' => array($range),
+ 'logs' => array(
+ 'success' => sprintf('ENUM range +%s under %s has been updated', $rangeid['prefix'], $rangeid['tld'])))
+ );
$result = $this->SoapEngine->execute($function, $this->html);
dprint_r($result);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
return true;
}
}
function getRecord($rangeid)
{
// Filter
if (!$rangeid['prefix'] || !$rangeid['tld']) {
print "Error in getRecord(): Missing prefix or tld";
return false;
}
- $filter=array('prefix' => $rangeid['prefix'],
- 'tld' => $rangeid['tld']
- );
+ $filter = array(
+ 'prefix' => $rangeid['prefix'],
+ 'tld' => $rangeid['tld']
+ );
// Range
- $range=array('start' => 0,
- 'count' => 1
- );
+ $range = array(
+ 'start' => 0,
+ 'count' => 1
+ );
// Order
- $orderBy = array('attribute' => 'changeDate',
- 'direction' => 'DESC'
- );
+ $orderBy = array(
+ 'attribute' => 'changeDate',
+ 'direction' => 'DESC'
+ );
// Compose query
- $Query=array('filter' => $filter,
- 'orderBy' => $orderBy,
- 'range' => $range
- );
+ $Query = array(
+ 'filter' => $filter,
+ 'orderBy' => $orderBy,
+ 'range' => $range
+ );
$this->SoapEngine->soapclient->addHeader($this->SoapEngine->SoapAuth);
$this->log_action('getRanges');
$result = $this->SoapEngine->soapclient->getRanges($Query);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
- if ($result->ranges[0]){
+ if ($result->ranges[0]) {
return $result->ranges[0];
} else {
return false;
}
}
}
}
diff --git a/library/NGNPro/Records/SipAliases.php b/library/NGNPro/Records/SipAliases.php
index 42003d0..6114b30 100644
--- a/library/NGNPro/Records/SipAliases.php
+++ b/library/NGNPro/Records/SipAliases.php
@@ -1,576 +1,582 @@
<?php
class SipAliases extends Records
{
var $selectionActiveExceptions = array('alias_domain');
public function __construct($SoapEngine)
{
dprint("init SipAliases");
$target_filters_els = explode("@", trim($_REQUEST['target_username_filter']));
$target_username = $target_filters_els[0];
if (count($target_filters_els) > 1) {
$target_domain = $target_filters_els[1];
}
$this->filters = array(
'alias_username' => strtolower(trim($_REQUEST['alias_username_filter'])),
'alias_domain' => strtolower(trim($_REQUEST['alias_domain_filter'])),
'target_username' => strtolower($target_username),
'target_domain' => strtolower($target_domain)
);
parent::__construct($SoapEngine);
$this->sortElements = array(
'changeDate' => 'Change date',
'aliasUsername' => 'Alias user',
'aliasDomain' => 'Alias domain',
'targetUsername' => 'Target user',
'targetDomain' => 'Target domain',
);
}
function getRecordKeys()
{
// Filter
$filter = array(
'aliasUsername' => $this->filters['alias_username'],
'aliasDomain' => $this->filters['alias_domain'],
'targetUsername' => $this->filters['target_username'],
'targetDomain' => $this->filters['target_domain'],
'owner' => intval($this->filters['owner']),
'customer' => intval($this->filters['customer']),
'reseller' => intval($this->filters['reseller'])
);
// Range
$range = array(
'start' => 0,
'count' => 500
);
// Order
if (!$this->sorting['sortBy']) $this->sorting['sortBy'] = 'aliasUsername';
if (!$this->sorting['sortOrder']) $this->sorting['sortOrder'] = 'DESC';
$orderBy = array(
'attribute' => $this->sorting['sortBy'],
'direction' => $this->sorting['sortOrder']
);
// Compose query
$Query = array(
'filter' => $filter,
'orderBy' => $orderBy,
'range' => $range
);
//dprint_r($Query);
// Insert credetials
$this->SoapEngine->soapclient->addHeader($this->SoapEngine->SoapAuth);
$this->log_action('getAliases');
// Call function
$result = $this->SoapEngine->soapclient->getAliases($Query);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
foreach ($result->aliases as $alias) {
$this->selectionKeys[] = array('username' => $alias->id->username,
'domain' => $alias->id->domain);
}
return true;
}
}
function listRecords()
{
$this->getAllowedDomains();
// Make sure we apply the domain filter from the login credetials
$this->showSeachForm();
// Filter
$filter = array('aliasUsername' => $this->filters['alias_username'],
'aliasDomain' => $this->filters['alias_domain'],
'targetUsername' => $this->filters['target_username'],
'targetDomain' => $this->filters['target_domain'],
'owner' => intval($this->filters['owner']),
'customer' => intval($this->filters['customer']),
'reseller' => intval($this->filters['reseller'])
);
// Range
$range = array('start' => intval($this->next),
'count' => intval($this->maxrowsperpage)
);
// Order
if (!$this->sorting['sortBy']) $this->sorting['sortBy'] = 'changeDate';
if (!$this->sorting['sortOrder']) $this->sorting['sortOrder'] = 'DESC';
$orderBy = array('attribute' => $this->sorting['sortBy'],
'direction' => $this->sorting['sortOrder']
);
// Compose query
$Query = array('filter' => $filter,
'orderBy' => $orderBy,
'range' => $range
);
// Insert credetials
$this->SoapEngine->soapclient->addHeader($this->SoapEngine->SoapAuth);
$this->log_action('getAliases');
// Call function
$result = $this->SoapEngine->soapclient->getAliases($Query);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
$this->rows = $result->total;
if ($this->rows && $_REQUEST['action'] != 'PerformActions' && $_REQUEST['action'] != 'Delete') {
$this->showActionsForm();
}
print "
<p>
<div class=\"alert alert-success\"><center>$this->rows records found</center></div>
<p>
<table class='table table-condensed table-striped' width=100%>
<thead>
<tr>
<th>Id</th>
<th>SIP alias</th>
<th>Redirect target</th>
<th>Owner</th>
<th>Change date</th>
<th>Actions</th>
</tr>
</thead>
";
if (!$this->next) $this->next=0;
if ($this->rows > $this->maxrowsperpage) {
$maxrows = $this->maxrowsperpage + $this->next;
if ($maxrows > $this->rows) $maxrows = $this->maxrowsperpage;
} else {
$maxrows = $this->rows;
}
$i=0;
if ($this->rows) {
while ($i < $maxrows) {
if (!$result->aliases[$i]) break;
$alias = $result->aliases[$i];
$index = $this->next+$i+1;
$deleteUrl = array(
'service' => $this->SoapEngine->service,
'action' => 'Delete',
'alias_username_filter' => $alias->id->username,
'alias_domain_filter' => $alias->id->domain
);
if ($_REQUEST['action'] == 'Delete' &&
$_REQUEST['alias_username_filter'] == $alias->id->username &&
$_REQUEST['alias_domain_filter'] == $alias->id->domain) {
$deleteUrl['confirm'] = 1;
$actionText = "<font color=red>Confirm</font>";
} else {
$actionText = "Delete";
}
$_url = sprintf(
"%s&%s",
$this->url,
http_build_query($deleteUrl)
);
/*
$_customer_url = $this->url.sprintf("&service=customers@%s&customer_filter=%s",
urlencode($this->SoapEngine->customer_engine),
urlencode($alias->customer)
);
*/
$_sip_accounts_url = sprintf(
'%s&%s',
$this->url,
http_build_query(
array(
'service' => sprintf('sip_accounts@%s', $this->SoapEngine->soapEngine),
'username_filter' => $alias->target->username,
'domain_filter' => $alias->target->domain
)
)
);
if ($alias->owner) {
$_owner_url = sprintf(
'<a href="%s&%s">%s</a>',
$this->url,
http_build_query(
array(
'service' => sprintf('customers@%s', $this->SoapEngine->soapEngine),
'customer_filter' => $alias->owner
)
),
$alias->owner
);
} else {
$_owner_url='';
}
printf(
"
<tr>
<td>%s</td>
<td>%s@%s</td>
<td><a href=%s>%s@%s</a></td>
<td>%s</td>
<td>%s</td>
<td><a class='btn-small btn-danger' href=%s>%s</a></td>
</tr>
",
$index,
$alias->id->username,
$alias->id->domain,
$_sip_accounts_url,
$alias->target->username,
$alias->target->domain,
$_owner_url,
$alias->changeDate,
$_url,
$actionText
);
$i++;
}
}
print "</table>";
$this->showPagination($maxrows);
/*
$_properties=array(
array('name' => $this->SoapEngine->port.'_sortBy',
'value' => $this->sorting['sortBy'],
'permission' => 'customer',
'category' => 'web'
),
array('name' => $this->SoapEngine->port.'_sortOrder',
'value' => $this->sorting['sortOrder'],
'permission' => 'customer',
'category' => 'web'
)
);
print_r($_properties);
$this->setCustomerProperties($_properties);
*/
return true;
}
}
function deleteRecord($dictionary = array())
{
if (!$dictionary['confirm'] && !$_REQUEST['confirm']) {
print "<p><font color=red>Please press on Confirm to confirm the delete. </font>";
return true;
}
if ($dictionary['alias_username']) {
$alias_username = $dictionary['alias_username'];
} else {
$alias_username = $this->filters['alias_username'];
}
if ($dictionary['alias_domain']) {
$alias_domain = $dictionary['alias_domain'];
} else {
$alias_domain = $this->filters['alias_domain'];
}
if (!strlen($alias_username) || !strlen($alias_domain)) {
print "<p><font color=red>Error: missing SIP alias username or domain. </font>";
return false;
}
$alias = array('username' => $alias_username,
'domain' => $alias_domain
);
- $function = array('commit' => array('name' => 'deleteAlias',
- 'parameters' => array($alias),
- 'logs' => array('success' => sprintf('SIP alias %s@%s has been deleted',$this->filters['alias_username'], $this->filters['alias_domain'])
- )
- )
-
- );
+ $function = array(
+ 'commit' => array(
+ 'name' => 'deleteAlias',
+ 'parameters' => array($alias),
+ 'logs' => array(
+ 'success' => sprintf(
+ 'SIP alias %s@%s has been deleted',
+ $this->filters['alias_username'],
+ $this->filters['alias_domain']
+ )
+ )
+ )
+ );
unset($this->filters);
return $this->SoapEngine->execute($function, $this->html);
}
function showSeachFormCustom()
{
printf(
"
<div class='input-prepend'>
<span class='add-on'>SIP alias</span>
<input type=text class=span1 name=alias_username_filter value='%s'>
</div>
",
$this->filters['alias_username']
);
print "@";
if (count($this->allowedDomains) > 0) {
if ($this->filters['alias_domain'] && !in_array($this->filters['alias_domain'], $this->allowedDomains)) {
printf("<input type=text size=15 name=alias_domain_filter value='%s'>", $this->filters['alias_domain']);
} else {
$selected_domain[$this->filters['alias_domain']]='selected';
printf("<select name=alias_domain_filter>
<option>");
foreach ($this->allowedDomains as $_domain) {
printf("<option value='$_domain' %s>$_domain", $selected_domain[$_domain]);
}
printf("</select>");
}
} else {
printf("<input type=text size=15 name=alias_domain_filter value='%s'>", $this->filters['alias_domain']);
}
printf(
"
<div class='input-prepend'>
<span class='add-on'>Redirect target</span>
<input type=text class=span2 name=target_username_filter value='%s'>
</div>
",
trim($_REQUEST['target_username_filter'])
);
printf(
"
<div class='input-prepend'>
<span class='add-on'>Owner</span>
<input type=text class=span1 name=owner_filter value='%s'>
</div>
",
$this->filters['owner']
);
}
function showAddForm()
{
if ($this->selectionActive) return;
if (!count($this->allowedDomains)) {
print "<p><font color=red>You must create at least one SIP domain before adding SIP aliases</font>";
return false;
}
printf("<form class=form-inline method=post name=addform action=%s>", $_SERVER['PHP_SELF']);
print <<< END
<div class='well well-small'>
<input class='btn btn-warning' type=submit name=action value=Add>
END;
print <<< END
<div class='input-prepend'>
<span class='add-on'>SIP alias</span>
<input class=span2 type=text name=alias>
</div>
END;
if ($_REQUEST['domain']) {
$_domain = $_REQUEST['domain'];
$selected_domain[$_REQUEST['domain']]='selected';
} elseif ($_domain = $this->getCustomerProperty('sip_aliases_last_domain')) {
$selected_domain[$_domain]='selected';
}
if (count($this->allowedDomains) > 0) {
print "@<select name=domain>";
foreach ($this->allowedDomains as $_domain) {
printf("<option value='%s' %s>%s\n", $_domain, $selected_domain[$_domain], $_domain);
}
print "</select>";
} else {
printf("<input type=text name=domain class=span2 value='%s'>", $_domain);
}
print <<< END
<div class='input-prepend'>
<span class="add-on">Redirect target</span>
<input class=span2 type=text name=target>
</div>
END;
print <<< END
<div class='input-prepend'>
<span class='add-on'>Owner</span>
<input class=span1 type=text name=owner>
</div>
END;
$this->printHiddenFormElements();
print <<< END
</div>
</form>
END;
}
function addRecord($dictionary = array())
{
if ($dictionary['alias']) {
$alias_els = explode("@", $dictionary['alias']);
$this->skipSaveProperties = true;
} else {
$alias_els = explode("@", trim($_REQUEST['alias']));
}
if ($dictionary['target']) {
$target_els = explode("@", $dictionary['target']);
} else {
$target_els = explode("@", trim($_REQUEST['target']));
}
if ($dictionary['owner']) {
$owner = $dictionary['owner'];
} else {
$owner = $_REQUEST['owner'];
}
if (preg_match("/:(.*)$/", $target_els[0], $m)) {
$target_username = $m[1];
} else {
$target_username = $target_els[0];
}
if (preg_match("/:(.*)$/", $alias_els[0], $m)) {
$username = $m[1];
} else {
$username = $alias_els[0];
}
if (strlen($alias_els[1])) {
$domain = $alias_els[1];
} elseif (trim($_REQUEST['domain'])) {
$domain = trim($_REQUEST['domain']);
} else {
if ($this->html) {
printf("<p><font color=red>Error: Missing SIP domain</font>");
}
return false;
}
if (!$this->validDomain($domain)) {
if ($this->html) {
print "<font color=red>Error: invalid domain name</font>";
}
return false;
}
list($customer, $reseller)=$this->customerFromLogin($dictionary);
if (!$this->skipSaveProperties = true) {
$_p = array(
array('name' => 'sip_aliases_last_domain',
'category' => 'web',
'value' => strtolower($domain),
'permission' => 'customer'
)
);
$this->setCustomerProperties($_p);
}
$alias = array(
'id' => array('username' => strtolower($username),
'domain' => strtolower($domain)
),
'target' => array('username' => strtolower($target_username),
'domain' => strtolower($target_els[1])
),
'owner' => intval($owner)
);
$deleteAlias = array('username' => strtolower($username),
'domain' => strtolower($domain)
);
$function = array(
'commit' => array(
'name' => 'addAlias',
'parameters' => array($alias),
'logs' => array(
'success' => sprintf('SIP alias %s@%s has been added', $username, $domain)))
);
return $this->SoapEngine->execute($function, $this->html);
}
function getAllowedDomains()
{
// Filter
$filter = array(
'domain' => ''
);
// Range
$range = array(
'start' => 0,
'count' => 500
);
$orderBy = array(
'attribute' => 'domain',
'direction' => 'ASC'
);
// Compose query
$Query = array(
'filter' => $filter,
'orderBy' => $orderBy,
'range' => $range
);
$this->SoapEngine->soapclient->addHeader($this->SoapEngine->SoapAuth);
$this->log_action('getDomains');
$result = $this->SoapEngine->soapclient->getDomains($Query);
if ($this->checkLogSoapError($result, true)) {
return false;
} else {
foreach ($result->domains as $_domain) {
if ($this->validDomain($_domain->domain)) {
$this->allowedDomains[] = $_domain->domain;
}
}
}
}
function showTextBeforeCustomerSelection()
{
print _("Domain owner");
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 26, 7:46 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3414541
Default Alt Text
(64 KB)

Event Timeline