Öffentliche Methoden | |
| __construct () | |
| Authorise ($host, $port=false, $tval=false, $username, $password, $debug_level=0) | |
| Connect ($host, $port=false, $tval=30) | |
| Login ($username= '', $password= '') | |
| Disconnect () | |
Öffentliche Attribute | |
| $POP3_PORT = 110 | |
| $POP3_TIMEOUT = 30 | |
| $CRLF = "\r\n" | |
| $do_debug = 2 | |
| $host | |
| $port | |
| $tval | |
| $username | |
| $password | |
Definiert in Zeile 62 der Datei class.pop3.php.
| POP3::__construct | ( | ) |
Constructor, sets the initial values public
Definiert in Zeile 130 der Datei class.pop3.php.
00130 { 00131 $this->pop_conn = 0; 00132 $this->connected = false; 00133 $this->error = null; 00134 }
| POP3::Authorise | ( | $ | host, | |
| $ | port = false, |
|||
| $ | tval = false, |
|||
| $ | username, | |||
| $ | password, | |||
| $ | debug_level = 0 | |||
| ) |
Combination of public events - connect, login, disconnect public
| string | $host | |
| integer | $port | |
| integer | $tval | |
| string | $username | |
| string | $password |
Definiert in Zeile 145 der Datei class.pop3.php.
00145 { 00146 $this->host = $host; 00147 00148 // If no port value is passed, retrieve it 00149 if ($port == false) { 00150 $this->port = $this->POP3_PORT; 00151 } else { 00152 $this->port = $port; 00153 } 00154 00155 // If no port value is passed, retrieve it 00156 if ($tval == false) { 00157 $this->tval = $this->POP3_TIMEOUT; 00158 } else { 00159 $this->tval = $tval; 00160 } 00161 00162 $this->do_debug = $debug_level; 00163 $this->username = $username; 00164 $this->password = $password; 00165 00166 // Refresh the error log 00167 $this->error = null; 00168 00169 // Connect 00170 $result = $this->Connect($this->host, $this->port, $this->tval); 00171 00172 if ($result) { 00173 $login_result = $this->Login($this->username, $this->password); 00174 00175 if ($login_result) { 00176 $this->Disconnect(); 00177 00178 return true; 00179 } 00180 00181 } 00182 00183 // We need to disconnect regardless if the login succeeded 00184 $this->Disconnect(); 00185 00186 return false; 00187 }

| POP3::Connect | ( | $ | host, | |
| $ | port = false, |
|||
| $ | tval = 30 | |||
| ) |
Connect to the POP3 server public
| string | $host | |
| integer | $port | |
| integer | $tval |
Definiert in Zeile 197 der Datei class.pop3.php.
00197 { 00198 // Are we already connected? 00199 if ($this->connected) { 00200 return true; 00201 } 00202 00203 /* 00204 On Windows this will raise a PHP Warning error if the hostname doesn't exist. 00205 Rather than supress it with @fsockopen, let's capture it cleanly instead 00206 */ 00207 00208 set_error_handler(array(&$this, 'catchWarning')); 00209 00210 // Connect to the POP3 server 00211 $this->pop_conn = fsockopen($host, // POP3 Host 00212 $port, // Port # 00213 $errno, // Error Number 00214 $errstr, // Error Message 00215 $tval); // Timeout (seconds) 00216 00217 // Restore the error handler 00218 restore_error_handler(); 00219 00220 // Does the Error Log now contain anything? 00221 if ($this->error && $this->do_debug >= 1) { 00222 $this->displayErrors(); 00223 } 00224 00225 // Did we connect? 00226 if ($this->pop_conn == false) { 00227 // It would appear not... 00228 $this->error = array( 00229 'error' => "Failed to connect to server $host on port $port", 00230 'errno' => $errno, 00231 'errstr' => $errstr 00232 ); 00233 00234 if ($this->do_debug >= 1) { 00235 $this->displayErrors(); 00236 } 00237 00238 return false; 00239 } 00240 00241 // Increase the stream time-out 00242 00243 // Check for PHP 4.3.0 or later 00244 if (version_compare(phpversion(), '5.0.0', 'ge')) { 00245 stream_set_timeout($this->pop_conn, $tval, 0); 00246 } else { 00247 // Does not work on Windows 00248 if (substr(PHP_OS, 0, 3) !== 'WIN') { 00249 socket_set_timeout($this->pop_conn, $tval, 0); 00250 } 00251 } 00252 00253 // Get the POP3 server response 00254 $pop3_response = $this->getResponse(); 00255 00256 // Check for the +OK 00257 if ($this->checkResponse($pop3_response)) { 00258 // The connection is established and the POP3 server is talking 00259 $this->connected = true; 00260 return true; 00261 } 00262 00263 }

| POP3::Disconnect | ( | ) |
Disconnect from the POP3 server public
Definiert in Zeile 315 der Datei class.pop3.php.

| POP3::Login | ( | $ | username = '', |
|
| $ | password = '' | |||
| ) |
Login to the POP3 server (does not support APOP yet) public
| string | $username | |
| string | $password |
Definiert in Zeile 272 der Datei class.pop3.php.
00272 { 00273 if ($this->connected == false) { 00274 $this->error = 'Not connected to POP3 server'; 00275 00276 if ($this->do_debug >= 1) { 00277 $this->displayErrors(); 00278 } 00279 } 00280 00281 if (empty($username)) { 00282 $username = $this->username; 00283 } 00284 00285 if (empty($password)) { 00286 $password = $this->password; 00287 } 00288 00289 $pop_username = "USER $username" . $this->CRLF; 00290 $pop_password = "PASS $password" . $this->CRLF; 00291 00292 // Send the Username 00293 $this->sendString($pop_username); 00294 $pop3_response = $this->getResponse(); 00295 00296 if ($this->checkResponse($pop3_response)) { 00297 // Send the Password 00298 $this->sendString($pop_password); 00299 $pop3_response = $this->getResponse(); 00300 00301 if ($this->checkResponse($pop3_response)) { 00302 return true; 00303 } else { 00304 return false; 00305 } 00306 } else { 00307 return false; 00308 } 00309 }

| POP3::$CRLF = "\r\n" |
Definiert in Zeile 79 der Datei class.pop3.php.
| POP3::$do_debug = 2 |
Definiert in Zeile 85 der Datei class.pop3.php.
| POP3::$host |
Definiert in Zeile 91 der Datei class.pop3.php.
| POP3::$password |
Definiert in Zeile 115 der Datei class.pop3.php.
| POP3::$POP3_PORT = 110 |
Definiert in Zeile 67 der Datei class.pop3.php.
| POP3::$POP3_TIMEOUT = 30 |
Definiert in Zeile 73 der Datei class.pop3.php.
| POP3::$port |
Definiert in Zeile 97 der Datei class.pop3.php.
| POP3::$tval |
Definiert in Zeile 103 der Datei class.pop3.php.
| POP3::$username |
Definiert in Zeile 109 der Datei class.pop3.php.
| Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|