create_user($name, $pwd)) { log_error("successfully created user"); exit(json_encode(strtolower($name))); } else { log_error("create user failed"); report_problem(WEAVE_ERROR_NO_OVERWRITE, 503); } } catch(Exception $e) { log_error("db exception create user"); header("X-Weave-Backoff: 1800"); report_problem($e->getMessage(), $e->getCode()); } } else { log_error("register not enabled"); report_problem(WEAVE_ERROR_FUNCTION_NOT_SUPPORTED,400); } } // ende put else if($_SERVER['REQUEST_METHOD'] == 'POST') { if($username == '') { log_error("user.php : Post no username"); report_problem(WEAVE_ERROR_INVALID_USERNAME, 400); } $db = new WeaveStorage($username); log_error("user.php: POST"); if($function == "password") { #Auth the user verify_user($username, $db); $new_pwd = get_phpinput(); log_error("user.php: POST password "); //to do // change pw in db if($db->change_password($username, $new_pwd)) exit("success"); else report_problem(WEAVE_ERROR_INVALID_PROTOCOL, 503); //server db messed up somehow // return success // report_problem(7, 400); } else if($function == "email") { //change email adr } else { report_problem(WEAVE_ERROR_INVALID_PROTOCOL, 400); } // exit('success'); } } catch(Exception $e) { report_problem($e->getMessage(), $e->getCode()); } #The datasets we might be dealing with here are too large for sticking it all into an array, so #we need to define a direct-output method for the storage class to use. If we start producing multiples #(unlikely), we can put them in their own class. #include_once "WBOJsonOutput.php"; ?>