Example #1
0
 /**
  * Connect into the remote ISPCONFIG webservice 
  * 
  * Executes the 'login' command on ISPCONFIG's servers, to retrive the session variable
  * for execute the commands.
  * 
  * @return     string       Session variable
  * @access     private
  */
 public function connect($serverId)
 {
     $Soapclient = $this->getSoapclient();
     // Get parameters saved in the database
     $endpointlocation = CustomAttributes::getAttributeValue($serverId, "endpointlocation");
     $endpointuri = CustomAttributes::getAttributeValue($serverId, "endpointuri");
     $username = CustomAttributes::getAttributeValue($serverId, "username");
     $password = CustomAttributes::getAttributeValue($serverId, "password");
     if (!empty($endpointlocation) && !empty($endpointuri) && !empty($username) && !empty($password)) {
         $client = new SoapClient(null, array('location' => $endpointlocation, 'uri' => $endpointuri, 'trace' => 1, 'exceptions' => 1));
         $this->setSession($client->login($username, $password));
         $this->setSoapclient($client);
         return $client;
     }
     return false;
 }