| Name | Size | Mode | Actions |
|---|---|---|---|
| db_connect.php | 7824 | 0666 | editdlrm |
| db_connects.php | 292 | 0666 | editdlrm |
| forgetpassword.php | 4105 | 0666 | editdlrm |
| functions.php | 16866 | 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/includes/register-client.php (7543B)
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(); } }