/**
  * The logoff method logs a user off from a service and ends the session
  * or returns an error message.
  *
  * @access public
  *
  * @param XML_RPC_Message &$oParams
  *
  * @return generated result (data or error)
  */
 function logoff(&$oParams)
 {
     $sessionId = null;
     $oResponseWithError = null;
     if (!XmlRpcUtils::getRequiredScalarValue($sessionId, $oParams, 0, $oResponseWithError)) {
         return $oResponseWithError;
     }
     if ($this->logonServiceImp->logoff($sessionId)) {
         return XmlRpcUtils::booleanTypeResponse(true);
     } else {
         return XmlRpcUtils::generateError($this->logonServiceImp->getLastError());
     }
 }
 /**
  * The modifyPublisher method changes the details for an existing publisher
  * or returns an error message.
  *
  * @access public
  *
  * @param  XML_RPC_Message $oParams
  *
  * @return generated result (data or error)
  */
 function modifyPublisher($oParams)
 {
     $sessionId = null;
     $oPublisherInfo = new OA_Dll_PublisherInfo();
     $oResponseWithError = null;
     if (!XmlRpcUtils::getRequiredScalarValue($sessionId, $oParams, 0, $oResponseWithError) || !XmlRpcUtils::getStructureScalarFields($oPublisherInfo, $oParams, 1, array('publisherId', 'agencyId', 'publisherName', 'contactName', 'emailAddress', 'website', 'username', 'password', 'comments'), $oResponseWithError)) {
         return $oResponseWithError;
     }
     if ($this->_oPublisherServiceImp->modifyPublisher($sessionId, $oPublisherInfo)) {
         return XmlRpcUtils::booleanTypeResponse(true);
     } else {
         return XmlRpcUtils::generateError($this->_oPublisherServiceImp->getLastError());
     }
 }
 /**
  * The modifyBanner method changes the details for an existing banner
  * in the banner object or returns an error message.
  *
  * @access public
  *
  * @param  XML_RPC_Message &$oParams
  *
  * @return generated result (data or error)
  */
 function modifyBanner(&$oParams)
 {
     $sessionId = null;
     $oBannerInfo = new OA_Dll_BannerInfo();
     $oResponseWithError = null;
     if (!XmlRpcUtils::getRequiredScalarValue($sessionId, $oParams, 0, $oResponseWithError) || !XmlRpcUtils::getStructureScalarAndNotScalarFields($oBannerInfo, $oParams, 1, array('bannerId', 'campaignId', 'bannerName', 'storageType', 'fileName', 'imageURL', 'htmlTemplate', 'width', 'height', 'weight', 'target', 'url', 'bannerText', 'status', 'adserver', 'transparent', 'capping', 'sessionCapping', 'block', 'comments', 'alt', 'append', 'prepend'), array('aImage', 'aBackupImage'), $oResponseWithError)) {
         return $oResponseWithError;
     }
     if ($this->_oBannerServiceImp->modifyBanner($sessionId, $oBannerInfo)) {
         return XmlRpcUtils::booleanTypeResponse(true);
     } else {
         return XmlRpcUtils::generateError($this->_oBannerServiceImp->getLastError());
     }
 }
 /**
  * The modifyZone method changes the details for an existing zone
  * or returns an error message.
  *
  * @access public
  *
  * @param XML_RPC_Message &$oParams
  *
  * @return generated result (data or error)
  */
 function modifyZone(&$oParams)
 {
     $sessionId = null;
     $oZoneInfo = new OA_Dll_ZoneInfo();
     $oResponseWithError = null;
     if (!XmlRpcUtils::getRequiredScalarValue($sessionId, $oParams, 0, $oResponseWithError) || !XmlRpcUtils::getStructureScalarFields($oZoneInfo, $oParams, 1, array('zoneId', 'publisherId', 'zoneName', 'type', 'width', 'height', 'comments', 'capping', 'sessionCapping', 'block', 'append', 'prepend', 'chainedZoneId'), $oResponseWithError)) {
         return $oResponseWithError;
     }
     if ($this->_oZoneServiceImp->modifyZone($sessionId, $oZoneInfo)) {
         return XmlRpcUtils::booleanTypeResponse(true);
     } else {
         return XmlRpcUtils::generateError($this->_oZoneServiceImp->getLastError());
     }
 }
 /**
  * The modifyChannel method either changes the details for an existing channel
  * or returns an error message.
  *
  * @access public
  *
  * @param XML_RPC_Message &$oParams
  *
  * @return generated result (data or error)
  */
 public function modifyChannel(&$oParams)
 {
     $sessionId = null;
     $oChannelInfo = new OA_Dll_ChannelInfo();
     $oResponseWithError = null;
     if (!XmlRpcUtils::getRequiredScalarValue($sessionId, $oParams, 0, $oResponseWithError) || !XmlRpcUtils::getStructureScalarFields($oChannelInfo, $oParams, 1, array('channelId', 'channelName', 'description', 'comments'), $oResponseWithError)) {
         return $oResponseWithError;
     }
     if ($this->_oChannelServiceImp->modifyChannel($sessionId, $oChannelInfo)) {
         return XmlRpcUtils::booleanTypeResponse(true);
     } else {
         return XmlRpcUtils::generateError($this->_oChannelServiceImp->getLastError());
     }
 }
 /**
  * The modifyCampaign method changes the details for an existing campaign
  * or returns an error message.
  *
  * @access public
  *
  * @param XML_RPC_Message &$oParams
  *
  * @return generated result (data or error)
  */
 function modifyCampaign(&$oParams)
 {
     $sessionId = null;
     $oCampaignInfo = new OA_Dll_CampaignInfo();
     $oResponseWithError = null;
     if (!XmlRpcUtils::getRequiredScalarValue($sessionId, $oParams, 0, $oResponseWithError) || !XmlRpcUtils::getStructureScalarFields($oCampaignInfo, $oParams, 1, array('advertiserId', 'campaignId', 'campaignName', 'startDate', 'endDate', 'impressions', 'clicks', 'priority', 'weight', 'targetImpressions', 'targetClicks', 'targetConversions', 'revenue', 'revenueType', 'capping', 'sessionCapping', 'block', 'comments', 'viewWindow', 'clickWindow'), $oResponseWithError)) {
         return $oResponseWithError;
     }
     if ($this->_oCampaignServiceImp->modifyCampaign($sessionId, $oCampaignInfo)) {
         return XmlRpcUtils::booleanTypeResponse(true);
     } else {
         return XmlRpcUtils::generateError($this->_oCampaignServiceImp->getLastError());
     }
 }
 /**
  * Changes the details for an existing tracker.
  *
  * @param XML_RPC_Message &$oParams
  *
  * @return generated result (data or error)
  */
 public function modifyTracker(&$oParams)
 {
     $sessionId = null;
     $oTrackerInfo = new OA_Dll_TrackerInfo();
     $oResponseWithError = null;
     if (!XmlRpcUtils::getRequiredScalarValue($sessionId, $oParams, 0, $oResponseWithError) || !XmlRpcUtils::getStructureScalarFields($oTrackerInfo, $oParams, 1, array('trackerId', 'trackerName', 'description', 'status', 'type', 'linkCampaigns', 'variableMethod'), $oResponseWithError)) {
         return $oResponseWithError;
     }
     if ($this->oTrackerServiceImpl->modifyTracker($sessionId, $oTrackerInfo)) {
         return XmlRpcUtils::booleanTypeResponse(true);
     } else {
         return XmlRpcUtils::generateError($this->oTrackerServiceImpl->getLastError());
     }
 }
 /**
  * Changes the details for an existing variable.
  *
  * @param XML_RPC_Message &$oParams
  *
  * @return generated result (data or error)
  */
 public function modifyVariable(&$oParams)
 {
     $sessionId = null;
     $oVariableInfo = new OA_Dll_VariableInfo();
     $oResponseWithError = null;
     if (!XmlRpcUtils::getRequiredScalarValue($sessionId, $oParams, 0, $oResponseWithError) || !XmlRpcUtils::getStructureScalarAndNotScalarFields($oVariableInfo, $oParams, 1, array('variableId', 'trackerId', 'variableName', 'description', 'dataType', 'purpose', 'rejectIfEmpty', 'isUnique', 'uniqueWindow', 'variableCode', 'hidden'), array('hiddenWebsites'), $oResponseWithError)) {
         return $oResponseWithError;
     }
     if ($this->oVariableServiceImpl->modifyVariable($sessionId, $oVariableInfo)) {
         return XmlRpcUtils::booleanTypeResponse(true);
     } else {
         return XmlRpcUtils::generateError($this->oVariableServiceImpl->getLastError());
     }
 }
