diff --git a/portal/login_reset.php b/portal/login_reset.php
index d78cdec3..e9cf0888 100644
--- a/portal/login_reset.php
+++ b/portal/login_reset.php
@@ -51,7 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
$company = $row['company_id'];
if ($row['contact_email'] == $email) {
- $token = key32gen();
+ $token = bin2hex(random_bytes(78));
$url = "https://$config_base_url/portal/login_reset.php?email=$email&token=$token&client=$client";
mysqli_query($mysqli, "UPDATE contacts SET contact_password_reset_token = '$token' WHERE contact_id = $id LIMIT 1");
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Contact', log_action = 'Modify', log_description = 'Sent a portal password reset e-mail for $email.', log_ip = '$ip', log_user_agent = '$user_agent', log_created_at = NOW(), log_client_id = $client, company_id = $company");
@@ -59,7 +59,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
// Send reset email
$subject = "Password reset for $company_name ITFlow Portal";
- $body = "Hello, $name
Someone (probably you) has requested a new password for your account on $company_name's ITFlow Client Portal.
Please click here to reset your password. Alternatively, copy and paste this URL into your browser: $url
If you didn't request this change, you can safely ignore this email.~
$company_name
Support Department
$config_mail_from_email";
+ $body = "Hello, $name
Someone (probably you) has requested a new password for your account on $company_name's ITFlow Client Portal.
Please click here to reset your password. Alternatively, copy and paste this URL into your browser:
$url
If you didn't request this change, you can safely ignore this email.~
$company_name
Support Department
$config_mail_from_email";
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
$config_mail_from_email, $config_mail_from_name,
diff --git a/portal/ticket.php b/portal/ticket.php
index 1e50b74c..918d7cca 100644
--- a/portal/ticket.php
+++ b/portal/ticket.php
@@ -15,18 +15,28 @@ if (isset($_GET['id']) && intval($_GET['id'])) {
$ticket_sql = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_id = '$ticket_id' AND ticket_client_id = '$session_client_id' AND ticket_contact_id = '$session_contact_id'");
}
- $ticket = mysqli_fetch_array($ticket_sql);
+ $ticket_row = mysqli_fetch_array($ticket_sql);
+
+ if ($ticket_row) {
+
+ $ticket_prefix = htmlentities($ticket_row['ticket_prefix']);
+ $ticket_number = $ticket_row['ticket_number'];
+ $ticket_status = htmlentities($ticket_row['ticket_status']);
+ $ticket_priority = htmlentities($ticket_row['ticket_priority']);
+ $ticket_subject = htmlentities($ticket_row['ticket_subject']);
+ $ticket_details = $ticket_row['ticket_details'];
+ $ticket_feedback = htmlentities($ticket_row['ticket_feedback']);
+
- if ($ticket) {
?>