[Fixed the problem with the soap client adding multiple times the same auth header Adrian Georgescu **20070909103751 Added actions for sip aliases and enum mappings ] hunk ./provisioning_logic.phtml 3 - var $adminonly = 0; - var $reseller = 0; + var $adminonly = 0; + var $reseller = 0; hunk ./provisioning_logic.phtml 44 - /* + //print("

Init SOAP engine class"); hunk ./provisioning_logic.phtml 46 + /* hunk ./provisioning_logic.phtml 89 + $this->defaultEnumTLD = $this->soapEngines[$this->soapEngineId]['defaultEnumTLD']; + hunk ./provisioning_logic.phtml 120 - // Instantiate the SOAP client for Execute wrapper - $this->soapclientExecute = new $this->soapClass($this->SOAPurl); - - $this->soapclientExecute->setOpt('curl', CURLOPT_TIMEOUT, 5); - $this->soapclientExecute->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); - $this->soapclientExecute->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); - hunk ./provisioning_logic.phtml 152 - hunk ./provisioning_logic.phtml 193 + hunk ./provisioning_logic.phtml 205 - $this->soapclientExecute->addHeader($this->SoapAuth); - $result = call_user_func_array(array($this->soapclientExecute,$function['commit']['name']),$function['commit']['parameters']); + $this->soapclient->addHeader($this->SoapAuth); + $result = call_user_func_array(array($this->soapclient,$function['commit']['name']),$function['commit']['parameters']); hunk ./provisioning_logic.phtml 215 + hunk ./provisioning_logic.phtml 217 + $this->counterRemote++; + hunk ./provisioning_logic.phtml 242 - $this->soapclientExecute->addHeader($this->SoapAuth); - $result = call_user_func_array(array($this->soapclientExecute,$function['commit']['name']),$function['commit']['parameters']); + $this->soapclient->addHeader($this->SoapAuth); + $result = call_user_func_array(array($this->soapclient,$function['commit']['name']),$function['commit']['parameters']); hunk ./provisioning_logic.phtml 257 + hunk ./provisioning_logic.phtml 263 - var $maxrowsperpage = '20'; + var $maxrowsperpage = '15'; hunk ./provisioning_logic.phtml 295 - $this->filters['reseller']=trim($_REQUEST['reseller_filter']); + + if (!$this->adminonly && $this->reseller) { + // Force filter if reseller + $this->filters['reseller']=$this->reseller; + } else { + $this->filters['reseller']=trim($_REQUEST['reseller_filter']); + } hunk ./provisioning_logic.phtml 347 + $url .= $this->url.'&'.$this->addFiltersToURL(). + sprintf("&service=%s&sortBy=%s&sortOrder=%s", + urlencode($this->SOAPEngine->service), + urlencode($this->sorting['sortBy']), + urlencode($this->sorting['sortOrder']) + ); + hunk ./provisioning_logic.phtml 361 - $url .= $this->url.sprintf("&service=%s&sortBy=%s&sortOrder=%s", - urlencode($this->SOAPEngine->service), - urlencode($this->sorting['sortBy']), - urlencode($this->sorting['sortOrder']) - ); - - if ($this->filters['customer']) { - $url .= sprintf('&customer_filter=%s',$this->filters['customer']); - } - - if ($this->filters['reseller']) { - $url .= sprintf('&reseller_filter=%s',$this->filters['reseller']); - } - - hunk ./provisioning_logic.phtml 367 - $url_prev=$url."&next=$mod_show_next"; - $url_begin=$url."&next=0"; hunk ./provisioning_logic.phtml 369 - printf ("Begin ",$url_begin); + printf ("Begin ",$url); hunk ./provisioning_logic.phtml 371 - printf ("Previous ",$url_prev); + + printf ("Previous ",$url,$mod_show_next); hunk ./provisioning_logic.phtml 382 - $url_next = $url."&next=$show_next"; - printf ("Next ",$url_next); + + printf ("Next ",$url,$show_next); hunk ./provisioning_logic.phtml 660 + + function addFiltersToURL() { + + /* + print "

";
+		print_r($this->filters);
+        print "
"; + */ + + $j=0; + foreach(array_keys($this->filters) as $filter) { + if (strlen(trim($this->filters[$filter]))) { + if ($j) $url .='&'; + $url .= sprintf('%s_filter=%s',$filter,urlencode(trim($this->filters[$filter]))); + } + $j++; + } + + return $url; + } hunk ./provisioning_logic.phtml 978 - $this->selectionKeys[]=$account->id->username.'@'.$account->id->domain; + $this->selectionKeys[]=array('username' => $account->id->username, + 'domain' => $account->id->domain + ); hunk ./provisioning_logic.phtml 987 - hunk ./provisioning_logic.phtml 1034 - if (strlen($this->filters['username'])) $this->url .= sprintf("&username_filter=%s",urlencode($this->filters['username'])); - if (strlen($this->filters['domain'])) $this->url .= sprintf("&domain_filter=%s",urlencode($this->filters['domain'])); - if (strlen($this->filters['fullname'])) $this->url .= sprintf("&fullname_filter=%s",urlencode($this->filters['fullname'])); - hunk ./provisioning_logic.phtml 1230 - 'logs' => array('success' => sprintf('
  • SIP account %s@%s has been deleted',$this->filters['username'],$this->filters['domain']) + 'logs' => array('success' => sprintf('

    SIP account %s@%s has been deleted',$this->filters['username'],$this->filters['domain']) hunk ./provisioning_logic.phtml 1376 - 'logs' => array('success' => sprintf('

  • SIP account %s@%s has been added',$username,$domain))), + 'logs' => array('success' => sprintf('

    SIP account %s@%s has been added',$username,$domain))), hunk ./provisioning_logic.phtml 1436 - hunk ./provisioning_logic.phtml 1440 + function getRecordKeys() { + // Make sure we apply the domain filter from the login credetials + if ($this->allowedDomains && !$this->filters['aliasDomain']) { + //$this->filters['aliasDomain'] = $this->allowedDomains[0]; + } + + if ($this->filters['aliasDomain'] && $this->allowedDomains && !in_array($this->filters['aliasDomain'],$this->allowedDomains)) { + $this->filters['aliasDomain'] = $this->allowedDomains[0]; + } + + // Filter + $filter=array('aliasUsername' => $this->filters['aliasUsername'], + 'aliasDomain' => $this->filters['aliasDomain'], + 'targetUsername' => $this->filters['targetUsername'], + 'targetDomain' => $this->filters['targetDomain'] + ); + + // Range + $range=array('start' => 0, + 'count' => 1000 + ); + + // 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 + ); + + //print_r($Query); + // Insert credetials + $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); + + // Call function + $result = $this->SOAPEngine->soapclient->getAliases($Query); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

    Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + foreach ($result->aliases as $alias) { + $this->selectionKeys[]=array('username' => $alias->id->username, + 'domain' => $alias->id->domain); + } + + return true; + } + } + + hunk ./provisioning_logic.phtml 1540 - if (strlen($this->filters['aliasUsername'])) $this->url .= sprintf("&alias_username_filter=%s",urlencode($this->filters['aliasUsername'])); - if (strlen($this->filters['aliasDomain'])) $this->url .= sprintf("&alias_domain_filter=%s",urlencode($this->filters['aliasDomain'])); - if (strlen($this->filters['targetUsername'])) $this->url .= sprintf("&target_username_filter=%s",urlencode($this->filters['targetUsername'])); - if (strlen($this->filters['targetDomain'])) $this->url .= sprintf("&target_domain_filter=%s",urlencode($this->filters['targetDomain'])); - hunk ./provisioning_logic.phtml 1675 - 'logs' => array('success' => sprintf('

  • SIP alias %s@%s has been deleted',$this->filters['aliasUsername'],$this->filters['aliasDomain']) + 'logs' => array('success' => sprintf('

    SIP alias %s@%s has been deleted',$this->filters['aliasUsername'],$this->filters['aliasDomain']) hunk ./provisioning_logic.phtml 1819 - 'logs' => array('success' => sprintf('

  • SIP alias %s@%s has been added',$username,$domain))), + 'logs' => array('success' => sprintf('

    SIP alias %s@%s has been added',$username,$domain))), hunk ./provisioning_logic.phtml 1895 - Top level domain + TLD hunk ./provisioning_logic.phtml 2012 - 'logs' => array('success' => sprintf('

  • ENUM range %s under %s has been deleted',$this->filters['prefix'],$this->filters['tld']) + 'logs' => array('success' => sprintf('

    ENUM range +%s under %s has been deleted',$this->filters['prefix'],$this->filters['tld']) hunk ./provisioning_logic.phtml 2041 - printf (" Prefix: +"); - printf (" Top level domain: "); - printf (" TTL: "); - printf (" Min Digits: "); - printf (" Max Digits: "); + printf ("Prefix: + "); + printf ("TLD: "); + printf ("TTL: "); + printf ("Min Digits: "); + printf ("Max Digits: "); hunk ./provisioning_logic.phtml 2077 - if (!strlen($tld) || !strlen($prefix)) { + if (!strlen($tld)) { + if (strlen($this->SOAPEngine->defaultEnumTLD)) { + $tld=$this->SOAPEngine->defaultEnumTLD; + } else { + $tld='e164.arpa'; + } + } + + if (!strlen($tld) || !strlen($prefix) || !is_numeric($prefix)) { hunk ./provisioning_logic.phtml 2124 - 'logs' => array('success' => sprintf('

  • ENUM range +%s under %s has been added',$this->filters['prefix'],$this->filters['tld']))), + 'logs' => array('success' => sprintf('

    ENUM range +%s under %s has been added',$prefix,$tld))), hunk ./provisioning_logic.phtml 2266 - if (strlen($this->filters['number'])) $this->url .= sprintf("&number_filter=%s",urlencode($this->filters['number'])); - if (strlen($this->filters['type'])) $this->url .= sprintf("&type_filter=%s",urlencode($this->filters['type'])); - if (strlen($this->filters['mapto'])) $this->url .= sprintf("&mapto_filter=%s",urlencode($this->filters['mapto'])); - hunk ./provisioning_logic.phtml 2296 - Top level domain + TLD hunk ./provisioning_logic.phtml 2434 - printf (" Number: ",$this->filters['number']); + printf (" Number:",$this->filters['number']); hunk ./provisioning_logic.phtml 2450 - printf (" Service: "); + printf (" Srv:"); hunk ./provisioning_logic.phtml 2465 - printf (" Map to: ",$this->filters['mapto']); + printf (" Map to:",$this->filters['mapto']); hunk ./provisioning_logic.phtml 2485 - 'logs' => array('success' => sprintf('

  • ENUM number +%s under %s has been deleted',$this->filters['number'],$this->filters['tld']) + 'logs' => array('success' => sprintf('

    ENUM number +%s under %s has been deleted',$this->filters['number'],$this->filters['tld']) hunk ./provisioning_logic.phtml 2516 - printf (" Top level domain:"); + printf (" TLD:"); hunk ./provisioning_logic.phtml 2584 + $seen[$range->id->tld]++; + } + if (strlen($this->SOAPEngine->defaultEnumTLD) && !$seen[$this->SOAPEngine->defaultEnumTLD]) { + $this->allowedDomains[]=$this->SOAPEngine->defaultEnumTLD; hunk ./provisioning_logic.phtml 2596 - if (!strlen($tld) || !strlen($number)) { + if (!strlen($tld)) { + if (strlen($this->SOAPEngine->defaultEnumTLD)) { + $tld=$this->SOAPEngine->defaultEnumTLD; + } else { + $tld='e164.arpa'; + } + } + + if (!strlen($tld) || !strlen($number) || !is_numeric($number)) { hunk ./provisioning_logic.phtml 2672 - 'logs' => array('success' => sprintf('

  • ENUM number +%s under %s has been added',$number,$tld))), + 'logs' => array('success' => sprintf('

    ENUM number +%s under %s has been added',$number,$tld))), hunk ./provisioning_logic.phtml 2686 + + function getRecordKeys() { + + // Filter + $filter=array('number' => $this->filters['number'], + 'type' => $this->filters['type'], + 'mapto' => $this->filters['mapto'] + ); + // Range + $range=array('start' => 0, + 'count' => 1000 + ); + + // 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); + + // Call function + $result = $this->SOAPEngine->soapclient->getNumbers($Query); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

    Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + foreach ($result->numbers as $number) { + $this->selectionKeys[]=array('number' => $number->id->number, + 'tld' => $number->id->tld); + } + return true; + } + } hunk ./provisioning_logic.phtml 2781 - if (strlen($this->filters['ip'])) $this->url .= sprintf("&ip_filter=%s",urlencode($this->filters['ip'])); - if (strlen($this->filters['description'])) $this->url .= sprintf("&description_filter=%s",urlencode($this->filters['description'])); - hunk ./provisioning_logic.phtml 3063 - if (strlen($this->filters['group'])) $this->url .= sprintf("&group_filter=%s",urlencode($this->filters['group'])); - hunk ./provisioning_logic.phtml 3076 - print "

    ";
    -            //print_r($result);
    -            print "
    "; hunk ./provisioning_logic.phtml 3305 - if (strlen($this->filters['name'])) $this->url .= sprintf("&name_filter=%s",urlencode($this->filters['name'])); - if (strlen($this->filters['group'])) $this->url .= sprintf("&group_filter=%s",urlencode($this->filters['group'])); - hunk ./provisioning_logic.phtml 3318 - print "
    ";
    -            //print_r($result);
    -            print "
    "; hunk ./provisioning_logic.phtml 3660 - if (strlen($this->filters['prefix'])) $this->url .= sprintf("&prefix_filter=%s",urlencode($this->filters['prefix'])); - if (strlen($this->filters['gatewayGroup'])) $this->url .= sprintf("&gatewayGroup_filter=%s",urlencode($this->filters['gatewayGroup'])); - if (strlen($this->filters['fromURI'])) $this->url .= sprintf("&fromURI_filter=%s",urlencode($this->filters['fromURI'])); - hunk ./provisioning_logic.phtml 3673 - print "
    ";
    -            //print_r($result);
    -            print "
    "; hunk ./provisioning_logic.phtml 4129 - if (strlen($this->filters['username'])) $this->url .= sprintf("&username_filter=%s",urlencode($this->filters['username'])); - if (strlen($this->filters['id'])) $this->url .= sprintf("&id_filter=%s",urlencode($this->filters['id'])); - hunk ./provisioning_logic.phtml 4180 - //print "
    ";
    -            //print_r($result);
    -
    hunk ./provisioning_logic.phtml 4286
    -        $this->adminonly=$this->SOAPEngine->adminonly;
    +        $this->adminonly  = $this->SOAPEngine->adminonly;
    hunk ./provisioning_logic.phtml 4384
    +        if (!in_array($action,array_keys($this->actions))) {
    +            print "Error: Invalid action $action";
    +        	return false;
    +        }
    +
    hunk ./provisioning_logic.phtml 4391
    +
    hunk ./provisioning_logic.phtml 4393
    -            //printf ("
  • Performing action=%s on key=%s",$action,$key); - list($username,$domain)=explode('@',trim($key)); + //printf ("Performing action=%s on key=%s",$action,$key); hunk ./provisioning_logic.phtml 4395 - $account=array('username' => $username, - 'domain' => $domain + $account=array('username' => $key['username'], + 'domain' => $key['domain'] hunk ./provisioning_logic.phtml 4403 - 'logs' => array('success' => sprintf('
  • SIP account %s has been blocked',$key) + 'logs' => array('success' => sprintf('SIP account %s@%s has been blocked',$key['username'],$key['domain']) hunk ./provisioning_logic.phtml 4415 - 'logs' => array('success' => sprintf('
  • SIP account %s has been de-blocked',$key) + 'logs' => array('success' => sprintf('SIP account %s@%s has been de-blocked',$key['username'],$key['domain']) hunk ./provisioning_logic.phtml 4425 - printf ("
  • Error: you must enter a group name"); + printf ("Error: you must enter a group name"); hunk ./provisioning_logic.phtml 4431 - 'logs' => array('success' => sprintf('
  • SIP account %s has been removed from group',$key,$sub_action_parameter) + 'logs' => array('success' => sprintf('SIP account %s@%s has been removed from group',$key['username'],$key['domain'],$sub_action_parameter) hunk ./provisioning_logic.phtml 4441 - printf ("
  • Error: you must enter a group name"); + printf ("Error: you must enter a group name"); hunk ./provisioning_logic.phtml 4447 - 'logs' => array('success' => sprintf('
  • SIP account %s is now in group %s',$key,$sub_action_parameter) + 'logs' => array('success' => sprintf('SIP account %s@%s is now in group %s',$key['username'],$key['domain'],$sub_action_parameter) hunk ./provisioning_logic.phtml 4459 - 'logs' => array('success' => sprintf('
  • SIP account %s has been deblocked from quota',$key) + 'logs' => array('success' => sprintf('SIP account %s@%s has been deblocked from quota',$key['username'],$key['domain']) hunk ./provisioning_logic.phtml 4471 - 'logs' => array('success' => sprintf('
  • SIP account %s has no access to the PSTN',$key) + 'logs' => array('success' => sprintf('SIP account %s@%s has no access to the PSTN',$key['username'],$key['domain']) hunk ./provisioning_logic.phtml 4483 - 'logs' => array('success' => sprintf('
  • SIP account %s has access to the PSTN',$key) + 'logs' => array('success' => sprintf('SIP account %s@%s has access to the PSTN',$key['username'],$key['domain']) hunk ./provisioning_logic.phtml 4495 - 'logs' => array('success' => sprintf('
  • SIP account %s has been deleted',$key) + 'logs' => array('success' => sprintf('SIP account %s@%s has been deleted',$key['username'],$key['domain']) hunk ./provisioning_logic.phtml 4511 - printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 4525 - 'logs' => array('success' => sprintf('
  • SIP account %s is now prepaid',$key) + 'logs' => array('success' => sprintf('SIP account %s@%s is now prepaid',$key['username'],$key['domain']) hunk ./provisioning_logic.phtml 4541 - printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 4555 - 'logs' => array('success' => sprintf('
  • SIP account %s is now postpaid',$key) + 'logs' => array('success' => sprintf('SIP account %s@%s is now postpaid',$key['username'],$key['domain']) hunk ./provisioning_logic.phtml 4571 - printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 4583 - 'logs' => array('success' => sprintf('
  • SIP account %s has quota set to %s',$key,$sub_action_parameter) + 'logs' => array('success' => sprintf('SIP account %s@%s has quota set to %s',$key['username'],$key['domain'],$sub_action_parameter) hunk ./provisioning_logic.phtml 4599 - printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 4612 - 'logs' => array('success' => sprintf('
  • SIP account %s has PSTN caller ID set to %s',$key,$sub_action_parameter) + 'logs' => array('success' => sprintf('SIP account %s@%s has PSTN caller ID set to %s',$key['username'],$key['domain'],$sub_action_parameter) hunk ./provisioning_logic.phtml 4628 - printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 4646 - 'logs' => array('success' => sprintf('
  • SIP account %s has PSTN caller ID set to %s%s ',$key,$sub_action_parameter,$result->rpid) + 'logs' => array('success' => sprintf('SIP account %s@%s has PSTN caller ID set to %s%s ',$key['username'],$key['domain'],$sub_action_parameter,$result->rpid) hunk ./provisioning_logic.phtml 4656 - printf ("
  • Error: you must enter a positive balance"); + printf ("Error: you must enter a positive balance"); hunk ./provisioning_logic.phtml 4667 - printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 4672 - printf ("
  • Info: SIP account %s is not prepaid, no action performed",$key); + printf ("Info: SIP account %s@%s is not prepaid, no action performed",$key['username'],$key['domain']); hunk ./provisioning_logic.phtml 4678 - 'logs' => array('success' => sprintf('
  • SIP account %s balance has been increased with %s',$key,$sub_action_parameter) + 'logs' => array('success' => sprintf('SIP account %s@%s balance has been increased with %s',$key['username'],$key['domain'],$sub_action_parameter) hunk ./provisioning_logic.phtml 4703 + if (!in_array($action,array_keys($this->actions))) { + print "Error: Invalid action $action"; + return false; + } + hunk ./provisioning_logic.phtml 4712 - //printf ("
  • Performing action=%s on key=%s",$action,$key); - list($username,$domain)=explode('@',trim($key)); - - $alias=array('username' => $username, - 'domain' => $domain + //printf ("Performing action=%s on key=%s",$action,$key); + $alias=array('username' => $key['username'], + 'domain' => $key['domain'] hunk ./provisioning_logic.phtml 4716 + + if ($action=='delete') { hunk ./provisioning_logic.phtml 4719 - $function=array('commit' => array('name' => 'deleteAlias', - 'parameters' => array($alias), - 'logs' => array('success' => sprintf('
  • SIP alias %s@%s has been deleted',$username,$domain) - ) - ) + $function=array('commit' => array('name' => 'deleteAlias', + 'parameters' => array($alias), + 'logs' => array('success' => sprintf('SIP alias %s@%s has been deleted',$key['username'],$key['domain']) + ) + ) + + ); hunk ./provisioning_logic.phtml 4727 - ); + //$this->SOAPEngine->execute($function); + } + } + print ""; + + } hunk ./provisioning_logic.phtml 4734 - $this->SOAPEngine->execute($function); +} + +class ENUMMappingsActions extends Actions { + var $actions=array( + 'delete' => 'Delete ENUM mappings' + ); + + function ENUMMappingsActions(&$SOAPEngine) { + $this->Actions(&$SOAPEngine); + } + + function performActions($selectionKeys,$action,$sub_action_parameter) { + if (!in_array($action,array_keys($this->actions))) { + print "Error: Invalid action $action"; + return false; + } + + print "
      "; + foreach($selectionKeys as $key) { + flush(); + + + if ($action=='delete') { + + //printf ("Performing action=%s on key=%s",$action,$key); + $enum_id=array('number' => $key['number'], + 'tld' => $key['tld'] + ); + + $function=array('commit' => array('name' => 'deleteNumber', + 'parameters' => array($enum_id), + 'logs' => array('success' => sprintf('ENUM number +%s under %s has been deleted',$key['number'],$key['tld']) + ) + ) + + ); + + $this->SOAPEngine->execute($function); + } hunk ./provisioning_logic.phtml 4774 + hunk ./provisioning_soap_library.phtml 2 -class WebService_NGNPro_SipPort extends SOAP_Client +class SOAP_Client_Custom extends SOAP_Client { + function addHeader(&$soap_value) { + # add a new header to the message + + if (is_array($soap_value)) { + foreach ($this->headersOut as $_header) { + if ($_header->name == $soap_value[0]) { + return true; + } + } + } + + if (is_a($soap_value,'soap_header')) { + $this->headersOut[] =& $soap_value; + } else if (gettype($soap_value) == 'array') { + // name, value, namespace, mustunderstand, actor + $this->headersOut[] =& new SOAP_Header($soap_value[0], NULL, $soap_value[1], $soap_value[2], $soap_value[3]);; + } else { + $this->_raiseSoapFault("Don't understand the header info you provided. Must be array or SOAP_Header."); + } + } +} + +class WebService_NGNPro_SipPort extends SOAP_Client_Custom hunk ./provisioning_soap_library.phtml 29 - $this->SOAP_Client($url, 0); + $this->SOAP_Client_Custom($url, 0); hunk ./provisioning_soap_library.phtml 453 -class WebService_NGNPro_VoicemailPort extends SOAP_Client +class WebService_NGNPro_VoicemailPort extends SOAP_Client_Custom hunk ./provisioning_soap_library.phtml 457 - $this->SOAP_Client($url, 0); + $this->SOAP_Client_Custom($url, 0); hunk ./provisioning_soap_library.phtml 512 -class WebService_NGNPro_EnumPort extends SOAP_Client +class WebService_NGNPro_EnumPort extends SOAP_Client_Custom hunk ./provisioning_soap_library.phtml 516 - $this->SOAP_Client($url, 0); + $this->SOAP_Client_Custom($url, 0); hunk ./provisioning_soap_library.phtml 604 -class WebService_NGNPro_RatingPort extends SOAP_Client +class WebService_NGNPro_RatingPort extends SOAP_Client_Custom hunk ./provisioning_soap_library.phtml 608 - $this->SOAP_Client($url, 0); + $this->SOAP_Client_Custom($url, 0); hunk ./provisioning_soap_library.phtml 638 -class WebService_NGNPro_CustomerPort extends SOAP_Client +class WebService_NGNPro_CustomerPort extends SOAP_Client_Custom hunk ./provisioning_soap_library.phtml 642 - $this->SOAP_Client($url, 0); + $this->SOAP_Client_Custom($url, 0); hunk ./provisioning_soap_library.phtml 706 -class WebService_NGNPro_NetworkPort extends SOAP_Client +class WebService_NGNPro_NetworkPort extends SOAP_Client_Custom hunk ./provisioning_soap_library.phtml 710 - $this->SOAP_Client($url, 0); + $this->SOAP_Client_Custom($url, 0); hunk ./provisioning_soap_library.phtml 803 -class WebService_GeckoSIMPLEProxy_PresencePort extends SOAP_Client +class WebService_GeckoSIMPLEProxy_PresencePort extends SOAP_Client_Custom hunk ./provisioning_soap_library.phtml 807 - $this->SOAP_Client($url, 0); + $this->SOAP_Client_Custom($url, 0);