Exemplo n.º 9
0
 /**
  * Get scalar values from parameters
  *
  * @access public
  *
  * @param array $aReferencesOnVariables array of references to variables
  * @param array $aRequired array of boolean values to indicate which field is required
  * @param XML_RPC_Message  $oParams
  * @param XML_RPC_Response &$oResponseWithError
  * @param integer $idxStart Index of parameter from which values start
  *
  * @return boolean  shows true if method was executed successfully
  */
 function getScalarValues($aReferencesOnVariables, $aRequired, &$oParams, &$oResponseWithError, $idxStart = 0)
 {
     if (count($aReferencesOnVariables) != count($aRequired)) {
         Max::raiseError('$aReferencesOnVariables & $aRequired arrays should have the same length');
         exit;
     }
     $cVariables = count($aReferencesOnVariables);
     for ($i = 0; $i < $cVariables; $i++) {
         if ($aRequired[$i]) {
             if (!XmlRpcUtils::getRequiredScalarValue($aReferencesOnVariables[$i], $oParams, $i + $idxStart, $oResponseWithError)) {
                 return false;
             }
         } else {
             if (!XmlRpcUtils::_getNotRequiredScalarValue($aReferencesOnVariables[$i], $oParams, $i + $idxStart, $oResponseWithError)) {
                 return false;
             }
         }
     }
     return true;
 }