* @author Christian Weiske * @author Eric Dane * @license GPL http://www.gnu.org/licenses/gpl.html * @link http://sourceforge.net/projects/semanticscuttle */ /** * Remote User helper methods. * * @category Bookmarking * @package SemanticScuttle * @author Christian Weiske * @license GPL http://www.gnu.org/licenses/gpl.html * @link http://sourceforge.net/projects/semanticscuttle */ class SemanticScuttle_Model_RemoteUser { /** * Returns the remote user's IP. * * @return string IP address. NULL if not found. */ public static function getIp() { $ip = null; if (getenv('REMOTE_ADDR')) { $ip = getenv('REMOTE_ADDR'); } else if (getenv('HTTP_CLIENT_IP')) { $ip = getenv('HTTP_CLIENT_IP'); } else if (getenv('HTTP_X_FORWARDED_FOR')) { $ip = getenv('HTTP_X_FORWARDED_FOR'); } return $ip; } } ?>