/**
  * getCosId
  * @param string $name the COS name
  * @return string COS id
  */
 function getCosId($name)
 {
     $result = null;
     $params = array(new SoapVar('<cos by="name">' . $name . '</cos>', XSD_ANYXML));
     try {
         $result = $this->auth->execSoapCall("GetCosRequest", $params);
         $result = $result['SOAP:ENVELOPE']['SOAP:BODY']['GETCOSRESPONSE']['COS']['ID'];
     } catch (SoapFault $exception) {
         $result = $exception;
     }
     return $result;
 }
 /**
  * modifyUserPrefs
  * @param string $userName user name
  * @param array $prefs an array containing the user prefs to be set
  * @return array informations
  */
 function modifyUserPrefs($userName, $prefs = array())
 {
     $result = null;
     $params = array(new SoapParam($userName, "account"));
     foreach ($prefs as $key => $value) {
         $params[] = new SoapVar('<pref name="' . $key . '">' . $value . '</pref>', XSD_ANYXML);
     }
     try {
         $result = $this->auth->execSoapCall("ModifyPrefsRequest", $params);
     } catch (SoapFault $exception) {
         $result = $exception;
     }
     return $result;
 }
 /**
  * deleteServer
  * @param string $idOrNameServer server id or server name
  * @param string $type value of the server (auto, name, id)
  * @return array informations
  */
 function deleteServer($idOrNameServer, $type = "auto")
 {
     if ($type == "auto") {
         $realType = getServerType($idOrNameServer);
     } else {
         $realType = $type;
     }
     if ($realType == "name") {
         $serverId = $this->getServerId($idOrNameServer);
     } else {
         $serverId = $idOrNameServer;
     }
     $result = null;
     $params = array(new SoapParam($serverId, "id"));
     try {
         $result = $this->auth->execSoapCall("DeleteServerRequest", $params);
     } catch (SoapFault $exception) {
         $result = $exception;
     }
     return $result;
 }
 /**
  * deleteDomain
  * @param string $idOrNameDomain domain id or domain name
  * @param string $type value of the domain (auto, name, id)
  * @return array informations
  */
 function deleteDomain($idOrNameDomain, $type = "auto")
 {
     if ($type == "auto") {
         $realType = getDomainType($idOrNameDomain);
     } else {
         $realType = $type;
     }
     if ($realType == "name") {
         $domainId = $this->getDomainId($idOrNameDomain);
     } else {
         $domainId = $idOrNameDomain;
     }
     $result = null;
     $params = array(new SoapParam($domainId, "id"));
     try {
         $result = $this->auth->execSoapCall("DeleteDomainRequest", $params);
     } catch (SoapFault $exception) {
         $result = $exception;
     }
     return $result;
 }