Example #1
0
    $col = 'login';
    $value = $_REQUEST['v'];
    //Look likes if I send a JSON object it gets automatically converted in an array.
    if (!isset($value['f']) || !isset($value['l']) || !isset($value['v']) || !isset($value['u'])) {
        error('missing parameters');
    }
    $u = $value['u'];
} else {
    error('unrecognized command');
}
$timer->setMarker('setup');
//print "u: $u, ids_text: $ids_text<br>";
if ($col == 'login') {
    if ($realUser == $u) {
        //Do not overwrite name in mock mode!
        $good = User::SetDataFromFB($u, $value['f'], $value['l'], $value['v']);
    }
} else {
    if (!User::SetColumn($u, $col, $value)) {
        error('Problem on the server, this field cannot be updated. Please retry later.');
    }
}
$timer->setMarker('query');
InsertBenchmarkDB($timer);
//Save the data on DB
echo '{"result": "OK"}';
if (isset($XML_debug)) {
    $timer->display(true);
    // if you want to display immidiately and to output html formated
    //$profiling = $timer->getProfiling(); // get the profiler info as an associative array
    //echo "<br> This is the array: <br> <pre>";