Merge pull request #17187 from glu000/13.0-fix17186

FIX email is not case sensitive
This commit is contained in:
Laurent Destailleur 2021-04-09 12:36:49 +02:00 committed by GitHub
commit f7bab13c3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -51,7 +51,7 @@ $langs->loadLangs(array("companies", "other", "ticket"));
// Get parameters
$track_id = GETPOST('track_id', 'alpha');
$action = GETPOST('action', 'aZ09');
$email = GETPOST('email', 'alpha');
$email = strtolower(GETPOST('email', 'alpha'));
if (GETPOST('btn_view_ticket_list')) {
unset($_SESSION['track_id_customer']);
@ -61,7 +61,7 @@ if (isset($_SESSION['track_id_customer'])) {
$track_id = $_SESSION['track_id_customer'];
}
if (isset($_SESSION['email_customer'])) {
$email = $_SESSION['email_customer'];
$email = strtolower($_SESSION['email_customer']);
}
$object = new Ticket($db);
@ -101,7 +101,7 @@ if ($action == "view_ticketlist") {
// vérifie si l'adresse email est bien dans les contacts du ticket
$contacts = $object->liste_contact(-1, 'external');
foreach ($contacts as $contact) {
if ($contact['email'] == $email) {
if (strtolower($contact['email']) == $email) {
$display_ticket_list = true;
$_SESSION['email_customer'] = $email;
$_SESSION['track_id_customer'] = $track_id;
@ -112,7 +112,7 @@ if ($action == "view_ticketlist") {
}
if ($object->fk_soc > 0) {
$object->fetch_thirdparty();
if ($email == $object->thirdparty->email) {
if ($email == strtolower($object->thirdparty->email)) {
$display_ticket_list = true;
$_SESSION['email_customer'] = $email;
$_SESSION['track_id_customer'] = $track_id;
@ -121,14 +121,14 @@ if ($action == "view_ticketlist") {
if ($object->fk_user_create > 0) {
$tmpuser = new User($db);
$tmpuser->fetch($object->fk_user_create);
if ($email == $tmpuser->email) {
if ($email == strtolower($tmpuser->email)) {
$display_ticket_list = true;
$_SESSION['email_customer'] = $email;
$_SESSION['track_id_customer'] = $track_id;
}
}
$emailorigin = CMailFile::getValidAddress($object->origin_email, 2);
$emailorigin = strtolower(CMailFile::getValidAddress($object->origin_email, 2));
if ($email == $emailorigin) {
$display_ticket_list = true;
$_SESSION['email_customer'] = $email;

View File

@ -53,13 +53,13 @@ $langs->loadLangs(array("companies", "other", "ticket"));
$track_id = GETPOST('track_id', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$action = GETPOST('action', 'aZ09');
$email = GETPOST('email', 'alpha');
$email = strtolower(GETPOST('email', 'alpha'));
if (GETPOST('btn_view_ticket')) {
unset($_SESSION['email_customer']);
}
if (isset($_SESSION['email_customer'])) {
$email = $_SESSION['email_customer'];
$email = strtolower($_SESSION['email_customer']);
}
$object = new ActionsTicket($db);
@ -103,7 +103,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
$ret = $object->fetch('', '', $track_id);
if ($ret && $object->dao->id > 0) {
// Check if emails provided is the one of author
$emailofticket = CMailFile::getValidAddress($object->dao->origin_email, 2);
$emailofticket = strtolower(CMailFile::getValidAddress($object->dao->origin_email, 2));
if ($emailofticket == $email)
{
$display_ticket = true;
@ -113,7 +113,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
else {
$contacts = $object->dao->liste_contact(-1, 'external');
foreach ($contacts as $contact) {
if ($contact['email'] == $email) {
if (strtolower($contact['email']) == $email) {
$display_ticket = true;
$_SESSION['email_customer'] = $email;
break;
@ -135,7 +135,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
{
$tmpuser = new User($db);
$tmpuser->fetch($object->dao->fk_user_create);
if ($email == $tmpuser->email) {
if ($email == strtolower($tmpuser->email)) {
$display_ticket = true;
$_SESSION['email_customer'] = $email;
}
@ -145,7 +145,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
{
$tmpuser = new User($db);
$tmpuser->fetch($object->dao->fk_user_assign);
if ($email == $tmpuser->email) {
if ($email == strtolower($tmpuser->email)) {
$display_ticket = true;
$_SESSION['email_customer'] = $email;
}