Skip to content

Commit 3866cb5

Browse files
committed
some minor changes
1 parent 1c8ee67 commit 3866cb5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

index.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
$method = $_SERVER['REQUEST_METHOD'];
2121

2222
$input = file_get_contents("php://input");
23+
// file_put_contents('inputDump.txt', $input, FILE_APPEND); // uncomment for debugging
2324
$input = json_decode($input);
24-
//file_put_contents('inputDump.txt', $input->phpFunction, FILE_APPEND); // uncomment for debugging
2525

26-
// $tokenData = require_once('tokening.php'); // for user validation uncomment
26+
$tokenData = require_once('tokening.php'); // for user validation uncomment
2727

2828
switch ($method) {
2929
case 'POST': // update, insert, delete and select
3030

3131
//file_put_contents('inputDump.txt', 'In post method'.$input->phpFunction, FILE_APPEND);
32-
// sleep(5); // time delay for debuging in the clients, blur testing in reactjs :)
32+
// sleep(2); // time delay for debuging in the clients, blur testing in reactjs :)
3333

3434
if(isset($input->phpFunction)){ // RPC funcion call
3535
require_once "phpFunctions.php";

phpFunctions.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function changePassword($inp, $conn, $tokenData){
9494
'OK' => false,
9595
'errorType' => 'fakeRquest',
9696
'code' => 477,
97-
'message' => "Fake request Error!"
97+
'message' => "Fake request Error! $tokenData->name != $inp->userName || $tokenData->id != $inp->userId"
9898
];
9999
};
100100
};
@@ -105,8 +105,8 @@ function changePassword($inp, $conn, $tokenData){
105105
$result = $sth->fetch(PDO::FETCH_OBJ);
106106
if( $inp->oldPassword != $result->password ){
107107
return [
108-
// 'oldp' => $inp->oldPassword,
109-
// 'dnOld' => $result->password,
108+
'oldp' => $inp->oldPassword,
109+
'dnOld' => $result->password,
110110
'OK' => false,
111111
'errorType' => 'oldPasswordErr',
112112
'code' => 401,

0 commit comments

Comments
 (0)