2
0
forked from Wavyzz/dolibarr

NEW: The notification module accept keyword __SUPERVISOR__ to send

notification to supervisor of user.
This commit is contained in:
Laurent Destailleur
2015-03-19 11:47:30 +01:00
parent 6ceda02eaa
commit f44d91e153
8 changed files with 152 additions and 131 deletions

View File

@@ -1633,14 +1633,14 @@ function dol_print_address($address, $htmlid, $mode, $id)
/**
* Return true if email syntax is ok
*
* @param string $address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @return boolean true if email syntax is OK, false if KO or empty string
* @param string $address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @param int $acceptsupervisorkey If 1, the special string '__SUPERVISOREMAIL__' is also accepted as valid
* @return boolean true if email syntax is OK, false if KO or empty string
*/
function isValidEmail($address)
function isValidEmail($address, $acceptsupervisorkey=0)
{
if (filter_var($address, FILTER_VALIDATE_EMAIL)) {
return true;
}
if ($acceptsupervisorkey && $address == '__SUPERVISOREMAIL__') return true;
if (filter_var($address, FILTER_VALIDATE_EMAIL)) return true;
return false;
}