mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
Fusionnes les 2 fonctions tests de validation email en une seule car la deuxime inclue la premire.
This commit is contained in:
@@ -38,34 +38,25 @@
|
||||
Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
valid_email() checks the basic syntax of an email address and returns true/false.
|
||||
|
||||
Distributed by Nick Brandt (nick@nbrandt.com)
|
||||
Last modified 27/Feb /2003 1:15
|
||||
/*!
|
||||
\brief Renvoi vrai si l'email est syntaxiquement valide
|
||||
\param address adresse email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
|
||||
\return boolean true si email valide, false sinon
|
||||
*/
|
||||
function valid_email($email) {
|
||||
if (ereg("^([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])*$",$email)) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ValidEmail($address)
|
||||
{
|
||||
if( ereg( ".*<(.+)>", $address, $regs ) ) {
|
||||
if (ereg( ".*<(.+)>", $address, $regs)) {
|
||||
$address = $regs[1];
|
||||
}
|
||||
if(ereg( "^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|net|com|gov|mil|org|edu|int)\$",$address) )
|
||||
if (ereg( "^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|net|com|gov|mil|org|edu|int)\$",$address))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,9 +82,6 @@ function check_mail ($mail)
|
||||
Le \a message est envoy<6F> dans syslog dans la cat<61>gorie LOG_USER.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
function dolibarr_syslog($message, $level=LOG_ERR)
|
||||
{
|
||||
openlog("dolibarr", LOG_PID | LOG_PERROR, LOG_USER); # LOG_USER au lieu de LOG_LOCAL0 car non accept<70> par tous les PHP
|
||||
@@ -103,6 +91,7 @@ function dolibarr_syslog($message, $level=LOG_ERR)
|
||||
closelog();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Affiche le header d'une fiche
|
||||
\param links liens
|
||||
@@ -110,7 +99,6 @@ function dolibarr_syslog($message, $level=LOG_ERR)
|
||||
\param title titre ("" par defaut)
|
||||
*/
|
||||
|
||||
|
||||
function dolibarr_fiche_head($links, $active=0, $title='')
|
||||
{
|
||||
print "<!-- fiche --><div class=\"tabs\">\n";
|
||||
|
||||
Reference in New Issue
Block a user