sanitize all input against xss and fixed bug with time encoding when adding result
This commit is contained in:
@@ -6,14 +6,14 @@
|
||||
$error = null;
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
$user_name = $_POST['user_name'];
|
||||
$password = $_POST['password'];
|
||||
$user_group = $_POST['user_group'];
|
||||
$bind_station = $_POST['bind_station'];
|
||||
$user_name = sanitize_input($_POST['user_name']);
|
||||
$password = sanitize_input($_POST['password']);
|
||||
$user_group = sanitize_input($_POST['user_group']);
|
||||
$bind_station = sanitize_input($_POST['bind_station']);
|
||||
if(!empty($user_name) && !empty($password)) {
|
||||
$salt = generate_salt();
|
||||
$user_id = generate_user_id($_POST['user_name'], $salt);
|
||||
$phash = generate_password_hash($_POST['password'], $salt);
|
||||
$user_id = generate_user_id($user_name, $salt);
|
||||
$phash = generate_password_hash($password, $salt);
|
||||
if($user_group == "station") {
|
||||
write_user($con, $user_name, $user_id, $phash, $salt, $user_group, $bind_station);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user