Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By webengr on
I kind of got a pop3 DA module working that would work for a pop3 for one domain. but has an issue...
IF anyone is allowed to create an account w/o approval or if user.module is hacked,
the following Distributed Authentication module works... so long as the good username/passoword,
and no syntax error in imap_open function.
However if the imap_open fails, even if I have php display_errors OFF, it still opens the header with stream error message that shows the folder and messes up drupal page by putting
text before html head. Please, any suggestions on how to prevent error messages from imap_open() failing stream showing on resulting login failure page? example of module with "ourdomain.com" hard coded:function authpop3_info($field = 0) { $info['name'] = 'authpop3'; $info['protocol'] = 'POP3'; if ($field) {return $info[$field]; } else { return $info; } } function authpop3_auth($username, $password, $server) { $serverlowercase = strtolower($server); if ($serverlowercase != "ourdomain.com"){ return FALSE;} $link=imap_open("{ourdomainpop3server.com:995/pop3/ssl/novalidate-cert}",$username."@ourdomain.com",$password); if ($link){ imap_close($link); return TRUE; } else { return FALSE; } }
Comments
suggestions on how to prevent error messages from imap_open()
... in the LDAP_Integration module the following function prevents it:
a similar wrapper should work in your case.
a good suggestion!
a good suggestion!
I thought I had tried that earlier, but I must have made a typo, because it is making a difference now...
so far so good...
seems to still work with 4.7.0
Seems to still work with 4.7.0
NOTE, you may want to see also http://drupal.org/node/8760#comment-47188
The default user.module will not authenticate remote user accounts unless user_register == 1
so a hack would be to comment out per article. I'm sure there is a better way, maybe the
imap_auth contrib has a clever way to do that...