Fixed add user and edit as well as update user, which were not working. Added autocomplete=new-password to add/edit user and update password

This commit is contained in:
johnny@pittpc.com
2020-03-31 14:32:57 -04:00
parent 95b54d5bcf
commit 1b337fe72e
4 changed files with 9 additions and 5 deletions

View File

@@ -20,10 +20,14 @@ if(isset($_POST['add_user'])){
$password = md5($_POST['password']);
$client_id = intval($_POST['client']);
mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password', avatar = '$path', created_at = NOW(), client_id = $client_id");
mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password', created_at = NOW()");
$user_id = mysqli_insert_id($mysqli);
if(!file_exists("uploads/users/$user_id/")) {
mkdir("uploads/users/$user_id");
}
if($_FILES['file']['tmp_name']!='') {
$path = "uploads/users/$user_id/";
$path = $path . time() . basename( $_FILES['file']['name']);