Example #1
0
 /**
  * Validate the IP address of the client with the IP stored in Session.
  * @param sess Session object associated with the token
  * @param clientIP IP address of the current client who made
  * <code>HttpRequest</code>.
  * @return Returns true if the IP is valid else false.
  * @throws SSOException if IP cannot be validated for the given session
  */
 public function isIPValid(Session $sess, $clientIP)
 {
     $check = false;
     try {
         $sessIPAddress = gethostbyname($sess->getProperty("Host"));
         $clientIPAddress = gethostbyname($clientIP);
         $check = $sessIPAddress == $clientIPAddress;
     } catch (Exception $e) {
         //			if (debug . messageEnabled()) {
         //				debug . message("IP address check of Token Failed", e);
         //			}
     }
     return $check;
 }