Page 1 of 1

2.3: Do not require customer email

Posted: Tue Mar 06, 2012 11:04 am
by marty
Hi all,

I'm setting up HESK 2.3 at our company and I think it'll really suit our needs, good software, well done developer(s)!
At the moment we're so small that we do not need email integration for customers, so I'd like to know how to make HESK not require the customers email address. Is that possible?
Regards
marty

Re: 2.3: Do not require customer email

Posted: Tue Mar 06, 2012 5:03 pm
by Klemen
Try this:

Open file "inc/common.inc.php" in Notepad and find line 1026 that says

Code: Select all

} // END hesk_validateEmail()
A few lines ABOVE this line change (line 1019)

Code: Select all

hesk_error($error);
to

Code: Select all

return 'empty@email.com';
Then open file "inc/email_functions.inc.php" and find line 48:

Code: Select all

function hesk_mail($to,$subject,$message) {
Just BELOW this line add:

Code: Select all

if ($to == 'empty@email.com')
{
return false;
}
Not tested so make backups first and let us know if it worked for you.

Re: 2.3: Do not require customer email

Posted: Thu Mar 08, 2012 8:19 am
by marty
Hi Klemen,

your proposed changes seem plausible but don't work.
Even after logging out and back in and restarting apache2 the error persists.
I tried to understand the code and came up with the following:
hesk_validateEmail needs $address, so I set the email to empty@... if it's empty:

Code: Select all

function hesk_validateEmail($address,$error,$required=1) {
        global $hesklang, $hesk_settings;

        /* Set email to empty@email.com if none is given */
        if ($address == '')
        {
        return 'empty@email.com';
        }

        if (strpos($address,"'") !== false ...
        ...
        ...
I'm not shure if that's good programming style or if it has security implications, but my gut feeling is that it's OK.
And it works as intended, btw :D

Keep up the good work!
Marty