diff options
author | andi <andi@splitbrain.org> | 2005-01-27 22:14:11 +0100 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-01-27 22:14:11 +0100 |
commit | 44f669e9d81543bb16f1017c005d7739766c6d7d (patch) | |
tree | 9a9fb1b067532dcfb1a96ea9ba6ed8c85d13cad7 /inc/auth.php | |
parent | b6504bd7ff2bfd237edfbe2f1479a05698aa6624 (diff) | |
download | rpg-44f669e9d81543bb16f1017c005d7739766c6d7d.tar.gz rpg-44f669e9d81543bb16f1017c005d7739766c6d7d.tar.bz2 |
utf8 safe mailfunctions added (fixes #82)
darcs-hash:20050127211411-9977f-77f25921e855969dd8b7d4ded732bfdba5aec7ab.gz
Diffstat (limited to 'inc/auth.php')
-rw-r--r-- | inc/auth.php | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/inc/auth.php b/inc/auth.php index 62e4fec32..0b4ed8113 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -12,6 +12,7 @@ require_once("inc/common.php"); require_once("inc/io.php"); require_once("inc/blowfish.php"); + require_once("inc/mail.php"); // load the the auth functions require_once('inc/auth_'.$conf['authtype'].'.php'); @@ -329,10 +330,10 @@ function auth_sendPassword($user,$password){ $text = str_replace('@PASSWORD@',$password,$text); $text = str_replace('@TITLE@',$conf['title'],$text); - if (!empty($conf['mailfrom'])) { - $hdrs = 'From: '.$conf['mailfrom']."\n"; - } - return @mail($userinfo['mail'],$lang['regpwmail'],$text,$hdrs); + return mail_send($userinfo['name'].' <'.$userinfo['mail'].'>', + $lang['regpwmail'], + $text, + $conf['mailfrom']); } /** @@ -366,7 +367,7 @@ function register(){ } //check mail - if(!isvalidemail($_POST['email'])){ + if(!mail_isvalid($_POST['email'])){ msg($lang['regbadmail'],-1); return false; } @@ -388,18 +389,4 @@ function register(){ } } -/** - * Uses a regular expresion to check if a given mail address is valid - * - * May not be completly RFC conform! - * - * @link http://www.webmasterworld.com/forum88/135.htm - * - * @param string $email the address to check - * @return bool true if address is valid - */ -function isvalidemail($email){ - return eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$", $email); -} - ?> |