-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemail.php
58 lines (49 loc) · 1.33 KB
/
email.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<html>
<head>
<title>Email</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Cutive">
</head>
<body>
<img src="logo.jpg">
<p>
<?php
include 'tokens.php';
$userName = $_POST["userName"];
$id = $_POST["id"];
$email = $_POST["email"];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://cloud-va.aerohive.com/xapi/v1/identity/credentials/deliver?ownerId=$ownerId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\r\n \"credentialId\": $id,\r\n \"deliverMethod\": \"EMAIL\",\r\n \"email\": \"$email\"\r\n}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer $accesstoken",
"cache-control: no-cache",
"content-type: application/json",
"x-ah-api-client-id: $clientid",
"x-ah-api-client-redirect-uri: $redirecturi",
"x-ah-api-client-secret: $clientsecret"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
}
?>
<p>
Your wifi credentials have been emailed to
<?php
echo $email;
?>
<p>
<a id="returnbutton" href="<?php echo $returnurl ?>">Return</a>
</body>
</html>