-
Notifications
You must be signed in to change notification settings - Fork 0
/
forget_user.php
52 lines (47 loc) · 1.46 KB
/
forget_user.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
<?php
require_once ('libs/common/global_inc.php');
if (is_loged_in ()) {
header ( 'Location: ' . WEB_BASE_COMMON . 'index.php' );
die ();
}
$db_connection = new pg_database_class ();
if (false === $db_connection->open_connection ( FUNCTION_LIBRARY_POSTGRES_DB_NAME, FUNCTION_LIBRARY_POSTGRES_USER, FUNCTION_LIBRARY_POSTGRESS_PASSWORD )) {
trigger_error ( 'Database DEAD...' . $db_connection->get_last_error_message () );
exit ();
}
if ($_REQUEST && isset ( $_REQUEST ['email'] )) {
$sql = "Select user_id from wl_users where email_address ='{$_REQUEST ['email']}'";
$rs = $db_connection->db_query ( $sql );
if (pg_num_rows ( $rs ) == 0) {
echo json_encode ( array (
"status" => "FAIL",
"message" => "No User Found"
) );
} else {
$row = pg_fetch_assoc ( $rs );
$uid = $row ['user_id'];
echo json_encode ( array (
"status" => 'SUCCESS',
"uid" => $uid
) );
}
die ();
}
display_html_start();
echo
</head><body>',
get_header_html(),
<h3>Create user</h3>
</div>
<div class="row" id="message"></div>
<div class="row">
<form class="form-vertical" role="form">
<div class="form-group">
<label class="sr-only" for="email">Email Address:</label>
<input type="email" class="form-control" id="email" name="email" placeholder="E-Mail" required>
</div>
<button type="submit" class="btn btn-primary">Get User Name</button>
</form>
';
display_footer(array('forgot_user'));
?>