| Name | Size | Mode | Actions |
|---|---|---|---|
| db_connect.php | 7824 | 0666 | editdlrm |
| db_connects.php | 292 | 0666 | editdlrm |
| forgetpassword.php | 4105 | 0666 | editdlrm |
| functions.php | 17179 | 0666 | editdlrm |
| functions1.php | 12247 | 0666 | editdlrm |
| logout.php | 722 | 0666 | editdlrm |
| process_login.php | 2203 | 0666 | editdlrm |
| psl-config.php | 2196 | 0666 | editdlrm |
| psl-config 1.php | 2107 | 0666 | editdlrm |
| psl-config3.php | 2107 | 0666 | editdlrm |
| psl-configs.php | 1674 | 0666 | editdlrm |
| register-client.php | 7543 | 0666 | editdlrm |
| register.inc.php | 3390 | 0666 | editdlrm |
| register.php | 27274 | 0666 | editdlrm |
| registerclient.php | 8859 | 0666 | editdlrm |
| requestsubmission.php | 23523 | 0666 | editdlrm |
| reset.php | 3984 | 0666 | editdlrm |
/home/techb158/immovalet.ca/report/includes/register.inc.php (3390B)
The email address you entered is not valid
'; } $password = filter_input(INPUT_POST, 'p', FILTER_SANITIZE_STRING); if (strlen($password) != 128) { // The hashed pwd should be 128 characters long. // If it's not, something really odd has happened $error_msg .= 'Invalid password configuration.
'; } // Username validity and password validity have been checked client side. // This should should be adequate as nobody gains any advantage from // breaking these rules. // $prep_stmt = "SELECT ID FROM Admin WHERE Email = ? LIMIT 1"; $stmt = $mysqli->prepare($prep_stmt); if ($stmt) { $stmt->bind_param('s', $email); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows == 1) { // A user with this email address already exists $error_msg .= 'A user with this email address already exists.
'; } } else { $error_msg .= 'Database error
'; } // TODO: // We'll also have to account for the situation where the user doesn't have // rights to do registration, by checking what type of user is attempting to // perform the operation. if (empty($error_msg)) { // Create a random salt $random_salt = hash('sha512', uniqid(openssl_random_pseudo_bytes(16), TRUE)); // Create salted password $password = hash('sha512', $password . $random_salt); // Insert the new user into the database if ($insert_stmt = $mysqli->prepare("INSERT INTO Admin (Username, Email, Password, salt) VALUES (?, ?, ?, ?)")) { $insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); // Execute the prepared query. if (! $insert_stmt->execute()) { header('Location: ../error.php?err=Registration failure: INSERT'); exit(); } } header('Location: ./register_success.php'); exit(); } }