Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
119 lines (91 sloc) 4.3 KB
<title>Net_Ident - PHP Ident Client Class</title>
<p>Net_Ident - PHP Ident Client Class</p>
<h1><a name="SYNOPSIS">SYNOPSIS</a></h1>
require_once 'Net/Ident.php';
$ident = new Net_Ident;
$user = $ident-&gt;getUser();
$os_type = $ident-&gt;getOsType();
echo "user: $user, operating system: $os_type\n";
<h1><a name="OVERVIEW">OVERVIEW</a></h1>
<p><tt>Net_Ident</tt> is an RFC 1413 compatible PHP4 Ident client
class. The Identification Protocol (a.k.a., "ident", a.k.a., "the Ident
Protocol") provides a means to determine the identity of a user of a
particular TCP connection. Given a TCP port number pair, it returns a
character string which identifies the owner of that connection on the
server's system.</p>
<h1><a name="CONSTRUCTOR">CONSTRUCTOR</a></h1>
<blockquote><tt>$ident = Net_Ident($remote_addr, $remote_port,
$local_port, $ident_port, $timeout)</tt></blockquote>
<p>The constructor of this class accepts five optional arguments.
<tt>$remote_addr</tt> is the IP address or DNS hostname of the remote
computer running the ident server. <tt>$remote_port</tt> is the port
number the remote computer is using to make a connection to the local
machine. PHP can access the remote port for a given HTTP connection
using the <tt>REMOTE_PORT</tt> environment variable.
<tt>$local_port</tt> is the local port being connected to. Regular HTTP
connections will be on port 80, HTTPS connections on port 443. A more
robust solution would be to use the <tt>SERVER_PORT</tt> environment
variable to specify this port. You can specify also
<tt>$ident_port</tt> parameter, port where ident server of client
machine is listening and also socket timeout using <tt>$timeout</tt>
<p>There is no need to pass these variables into constructor. They will
be initialized by default, if not present. See example above.</p>
<p>TCP connection to the remote ident server will be established oly if
it will be really needed. After this, also ident query will be made.
The result of this query can be fetched using methods
<tt>getUser()</tt> and <tt>getOsType()</tt>.</p>
<h1><a name="METHODS">METHODS</a></h1>
<p>Performs ident network query. This is done automatically when
object is requested for returning particular user or operating system
data. You can force query performing with this method, so it is
possible to make more requests with only one Net_Ident object. Returns
PEAR_Error on connection error or rawdata read from socket on
<p>Returns a string containing the last error message returned by the
remote ident server.</p>
<p>Returns a string containing the <tt>USERID</tt> returned by the
remote ident server. This will return false if there was an error with
the query.</p>
<p>Returns a string containing the operating system type of the remote
host, as returned by the remote ident server. Permitted values may be
an ASCII string or a numerical code compliant with RFC 1340, "Assigned
<h1><a name="DISCLAIMER">DISCLAIMER</a></h1>
<p>I make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability,
or fitness for a particular purpose. This software is provided "AS IS",
and you, its user, assume the entire risk as to its quality and
<h1><a name="AUTHOR">AUTHOR and LICENSE</a></h1>
<p>Original version of Net_Ident was created by Gavin Brown &lt;<a
href=""></a>&gt;. Code
pearification and various improvements was done by Ondrej Jombik &lt;<a
<p>This PHP class is released under the PHP License.</p>
<h1><a name="SEE_ALSO">SEE ALSO</a></h1>
<p><a href="">RFC1413</a>, <a
Jump to Line
Something went wrong with that request. Please try again.