-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlistUser.php
More file actions
79 lines (66 loc) · 2.19 KB
/
Copy pathlistUser.php
File metadata and controls
79 lines (66 loc) · 2.19 KB
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
<?php
require_once('vendor/autoload.php');
use Aws\CognitoIdentityProvider\CognitoIdentityProviderClient;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>AWS COGNITO</title>
</head>
<body>
<?php include 'navbar.php'?>
<br>
<div class="container">
<h3>LISTADO DE LOS USUARIOS</h3>
<br>
<?php
include 'clienteCognito.php';
$result = $client->listUsers([
'AttributesToGet' => ['email','name','phone_number','address'],
'UserPoolId' => 'us-east-1_pHiEjcK1L', // REQUIRED
]);
//echo $result;
$array = $result['Users'];
$count = count($array);
//var_dump($array);
echo "<table class='table'>";
echo "<thead>";
echo "<th style='background: #e6faff'>NOMBRE</th>";
echo "<th style='background: #e6faff'>TELEFONO</th>";
echo "<th style='background: #e6faff'>CORREO</th>";
echo "<th style='background: #e6faff'>ADDRESS</th>";
echo "</thead>";
for ($i=0; $i < $count; $i++) {
echo "<tr>";
$address ="";
$name="";
$correo="";
$telefono="";
if (($array[$i] ['Attributes'] [0] ['Name']) == 'address') {
$address = $array[$i] ['Attributes'] [0] ['Value'];
}
if(($array[$i] ['Attributes'] [1] ['Name']) == 'name'){
$name = $array[$i] ['Attributes'] [1] ['Value'];
}
if (($array[$i] ['Attributes'] [2] ['Name']) == 'phone_number') {
$telefono = $array[$i] ['Attributes'] [2] ['Value'];
}
if (($array[$i] ['Attributes'] [3] ['Name']) == 'email') {
$correo = $array[$i] ['Attributes'] [3] ['Value'];
}
echo "<td>".$name."</td>";
echo "<td>".$telefono."</td>";
echo "<td>".$correo."</td>";
echo "<td>".$address."</td>";
echo "</tr>";
}
echo "</table>";
?>
</div>
<?php include 'footer.php'?>
</body>
</html>