/home/techb158/immovalet.ca/includes
NameSizeModeActions
db_connect.php78240666editdlrm
db_connects.php2920666editdlrm
forgetpassword.php41050666editdlrm
functions.php168660666editdlrm
functions1.php122470666editdlrm
logout.php7220666editdlrm
process_login.php22030666editdlrm
psl-config.php21960666editdlrm
psl-config 1.php21070666editdlrm
psl-config3.php21070666editdlrm
psl-configs.php16740666editdlrm
register-client.php75430666editdlrm
register.inc.php33900666editdlrm
register.php272740666editdlrm
registerclient.php88590666editdlrm
requestsubmission.php235230666editdlrm
reset.php39840666editdlrm
Edit: /home/techb158/immovalet.ca/includes/register-client.php (7543B)
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 Username = ? LIMIT 1"; $stmt = $mysqli->prepare($prep_stmt); if ($stmt){ $stmt->bind_param('s', $Username); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows == 1) { // A user with this email address already exists $error_msg .= '

A user with this user name already exists.

'; } }else{ $error_msg .= '

Database error

'; } $prep_stmt = "SELECT ID FROM Master WHERE Username = ? LIMIT 1"; $stmt = $mysqli->prepare($prep_stmt); if ($stmt) { $stmt->bind_param('s', $Username); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows == 1) { // A user with this email address already exists $error_msg .= '

A user with this user name already exists.

'; } } else { $error_msg .= '

Database error

'; } $prep_stmt = "SELECT ID FROM Agent WHERE Username = ? LIMIT 1"; $stmt = $mysqli->prepare($prep_stmt); if ($stmt) { $stmt->bind_param('s', $Username); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows == 1) { // A user with this email address already exists $error_msg .= '

A user with this user name already exists.

'; } } else { $error_msg .= '

Database error

'; } $prep_stmt = "SELECT ID FROM Clients WHERE Username = ? LIMIT 1"; $stmt = $mysqli->prepare($prep_stmt); if ($stmt) { $stmt->bind_param('s', $Username); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows == 1) { // A user with this email address already exists $error_msg .= '

A user with this user name already exists.

'; } } else { $error_msg .= '

Database error

'; } $prep_stmt = "SELECT ID FROM Users WHERE Username = ? LIMIT 1"; $stmt = $mysqli->prepare($prep_stmt); if ($stmt) { $stmt->bind_param('s', $Username); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows == 1) { // A user with this email address already exists $error_msg .= '

A user with this user name 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. //$error_msg .= $username .' '. $FName .' '. $LName .' '. $email .' '. $Phone .' '. $Address .' '. $random_salt .' '. $datetime .' '. $Managers_ID; 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); $Register_Time =date("Y/m/d") . ' ' . date('H:i:s') ; //$Managers_ID= $_SESSION['username']; //$query = "SELECT * FROM Master Where Username ='".$Managers_ID."'"; //$result = $mysqli->query($query); //$Admin = $result->fetch_assoc(); //$ManagerID = $Admin['ID']; //$Company_names = $Admin['Company_Name']; //if(($Company_names == $Companynames) && ($Companynames == "")) //{ //$CompanynamesID = $Company_names; //}else{ //$CompanynamesID = $_POST['Companyname']; //} // Insert the new user into the database //if ($insert_stmt = $mysqli->prepare("INSERT INTO $User_Type (Username, Email, Password, salt) VALUES (?, ?, ?, ?)")) { //$insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); $result = pg_exec("SELECT MAX(cli_id) as cli_id FROM client"); $row = pg_fetch_array($result); $Cli_ID = $row["cli_id"]; $Cli_ID++; $Ag_ID = 1; if ($insert_stmt = $mysqli->prepare("INSERT INTO Clients (Cli_ID, Ag_ID, Username, Title, First_Name, Last_name, Company_Name, Emerging_Contact_Primary, Emerging_Contact_Secondary, Type_Contact_Primary, Type_Contact_Secondary, Email, Cell_Phone, Office_Phone, Extension_Phone, Address, City, Post_Code, Password, salt, Register_Time, User_Access) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { $insert_stmt->bind_param('ssssssssssssssssssssss',$Cli_ID, $Ag_ID, $Username, $Title, $First_Name, $Last_name, $Company_Name, $Emerging_Contact_Primary, $Emerging_Contact_Secondary, $Type_Contact_Primary, $Type_Contact_Secondary, $Email, $Cell_Phone, $Office_Phone, $Extension_Phone, $Address, $City, $Post_Code, $Password, $random_salt, $Register_Time, $User_Access); // Execute the prepared query. if (! $insert_stmt->execute()) { header('Location: register.php?error=registration failure!'); //header('Location: addassist.php?error='.$Managers_ID.''); exit(); }else{ header('Location: register.php?error=register success!'); exit(); } } } }else { header('Location: register.php?error=all information are required!'); exit(); } }