/** * * Insert/Update an AuthIdsType on the database * @param AuthIdsType $bucket * @throws Exception */ public function setAuthIdsType($policyId, AuthIdsType &$bucket, $insertMode = FALSE) { $method = "PUT"; $url = E3_PROV_URL_POLICY . "/" . rawurlencode($policyId) . "/quotaRLBuckets/" . rawurlencode($bucket->getId()); if ($insertMode) { $method = "POST"; $url = E3_PROV_URL_POLICY . "/" . rawurlencode($policyId) . "/quotaRLBuckets/"; } /** * Send the XML payload the the Provisioning Backend */ $restClient = new RestClient(); $reply = $restClient->makeCall($url, $method, $bucket->toXML()); if ($insertMode) { $bucket = new AuthIdsType(); if ($bucket->getId() == NULL) { $xml = simplexml_load_string($reply->getPayload()); $bucket->setId((string) $xml->id); } } }
$validationErrors[$quotaName] = PolicyController::displayNameForField($quotaName) . $translator->translate(" Threshold must be a positive integer if you want to include this Quota. "); $success = false; } elseif (!$validate_int->isValid($warning) || !$validate_gte_0->isValid($warning)) { $validationErrors[$quotaName] = PolicyController::displayNameForField($quotaName) . $translator->translate(" Warning must be a non-negative integer. "); $success = false; } elseif (Zend_Validate::is($warning, 'GreaterThan', array('min' => $threshold))) { $validationErrors[$quotaName] = PolicyController::displayNameForField($quotaName) . $translator->translate(" Warning may not be greater than the Threshold. "); $success = false; } } return $success; } /** * Creates and returns a new Context value for use with a Policy. Assigns default * values to the Id and Status fields. * * @return Context A new Context object with default values */