-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsignup.php
79 lines (77 loc) · 2.18 KB
/
signup.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE HTML>
<html>
<head>
<title>Alexa Adjust The Bed sign-up</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body id="body-color">
<?php
require_once "adjustTheBed-main.php";
if ( isset($_SERVER['QUERY_STRING'])) {
$passstring=$_SERVER['QUERY_STRING'];
parse_str($passstring,$output);
}
if (! isset($output['access']))
{
echo 'Please use the full url provided by the \'Adjust The Bed\' application';
} else {
$indb=accessdb("signup","get",$output['access']);
if (isset($indb)){
if (isset ($_POST['email']) && isset($_POST['pass']) && isset($_POST['cpass'])) {
if ($_POST['pass'] != $_POST['cpass']) {
print 'Passwords did not match. Please re-access the URL';
} else {
accessdb("signup","delete",$output['access']);
accessdb("signup","delete",$indb);
accessdb("password","delete",$indb);
accessdb("password","put",$indb,$_POST['email']."|".$_POST['pass']);
print "You've been added!";
}
} elseif (isset ($_POST['proxyurl'])) {
accessdb("signup","delete",$output['access']);
accessdb("signup","delete",$indb);
accessdb("password","put",$indb,$_POST['proxyurl']);
print "You've been added!";
} else {
echo '<div id="Sign-Up">
<fieldset style="width:30%"><legend>Registration Form</legend>
<table border="0">
<tr>
<form method="POST" action="signup.php?access=';
print $output['access'];
echo '">
<tr>
<td>Access code :</td><td>';
print $output['access'];
echo '</td>
</tr>
<tr>
<td>SLEEP NUMBER(r) Email</td><td> <input type="text" name="email"></td>
</tr>
<tr>
<td>SLEEP NUMBER(r) Password</td><td> <input type="password" name="pass"></td>
</tr>
<tr>
<td>Confirm Password </td><td><input type="password" name="cpass"></td>
</tr>
<tr>
<td>OR</td><td>OR</td>
</tr>
</tr>
<td>AdjustTheBedPassProxy URL</td><td><input type="text" name="proxyurl"></td>
<tr>
<td><input id="button" type="submit" name="submit" value="Sign-Up"></td>
</tr>
</form>
</table>
</fieldset>
</div>';
}
} else {
print $output['access'];
print ' is an invalid access code, please use the full url provided by the `Adjust The Bed` Alexa skill';
}
}
?>
</body>
</html>