summaryrefslogtreecommitdiff
path: root/final/app/include/ludo/auth.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'final/app/include/ludo/auth.inc.php')
-rw-r--r--final/app/include/ludo/auth.inc.php31
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)