[Hide properties if not available for logged in customer Adrian Georgescu **20071014082301 Allow specification of custom port names and classes per reseller Use engine user/password when remote ngnpro does not support customers port Fixed phplib typo that caused crash on php5 ] hunk ./phplib/session.inc 122 - SetCookie($this->name, $id, time()+$this->lifetime*60, "/", $this->$cookie_domain); + SetCookie($this->name, $id, time()+$this->lifetime*60, "/", $this->cookie_domain); hunk ./provisioning/ngnpro_client_lib.phtml 239 - + + if (is_array($this->loginCredentials['ports'])) { + $_ports=array(); + foreach (array_keys($this->ports) as $_key) { + if (in_array($_key,array_keys($this->loginCredentials['ports']))) { + if (strlen($this->loginCredentials['ports'][$_key]['recordsClass'])){ + $_ports[$_key]['recordsClass']=$this->loginCredentials['ports'][$_key]['recordsClass']; + } else { + $_ports[$_key]['recordsClass']=$this->ports[$_key]['recordsClass']; + } + if (strlen($this->loginCredentials['ports'][$_key]['soapClass'])){ + $_ports[$_key]['soapClass']=$this->loginCredentials['ports'][$_key]['soapClass']; + } else { + $_ports[$_key]['soapClass']=$this->ports[$_key]['soapClass']; + } + if (strlen($this->loginCredentials['ports'][$_key]['name'])){ + $_ports[$_key]['name']=$this->loginCredentials['ports'][$_key]['name']; + } else { + $_ports[$_key]['name']=$this->ports[$_key]['name']; + } + } else { + $_ports[$_key]=$this->ports[$_key]; + } + } + $this->ports=$_ports; + + } + hunk ./provisioning/ngnpro_client_lib.phtml 305 - $this->soapEnginePort = $_els[0]; - $this->recordsClass = $this->ports[$this->soapEnginePort]['recordsClass']; - $this->soapClass = $this->ports[$this->soapEnginePort]['soapClass']; + $this->port = $_els[0]; + $this->recordsClass = $this->ports[$this->port]['recordsClass']; + $this->soapClass = $this->ports[$this->port]['soapClass']; hunk ./provisioning/ngnpro_client_lib.phtml 309 - $this->soapEnginePort = $_els[0]; - $this->recordsClass = $this->ports[$this->soapEnginePort]['recordsClass']; - $this->soapClass = $this->ports[$this->soapEnginePort]['soapClass']; + $this->port = $_els[0]; + $this->recordsClass = $this->ports[$this->port]['recordsClass']; + $this->soapClass = $this->ports[$this->port]['soapClass']; hunk ./provisioning/ngnpro_client_lib.phtml 363 - if (strlen($loginCredentials['soapUsername'])) { + if (strlen($loginCredentials['soapUsername']) && $this->version > 1) { hunk ./provisioning/ngnpro_client_lib.phtml 365 - } else if ($this->adminonly) { - $this->soapUsername=$this->soapEngines[$this->soapEngine]['username']; - } - - if (strlen($loginCredentials['soapUsername'])) { hunk ./provisioning/ngnpro_client_lib.phtml 371 + // use the credentials defined for the soap engine + $this->soapUsername=$this->soapEngines[$this->soapEngine]['username']; hunk ./provisioning/ngnpro_client_lib.phtml 382 - //printf ("

Connection to %s at %s as %s/%s ",$this->soapClass,$this->SOAPurl,$this->SOAPurl,$this->soapUsername,$this->reseller); + //printf ("

Connection to %s at %s as %s ",$this->soapClass,$this->SOAPurl,$this->SOAPurl,$this->soapUsername); hunk ./provisioning/ngnpro_client_lib.phtml 407 - //print_r($this->SOAPloginRemote); + dprint_r($this->SOAPloginRemote); hunk ./provisioning/ngnpro_client_lib.phtml 551 - $this->soapEnginePort = 'customers'; - $this->recordsClass = $this->ports[$this->soapEnginePort]['recordsClass']; - $this->soapClass = $this->ports[$this->soapEnginePort]['soapClass']; + $this->port = 'customers'; + $this->recordsClass = $this->ports[$this->port]['recordsClass']; + $this->soapClass = $this->ports[$this->port]['soapClass']; hunk ./provisioning/ngnpro_client_lib.phtml 695 - $this->showResellerForm(); - print "."; hunk ./provisioning/ngnpro_client_lib.phtml 696 + print "."; + $this->showResellerForm(); hunk ./provisioning/ngnpro_client_lib.phtml 1164 + + function updateBefore () { + return true; + } + + function updateAfter () { + return true; + } + hunk ./provisioning/ngnpro_client_lib.phtml 6046 - 'category' => 'web' + 'category' => 'web', + 'permission' => 'customer' hunk ./provisioning/ngnpro_client_lib.phtml 6776 - /* - print "

";
-        print_r($customer);
-        print "
"; - */ - hunk ./provisioning/ngnpro_client_lib.phtml 7043 + if ($this->adminonly) { + hunk ./provisioning/ngnpro_client_lib.phtml 7052 + } else { + printf (" + Property + Value + "); + } hunk ./provisioning/ngnpro_client_lib.phtml 7067 - if ($this->allProperties[$item]['category'] != 'admin' || ($this->allProperties[$item]['category'] == 'admin' && $this->adminonly)) { + if ($this->adminonly) { hunk ./provisioning/ngnpro_client_lib.phtml 7082 - } else { + } else if ($this->allProperties[$item]['permission'] != 'admin' && $this->customer == $customer->reseller) { hunk ./provisioning/ngnpro_client_lib.phtml 7085 - %s - %s - %s + + ", + $this->allProperties[$item]['name'], + $item, + $this->allProperties[$item]['value'] + ); + } else if ($this->allProperties[$item]['permission'] != 'admin' && $this->allProperties[$item]['permission'] != 'reseller') { + printf (" hunk ./provisioning/ngnpro_client_lib.phtml 7094 + hunk ./provisioning/ngnpro_client_lib.phtml 7096 - $this->allProperties[$item]['category'], - $this->allProperties[$item]['permission'], - $item_print, + $this->allProperties[$item]['name'], hunk ./provisioning/ngnpro_client_lib.phtml 7098 - $this->allProperties[$item]['value'], - $this->allProperties[$item]['value'], - $this->allProperties[$item]['name'] + $this->allProperties[$item]['value'] hunk ./provisioning/ngnpro_client_lib.phtml 7188 - return $this->SOAPEngine->execute($function); + if ($this->SOAPEngine->execute($function)) { + $this->updateAfter($customer); + return true; + } else { + return false; + } hunk ./provisioning/ngnpro_client_lib.phtml 7605 + } hunk ./provisioning/ngnpro_client_lib.phtml 7607 + function getProperty($customer,$name) { + foreach ($customer->properties as $_property) { + if ($_property['name'] == $name && strlen($_property['value'])) { + return $_property['value']; + } + } + return false; hunk ./provisioning/ngnpro_client_lib.phtml 7741 - if (!is_numeric($nr_records) || $nr_records < 1 || $nr_records > 200) { - print "Error: number of records must be a number between 1 and 200"; + + if (!is_numeric($nr_records) || $nr_records < 1 || $nr_records > 100) { + print "Error: number of records must be a number between 1 and 100"; hunk ./provisioning/ngnpro_client_lib.phtml 7746 + hunk ./provisioning/ngnpro_client_lib.phtml 7755 + hunk ./provisioning/sip_settings_lib.phtml 374 - dprint_r($result); + //dprint_r($result);