2 rcs_id('$Id: POP3.php,v 1.1 2004-11-01 10:43:58 rurban Exp $');
3 /* Copyright (C) 2004 $ThePhpWikiProgrammingTeam
7 extends _IMAPPassUser {
9 * Define the var POP3_AUTH_HOST in config/config.ini
10 * Preferences are handled in _PassUser
12 function checkPass($submitted_password) {
13 if (!$this->isValidName()) {
14 return $this->_tryNextPass($submitted_password);
16 $userid = $this->_userid;
17 $pass = $submitted_password;
18 $host = defined('POP3_AUTH_HOST') ? POP3_AUTH_HOST : 'localhost:110';
19 if (defined('POP3_AUTH_PORT'))
20 $port = POP3_AUTH_PORT;
21 elseif (strstr($host,':')) {
22 list(,$port) = split(':',$host);
27 $fp = fsockopen($host, $port, $errno, $errstr, 10);
30 $line = fgets($fp, 1024);
31 if (! strncmp("+OK ", $line, 4)) {
33 fputs($fp, "user $userid\n");
35 $line = fgets($fp, 1024);
36 if (! strncmp("+OK ", $line, 4)) {
38 fputs($fp, "pass $pass\n");
40 $line = fgets($fp, 1024);
41 if (! strncmp("+OK ", $line, 4)) {
46 // quit the connection
48 // Get the sayonara message
49 $line = fgets($fp, 1024);
52 trigger_error(_("Couldn't connect to %s","POP3_AUTH_HOST ".$host.':'.$port),
55 $this->_authmethod = 'POP3';
57 $this->_level = WIKIAUTH_USER;
59 $this->_level = WIKIAUTH_ANON;
65 // $Log: not supported by cvs2svn $
71 // c-hanging-comment-ender-p: nil
72 // indent-tabs-mode: nil