HelpDeskZ Community
Email tickets from registered users only? - Printable Version

+- HelpDeskZ Community (http://community.helpdeskz.com)
+-- Forum: HelpDeskZ 2 (http://community.helpdeskz.com/forum-3.html)
+--- Forum: Support (http://community.helpdeskz.com/forum-5.html)
+--- Thread: Email tickets from registered users only? (/thread-2035.html)



Email tickets from registered users only? - GShelton - 04-13-2022

Hi! Fantastic job on this! Absolutely love how clean and smooth the whole thing is.
I followed a post on here to set it up to only allow users to create a ticket if they are logged in. This worked fantastically.�
Now what I would love to see is the ability to have it ignore emails from non-registered users. Essentially locking it down to my employees that I have manually added to the system.
Is this possible?


RE: Not Spam: Actual support question: Email tickets from registered users only? - cord.schneider - 04-14-2022

(04-13-2022, 07:35 PM)GShelton Wrote: Now what I would love to see is the ability to have it ignore emails from non-registered users. Essentially locking it down to my employees that I have manually added to the system.
Is this possible?

Unfortunately no, not natively. You would no doubt have to hack the code to do this.


RE: Not Spam: Actual support question: Email tickets from registered users only? - GShelton - 04-14-2022

Thank you for letting me know. I hate to have to modify it (tougher for updates as I am sure you understand) but I don't want a bunch of crap flowing in. Smile


RE: Not Spam: Actual support question: Email tickets from registered users only? - cord.schneider - 04-15-2022




RE: Not Spam: Actual support question: Email tickets from registered users only? - GShelton - 04-15-2022

I will absolutely share any progress I make.


RE: Not Spam: Actual support question: Email tickets from registered users only? - GShelton - 04-15-2022

Client.php

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.


RE: Not Spam: Actual support question: Email tickets from registered users only? - cord.schneider - 04-17-2022

(04-15-2022, 08:17 PM)GShelton Wrote: Anyone see anything wrong with this? It seems to do exactly what I want it to.
Seems to be a sensible change and unlikely to adversely affect anything else.