Tidy remaining files to randomString()
This commit is contained in:
@@ -157,7 +157,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
}
|
}
|
||||||
|
|
||||||
function generatePassword() {
|
function generatePassword() {
|
||||||
document.getElementById("password").value = "<?php echo bin2hex(random_bytes(8)); ?>"
|
document.getElementById("password").value = "<?php echo randomString(); ?>"
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -75,14 +75,10 @@ function get_ip() {
|
|||||||
if (defined("CONST_GET_IP_METHOD")) {
|
if (defined("CONST_GET_IP_METHOD")) {
|
||||||
if (CONST_GET_IP_METHOD == "HTTP_X_FORWARDED_FOR") {
|
if (CONST_GET_IP_METHOD == "HTTP_X_FORWARDED_FOR") {
|
||||||
$ip = getenv('HTTP_X_FORWARDED_FOR');
|
$ip = getenv('HTTP_X_FORWARDED_FOR');
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else{
|
|
||||||
|
|
||||||
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR'];
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
post.php
4
post.php
@@ -437,7 +437,7 @@ if(isset($_GET['archive_user'])){
|
|||||||
|
|
||||||
// Variables from GET
|
// Variables from GET
|
||||||
$user_id = intval($_GET['archive_user']);
|
$user_id = intval($_GET['archive_user']);
|
||||||
$password = password_hash(bin2hex(random_bytes(16)), PASSWORD_DEFAULT);
|
$password = password_hash(randomString(), PASSWORD_DEFAULT);
|
||||||
|
|
||||||
// Get user details
|
// Get user details
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM users WHERE user_id = $user_id");
|
$sql = mysqli_query($mysqli,"SELECT * FROM users WHERE user_id = $user_id");
|
||||||
@@ -4126,7 +4126,7 @@ if(isset($_POST['add_contact'])){
|
|||||||
$contact_technical = intval($_POST['contact_technical']);
|
$contact_technical = intval($_POST['contact_technical']);
|
||||||
$location_id = intval($_POST['location']);
|
$location_id = intval($_POST['location']);
|
||||||
$auth_method = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['auth_method'])));
|
$auth_method = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['auth_method'])));
|
||||||
$password = password_hash(bin2hex(random_bytes(16)), PASSWORD_DEFAULT);
|
$password = password_hash(randomString(), PASSWORD_DEFAULT);
|
||||||
|
|
||||||
|
|
||||||
if(!file_exists("uploads/clients/$session_company_id/$client_id")) {
|
if(!file_exists("uploads/clients/$session_company_id/$client_id")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user