cvs: pear /Auth/Container IMAP.php

From: Date: Fri, 10 Jan 2003 18:19:05 +0000
Subject: cvs: pear /Auth/Container IMAP.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8172@lists.php.net to get a copy of this message
mj Fri Jan 10 13:19:05 2003 EDT Modified files: /pear/Auth/Container IMAP.php Log: * Raise error if IMAP extension can't be loaded. Index: pear/Auth/Container/IMAP.php diff -u pear/Auth/Container/IMAP.php:1.2 pear/Auth/Container/IMAP.php:1.3 --- pear/Auth/Container/IMAP.php:1.2 Sat Jan 4 06:54:43 2003 +++ pear/Auth/Container/IMAP.php Fri Jan 10 13:19:05 2003 @@ -16,7 +16,7 @@ // | Authors: Jeroen Houben <jeroen@terena.nl> | // +----------------------------------------------------------------------+ // -// $Id: IMAP.php,v 1.2 2003/01/04 11:54:43 mj Exp $ +// $Id: IMAP.php,v 1.3 2003/01/10 18:19:05 mj Exp $ // require_once "Auth/Container.php"; @@ -42,11 +42,11 @@ * $myAuth = new Auth('IMAP', $params); * .... * - * +/** * * @author Jeroen Houben <jeroen@terena.nl> * @package Auth - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ class Auth_Container_IMAP extends Auth_Container { @@ -64,6 +64,9 @@ */ function Auth_Container_IMAP($params) { + if (!extension_loaded('imap')) { + return PEAR::raiseError("Cannot use IMAP authentication, IMAP extension not loaded!", 41, PEAR_ERROR_DIE); + } $this->_setDefaults(); // set parameters (if any) @@ -95,7 +98,7 @@ function _checkServer($timeout=20) { $fp = @fsockopen ($this->options['host'], $this->options['port'], $errno, $errstr, $timeout); if ($fp) { - fclose($fp); + @fclose($fp); } else { return PEAR::raiseError("Error connecting to IMAP server ".$this->options['host'].":".$this->options['port'], 41, PEAR_ERROR_DIE); } @@ -126,7 +129,7 @@ $conn = @imap_open ('{'.$this->options['host'].':'.$this->options['port'].'}', $username, $password, OP_HALFOPEN); if ($conn) { $this->activeUser = $username; - imap_close($conn); + @imap_close($conn); return true; } else { $this->activeUser = '';

« previous php.pear.cvs (#8172) next »