-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetClientPass.php
More file actions
30 lines (25 loc) · 784 Bytes
/
setClientPass.php
File metadata and controls
30 lines (25 loc) · 784 Bytes
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
<?php
include_once 'controllers/functions.php';
include_once 'controllers/session_control.php';
include_once 'controllers/model.php';
include_once 'config/app.php';
$model = new model();
$session = new session_control();
$functions = new functions();
$token = $_POST["token"];
$email = $_POST["email"];
$password = $_POST["senha"];
$newPassword = $password;
$rsToken = $functions->checkClientToken($token, $email);
//echo $rsToken;
if($rsToken){
$qryUpdate = "UPDATE clients SET password = '".$newPassword."' WHERE id = ".$rsToken;
$rsExec = $model->model_exec($qryUpdate);
if ($rsExec){
echo 1;
}else{
echo "Impossível criar uma nova senha. Contate o Administrador.";
}
}else{
echo "Não foi possível reconhecer os dados informados.";
}