예제 #1
0
파일: Main.php 프로젝트: kokkez/shineisp
 /**
  * Connect into the remote Ascio webservice 
  * 
  * Executes the 'login' command on Ascio's servers, to retrive the session variable
  * for execute the commands.
  * 
  * @return     string       Session variable
  * @access     private
  */
 private function Connect()
 {
     $registrar = Registrars::getActiveRegistrarbyClass(__CLASS__);
     try {
         if (!empty($registrar['config'])) {
             if (empty($registrar['ascio_soapuri'])) {
                 throw new Exception('Warning: Ascio Soap URI has been not set');
             }
             if (empty($registrar['ascio_username'])) {
                 throw new Exception('Warning: Ascio Username has been not set');
             }
             if (empty($registrar['ascio_password'])) {
                 throw new Exception('Warning: Ascio Password has been not set');
             }
             if (!empty($registrar)) {
                 $soap = new SoapClient($registrar['ascio_soapuri']);
                 $this->session['id'] = $soap->login($registrar['ascio_username'], $registrar['ascio_password'], "en", false);
                 return $soap;
             }
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
예제 #2
0
파일: Main.php 프로젝트: kokkez/shineisp
 /**
  * Connect into the remote OVH webservice 
  * 
  * Executes the 'login' command on OVH's servers, to retrive the session variable
  * for execute the commands.
  * 
  * @return     string       Session variable
  * @access     private
  */
 private function Connect()
 {
     $registrar = Registrars::getActiveRegistrarbyClass(__CLASS__);
     try {
         if (!empty($registrar['config'])) {
             if (empty($registrar['ovh_soapuri'])) {
                 throw new Exception('Warning: OVH Soap URI has been not set');
             }
             if (empty($registrar['ovh_username'])) {
                 throw new Exception('Warning: OVH Username has been not set');
             }
             if (empty($registrar['ovh_password'])) {
                 throw new Exception('Warning: OVH Password has been not set');
             }
             if (!empty($registrar)) {
                 $opts = array('http' => array('user_agent' => 'PHPSoapClient'));
                 $context = stream_context_create($opts);
                 $soap = new SoapClient($registrar['ovh_soapuri'], array('stream_context' => $context, 'cache_wsdl' => WSDL_CACHE_NONE));
                 $this->session['id'] = $soap->login($registrar['ovh_username'], $registrar['ovh_password'], "en", false);
                 return $soap;
             }
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }