if ($data = $userdata->getLostPasswordDataForSession($request['session'])) { header("HTTP/1.1 200 OK"); header("Content-Type: text/html"); echo json_encode($data); $ok = true; } else { header("HTTP/1.1 200 OK"); header("Content-Type: text/html"); $data = array('error' => 1); echo json_encode($data); $ok = true; } } else { if (strcmp($request['cmd'], 'changePassword') == 0) { if (strlen($request["id"]) && strlen($request["password"])) { if ($data = $userdata->changePassword($request['id'], $request['password'])) { header("HTTP/1.1 200 OK"); header("Content-Type: text/html"); $data = array('success' => 1); echo json_encode($data); $ok = true; } else { header("HTTP/1.1 200 OK"); header("Content-Type: text/html"); $data = array('error' => 2); echo json_encode($data); $ok = true; } } } }