[Do not show customer and reseller for sip accounts and aliases Adrian Georgescu **20080325223703 Get customer and domain from sip domain ] hunk ./provisioning/ngnpro_client_lib.phtml 2135 - "; - if ($this->version > 1) print "Customer"; - print" hunk ./provisioning/ngnpro_client_lib.phtml 2234 + /* hunk ./provisioning/ngnpro_client_lib.phtml 2238 + */ hunk ./provisioning/ngnpro_client_lib.phtml 2254 - %s - %s.%s + %s hunk ./provisioning/ngnpro_client_lib.phtml 2268 - $_customer_url, - $account->customer, - $account->reseller, hunk ./provisioning/ngnpro_client_lib.phtml 2877 - "; - if ($this->version > 1) print "Customer"; - print" hunk ./provisioning/ngnpro_client_lib.phtml 2931 + /* hunk ./provisioning/ngnpro_client_lib.phtml 2936 + */ hunk ./provisioning/ngnpro_client_lib.phtml 2959 - %s.%s hunk ./provisioning/ngnpro_client_lib.phtml 2968 - $_customer_url, - $alias->customer, - $alias->reseller, hunk ./provisioning/sip_settings_lib.phtml 618 - $this->getOwnerSettings(); - - if ($result->reseller) { - $this->reseller = $result->reseller; - } - - if ($result->customer) { - $this->customer = $result->customer; - } - - $this->result = $result; - hunk ./provisioning/sip_settings_lib.phtml 623 + $this->getOwnerSettings($this->owner); hunk ./provisioning/sip_settings_lib.phtml 625 - $this->xcap_root = rtrim($this->xcap_root,'/')."@".$this->domain."/"; + $this->getDomainOwner($this->domain); hunk ./provisioning/sip_settings_lib.phtml 628 + + $this->xcap_root = rtrim($this->xcap_root,'/')."@".$this->domain."/"; + + $this->result = $result; + hunk ./provisioning/sip_settings_lib.phtml 715 + function getDomainOwner ($domain='') { + if ($this->SOAPversion < 2) return; + + if (!$domain) return; + // Filter + $filter=array('domain' => $domain); + + // Range + $range=array('start' => 0, + 'count' => 1 + ); + + $orderBy = array('attribute' => 'changeDate', + 'direction' => 'DESC' + ); + + // Compose query + $Query=array('filter' => $filter, + 'orderBy' => $orderBy, + 'range' => $range + ); + + dprint_r($Query); + + // Call function + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->getDomains($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 { + if ($result->domains[0]) { + $this->reseller = $result->domains[0]->reseller; + $this->customer = $result->domains[0]->customer; + } + } + } + hunk ./provisioning/sip_settings_lib.phtml 783 - function getOwnerSettings() { - dprint("getOwnerSettings($this->owner, engine=$this->customer_engine)"); - if (!$this->owner) { + function getOwnerSettings($owner='') { + dprint("getOwnerSettings($owner, engine=$this->customer_engine)"); + if (!$owner) { hunk ./provisioning/sip_settings_lib.phtml 791 - $result = $this->CustomerPort->getAccount($this->owner); + $result = $this->CustomerPort->getAccount($owner);