Advertisement
aivanov100

Tryin' to curl

Jun 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. /**
  2.  * Custom submit handler for shib_auth Advanced Settings form
  3.  */
  4. function qdr_sso_shib_auth_admin_advanced_form_submit($form, &$form_state) {
  5.   // Set ShibAuthTermsVer in Dataverse db to update the value of the latest T&C version
  6.   $terms_ver = $form_state[values]['shib_auth_terms_ver'];
  7.   $data = http_build_query(array('ShibAuthTermsVer' => $terms_ver);
  8.   $ch = curl_init();
  9.   curl_setopt($ch, CURLOPT_URL, "http://localhost:8080/api/v1/admin/settings");
  10.   curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-HTTP-Method-Override: PUT'));
  11.   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12.   curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  13.   $response = curl_exec($ch);
  14.   curl_close($ch);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement