blob: b75a3ffbb2f2704f6d193a96ff616371a6432658 [file] [log] [blame]
Andreuabbcb7e2019-09-21 18:22:14 +02001<?php
Andreu2457e402019-09-22 00:52:41 +02002 require '../credentials.php';
Andreuabbcb7e2019-09-21 18:22:14 +02003 require '../php/utils.php';
Andreu09b8b052019-09-21 21:47:20 +02004 $user = get_users($_POST['id']);
Andreuabbcb7e2019-09-21 18:22:14 +02005
Andreu20cbd1d2019-09-22 00:00:57 +02006 $text_columns = ["nomcomplet", "md5password"];
7
Andreuabbcb7e2019-09-21 18:22:14 +02008 echo '{ ';
9 $first = true;
10 foreach ($user as $prop => $value) {
11 if (!$first) echo ', ';
12 else $first = false;
Andreu20cbd1d2019-09-22 00:00:57 +020013 if (in_array($prop, $text_columns)) echo '"'.$prop.'": "'.$value.'"';
Andreuabbcb7e2019-09-21 18:22:14 +020014 else echo '"'.$prop.'": '.$value;
15 }
16 echo ' }';
17?>