fixed typo and added close button to edit pages

This commit is contained in:
Grisu
2022-09-16 09:49:36 +02:00
parent 506982f1b1
commit 0a3beeeaec
7 changed files with 103 additions and 92 deletions

View File

@@ -11,36 +11,37 @@
}
if($_SERVER['REQUEST_METHOD'] == "POST") {
$id = sanitize_input($_POST['id']);
$user = get_user($con, $id)->fetch();
$user_group = sanitize_input($_POST['user_group']);
$user_name = sanitize_input($_POST['user_name']);
$bind_station = sanitize_input($_POST['bind_station']);
$password = sanitize_input($_POST['password']);
if($user['user_name'] != $user_name) {
change_user_name($con, $id, $user_name);
}
if($user['user_group'] != $user_group) {
if($user_group == "station") {
change_user_group($con, $id, $user_group, $bind_station);
} else {
change_user_group($con, $id, $user_group, NULL);
if(isset($_POST['save'])){
$id = sanitize_input($_POST['id']);
$user = get_user($con, $id)->fetch();
$user_group = sanitize_input($_POST['user_group']);
$user_name = sanitize_input($_POST['user_name']);
$bind_station = sanitize_input($_POST['bind_station']);
$password = sanitize_input($_POST['password']);
if($user['user_name'] != $user_name) {
change_user_name($con, $id, $user_name);
}
if($user['user_group'] != $user_group) {
if($user_group == "station") {
change_user_group($con, $id, $user_group, $bind_station);
} else {
change_user_group($con, $id, $user_group, NULL);
}
}
if($user['s_id'] != $bind_station) {
if ($user_group == "station") {
change_s_id($con, $id, $bind_station);
}
}
if(!empty($password)) {
$phash = generate_password_hash($password, $user['salt']);
change_password($con, $id, $phash);
}
}
if($user['s_id'] != $bind_station) {
if ($user_group == "station") {
change_s_id($con, $id, $bind_station);
}
}
if(!empty($password)) {
$phash = generate_password_hash($password, $user['salt']);
change_password($con, $id, $phash);
}
header("Location: manage_user.php");
die;
}
@@ -84,7 +85,8 @@
</select>
</div>
<input type="hidden" value=<?php echo "\"" . $row['id'] . "\""?> name="id"/>
<input type="submit" value="ändern" class="btn-confirm"/>
<input type="submit" value="Speichern" class="btn-confirm" name="save"/>
<input type="submit" value="Schließen" class="btn-confirm" name="close"/>
</form>
</div>
</div>