-rw-r--r-- | backend/php/src/index.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/backend/php/src/index.php b/backend/php/src/index.php index 3d23e7a..214ac01 100644 --- a/backend/php/src/index.php +++ b/backend/php/src/index.php | |||
@@ -354,55 +354,56 @@ error_log("oneTimePassword"); | |||
354 | } else { | 354 | } else { |
355 | throw new Exception("The requested One Time Password was not active"); | 355 | throw new Exception("The requested One Time Password was not active"); |
356 | } | 356 | } |
357 | } else { | 357 | } else { |
358 | throw new Exception("The requested One Time Password has not been found"); | 358 | throw new Exception("The requested One Time Password has not been found"); |
359 | } | 359 | } |
360 | 360 | ||
361 | //============================================================= | 361 | //============================================================= |
362 | } | 362 | } |
363 | 363 | ||
364 | break; | 364 | break; |
365 | 365 | ||
366 | case "message": | 366 | case "message": |
367 | error_log("message"); | 367 | error_log("message"); |
368 | if ($parameters["srpSharedSecret"] == $_SESSION["K"]) { | 368 | if ($parameters["srpSharedSecret"] == $_SESSION["K"]) { |
369 | $message = $parameters["message"]; | 369 | $message = $parameters["message"]; |
370 | 370 | ||
371 | //============================================================= | 371 | //============================================================= |
372 | if ($message == "getUserDetails") { | 372 | if ($message == "getUserDetails") { |
373 | //{"message":"getUserDetails", "srpSharedSecret":"f18e5cf7c3a83b67d4db9444af813ee48c13daf4f8f6635397d593e52ba89a08", "parameters":{}} | 373 | //{"message":"getUserDetails", "srpSharedSecret":"f18e5cf7c3a83b67d4db9444af813ee48c13daf4f8f6635397d593e52ba89a08", "parameters":{}} |
374 | $user = new user(); | 374 | $user = new user(); |
375 | $user = $user->Get($_SESSION["userId"]); | 375 | $user = $user->Get($_SESSION["userId"]); |
376 | 376 | ||
377 | $result["header"] = $user->header; | 377 | $result["header"] = $user->header; |
378 | |||
378 | $records = $user->GetRecordList(); | 379 | $records = $user->GetRecordList(); |
379 | foreach ($records as $record) | 380 | foreach ($records as $record) { |
380 | { | ||
381 | $recordStats["updateDate"] = $record->update_date; | 381 | $recordStats["updateDate"] = $record->update_date; |
382 | $recordsStats[$record->reference] = $recordStats; | 382 | $recordsStats[$record->reference] = $recordStats; |
383 | } | 383 | } |
384 | $result["recordsStats"] = $recordsStats; | 384 | $result["recordsStats"] = $recordsStats; |
385 | |||
385 | $result["statistics"] =$user->statistics; | 386 | $result["statistics"] =$user->statistics; |
386 | $result["version"] =$user->version; | 387 | $result["version"] =$user->version; |
387 | 388 | ||
388 | //============================================================= | 389 | //============================================================= |
389 | } else if ($message == "addNewRecords") { | 390 | } else if ($message == "addNewRecords") { |
390 | /* | 391 | /* |
391 | //{ | 392 | //{ |
392 | //"message":"addNewRecords", | 393 | //"message":"addNewRecords", |
393 | //"srpSharedSecret":"b58fdf62acebbcb67f63d28c0437f166069f45690c648cd4376a792ae7a325f7", | 394 | //"srpSharedSecret":"b58fdf62acebbcb67f63d28c0437f166069f45690c648cd4376a792ae7a325f7", |
394 | //"parameters":{ | 395 | //"parameters":{ |
395 | // "records":[ | 396 | // "records":[ |
396 | // { | 397 | // { |
397 | // "record":{ | 398 | // "record":{ |
398 | // "reference":"fda703707fee1fff42443124cd0e705f5bea0ac601758d81b2e832705339a610", | 399 | // "reference":"fda703707fee1fff42443124cd0e705f5bea0ac601758d81b2e832705339a610", |
399 | // "data":"OBSGtcb6blXq/xaYG.....4EqlQqgAvITN", | 400 | // "data":"OBSGtcb6blXq/xaYG.....4EqlQqgAvITN", |
400 | // "version":"0.3" | 401 | // "version":"0.3" |
401 | // }, | 402 | // }, |
402 | // "currentRecordVersion":{ | 403 | // "currentRecordVersion":{ |
403 | // "reference":"83ad301525c18f2afd72b6ac82c0a713382e1ef70ac69935ca7e2869dd4ff980", | 404 | // "reference":"83ad301525c18f2afd72b6ac82c0a713382e1ef70ac69935ca7e2869dd4ff980", |
404 | // "recordReference":"fda703707fee1fff42443124cd0e705f5bea0ac601758d81b2e832705339a610", | 405 | // "recordReference":"fda703707fee1fff42443124cd0e705f5bea0ac601758d81b2e832705339a610", |
405 | // "data":"NXJ5jiZhkd0CMiwwntAq....1TjjF+SGfE=", | 406 | // "data":"NXJ5jiZhkd0CMiwwntAq....1TjjF+SGfE=", |
406 | // "version":"0.3", | 407 | // "version":"0.3", |
407 | // "previousVersion":"3e174a86afc322271d8af28bc062b0f1bfd7344fad01212cd08b2757c4b199c4", | 408 | // "previousVersion":"3e174a86afc322271d8af28bc062b0f1bfd7344fad01212cd08b2757c4b199c4", |
408 | // "previousVersionKey":"kozaaGCzXWr71LbOKu6Z3nz520V..5U85tSBvb+u44twttv54Kw==" | 409 | // "previousVersionKey":"kozaaGCzXWr71LbOKu6Z3nz520V..5U85tSBvb+u44twttv54Kw==" |