Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 1 | <?php |
Andreu | 2457e40 | 2019-09-22 00:52:41 +0200 | [diff] [blame^] | 2 | require '../credentials.php'; |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 3 | require '../php/utils.php'; |
Andreu | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame] | 4 | $user = get_users($_POST['id']); |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 5 | |
Andreu | 20cbd1d | 2019-09-22 00:00:57 +0200 | [diff] [blame] | 6 | $text_columns = ["nomcomplet", "md5password"]; |
| 7 | |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 8 | echo '{ '; |
| 9 | $first = true; |
| 10 | foreach ($user as $prop => $value) { |
| 11 | if (!$first) echo ', '; |
| 12 | else $first = false; |
Andreu | 20cbd1d | 2019-09-22 00:00:57 +0200 | [diff] [blame] | 13 | if (in_array($prop, $text_columns)) echo '"'.$prop.'": "'.$value.'"'; |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 14 | else echo '"'.$prop.'": '.$value; |
| 15 | } |
| 16 | echo ' }'; |
| 17 | ?> |