04-15-2022, 08:17 PM
Client.php
Around line 120
Original code
Changed it to
Anyone see anything wrong with this? It seems to do exactly what I want it to.
If I email my Helpdeskz from a known account, it creates the ticket. If I email it from an unknown account, NOTHING happens. No return on the email, no user created, no ticket created.
FWIW: I am using the pipe setup for the email account. If using IMAP or POP, it may require a little more code to get it clean out the INBOX.
Actually, just looking through the MailFetcher.php, it seems both the IMAP and PIPE call the same "public function parseToTicket" which is what calls to the getClientID.
Maybe I will look at adding a setting to turn this function on and off, but I would say it should work the way it is. Would love to have Andres add this into the base code should he ever decide to release an update.
Around line 120
Original code
Code:
public function getClientID($name, $email, $password=''){
if(!$user_data = $this->getRow(['email' => $email])){
$client_id = $this->createAccount($name, $email, $password);
}else{
$client_id = $user_data->id;
}
return $client_id;
}
Changed it to
Code:
public function getClientID($name, $email, $password=''){
if(!$user_data = $this->getRow(['email' => $email])){
// $client_id = $this->createAccount($name, $email, $password);
exit(); //Commented the above line and added this one. This checks and if the account does not exist, it just dies.
}else{
$client_id = $user_data->id;
}
return $client_id;
}
Anyone see anything wrong with this? It seems to do exactly what I want it to.
If I email my Helpdeskz from a known account, it creates the ticket. If I email it from an unknown account, NOTHING happens. No return on the email, no user created, no ticket created.
FWIW: I am using the pipe setup for the email account. If using IMAP or POP, it may require a little more code to get it clean out the INBOX.
Actually, just looking through the MailFetcher.php, it seems both the IMAP and PIPE call the same "public function parseToTicket" which is what calls to the getClientID.
Maybe I will look at adding a setting to turn this function on and off, but I would say it should work the way it is. Would love to have Andres add this into the base code should he ever decide to release an update.