| version 1.4, 2002/10/01 11:52:57 |
version 1.5, 2002/10/01 11:58:39 |
| Line 59 define('NET_IDENT_STATUS_ERROR', |
|
| Line 59 define('NET_IDENT_STATUS_ERROR', |
|
| * <?php |
* <?php |
| * require_once 'Net/Ident.php'; |
* require_once 'Net/Ident.php'; |
| * $ident = new Net_Ident; |
* $ident = new Net_Ident; |
| * $user = $ident->user(); |
* $user = $ident->getUser(); |
| * $os_type = $ident->osType(); |
* $os_type = $ident->getOsType(); |
| * echo "user: $user, operating system: $os_type\n"; |
* echo "user: $user, operating system: $os_type\n"; |
| * ?> |
* ?> |
| * |
* |
|
|
| } |
} |
| $this->_status = NET_IDENT_STATUS_ERROR; |
$this->_status = NET_IDENT_STATUS_ERROR; |
| $this->_error = 'Error connecting to ident server (' |
$this->_error = 'Error connecting to ident server (' |
| .$this->_props['remote_addr'].':'.$this->_props['ident_port'] |
.$this->_props['remote_addr'].':' |
| ."): $errstr ($errno)"; // ) |
.$this->_props['ident_port']."): $errstr ($errno)"; // ) |
| } |
} |
| |
|
| $line = $this->_props['remote_port'].','.$this->_props['local_port']."\r\n"; |
$line = $this->_props['remote_port'].',' |
| |
.$this->_props['local_port']."\r\n"; |
| @fwrite($socket, $line); |
@fwrite($socket, $line); |
| $line = @fgets($socket, 1000); // 1000 octets according to RFC 1413 |
$line = @fgets($socket, 1000); // 1000 octets according to RFC 1413 |
| fclose($socket); |
fclose($socket); |
|
|
| * username string on success |
* username string on success |
| * @access public |
* @access public |
| */ |
*/ |
| function user() |
function getUser() |
| { |
{ |
| $this->_status == NET_IDENT_STATUS_UNDEF && $this->query(); |
$this->_status == NET_IDENT_STATUS_UNDEF && $this->query(); |
| if ($this->_status == NET_IDENT_STATUS_ERROR) { |
if ($this->_status == NET_IDENT_STATUS_ERROR) { |
|
|
| * operating system type string on success |
* operating system type string on success |
| * @access public |
* @access public |
| */ |
*/ |
| function osType() |
function getOsType() |
| { |
{ |
| $this->_status == NET_IDENT_STATUS_UNDEF && $this->query(); |
$this->_status == NET_IDENT_STATUS_UNDEF && $this->query(); |
| if ($this->_status == NET_IDENT_STATUS_ERROR) { |
if ($this->_status == NET_IDENT_STATUS_ERROR) { |