diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2018-07-05 00:34:06 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2018-07-05 00:34:06 +0200 |
commit | e7cf0e99f41ab8ba3bab8aed516123c6f4ff3979 (patch) | |
tree | 979d1bd14bd76882f44704b51873404adf297809 /final/app/include/ludo/auth.inc.php | |
parent | 35a23f6145bb772b9bfa8c8eeb500aa8c02437d3 (diff) | |
download | 2007-AWOR-e7cf0e99f41ab8ba3bab8aed516123c6f4ff3979.tar.gz 2007-AWOR-e7cf0e99f41ab8ba3bab8aed516123c6f4ff3979.tar.bz2 2007-AWOR-e7cf0e99f41ab8ba3bab8aed516123c6f4ff3979.zip |
Version final-03-27-12h
Diffstat (limited to 'final/app/include/ludo/auth.inc.php')
-rw-r--r-- | final/app/include/ludo/auth.inc.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/final/app/include/ludo/auth.inc.php b/final/app/include/ludo/auth.inc.php index 2491203..516bd45 100644 --- a/final/app/include/ludo/auth.inc.php +++ b/final/app/include/ludo/auth.inc.php @@ -13,24 +13,33 @@ define("ERR_BAD_PARAMS", -100); // Fonction d'authentification pop3 function pop3_auth_simple($mail, $upw) { - if ( ($ret = ereg ( "(^.*)@([[:alnum:]]+\.[[:alnum:]]+)", $mail, $re_tokens ) ) ) + //~ echo "DEBUG : function pop3_auth_simple($mail, $upw)\n"; + //~ if ( ($ret = ereg ( "(^.*)@([[:alnum:]]+\.[[:alnum:]]+)", $mail, $re_tokens ) ) ) + if ( ($ret = ereg ( "(^.*)@(.+)", $mail, $re_tokens ) ) ) { /* $re_tokens [] * [0] : email complet * [1] : nom_mail * [2] : serveur_mail */ - require_once('config.inc.php'); - $srv_conf = $CONFIG['AUTH']['POP']['SERVERS'][strtolower($re_tokens[2])]; - if ( is_array($srv_conf) ) + $server_mail=strtolower($re_tokens[2]); + include('config.inc.php'); + + if ( isset($CONFIG['AUTH']['POP']['SERVERS'][$server_mail]) ) { - $server=$srv_conf['subdomain']; - $port=$srv_conf['port']; - if ( $srv_conf['username_is_full_mail'] ) - { $user = $mail; } else { $user = $re_tokens[1]; } - return pop3_auth ($server, $port, $user, $upw); + $srv_conf = $CONFIG['AUTH']['POP']['SERVERS'][$server_mail]; + if ( is_array($srv_conf) ) + { + $server=$srv_conf['subdomain']; + $port=$srv_conf['port']; + if ( $srv_conf['username_is_full_mail'] ) + { $user = $mail; } else { $user = $re_tokens[1]; } + return pop3_auth ($server, $port, $user, $upw); + } } - } + //~ else { print_r($CONFIG); echo "\nDEBUG : \$server_mail==$server_mail\n";} + }//else echo "Pb EREG\n"; + /* DEBUG echo $mail . "\n" . $ret . "\n";; print_r($re_tokens); @@ -40,6 +49,8 @@ function pop3_auth_simple($mail, $upw) function pop3_auth ($server, $port, $user, $upw) { + //~ echo "function pop3_auth ($server, $port, $user, $upw)\n"; + //echo "DEBUG : fsockopen($server, $port, $errno, $errstr, 10);"; $sock = @fsockopen($server, $port, $errno, $errstr, 10); if ( $sock === false) |