username}:{$data->realm}:{$password}" ); $ha2 = md5( "{$data->requestMethod}:{$data->uri}" ); $digest = null; if ( !empty( $data->nonceCount ) && !empty( $data->clientNonce ) && !empty( $data->qualityOfProtection ) ) { // New digest (RFC 2617) $digest = md5( "{$ha1}:{$data->nonce}:{$data->nonceCount}:{$data->clientNonce}:{$data->qualityOfProtection}:{$ha2}" ); } else { // Old digest (RFC 2069) $digest = md5( "{$ha1}:{$data->nonce}:{$ha2}" ); } return $digest === $data->response; } /** * Checks authentication for the given $data. * * This method performs authentication as defined by the HTTP Digest * authentication mechanism. The received struct contains all information * necessary. * * If authentication succeeded true is returned, otherwise false. * * You can use {@link checkDigest()} to perform the actual digest * calculation and compare it to the response field. * * @param ezcWebdavDigestAuth $data * @return bool */ // abstract public function authenticateDigest( ezcWebdavDigestAuth $data ); /** * Checks authentication for the given $user. * * This method checks the given user/password credentials encapsulated in * $data. Returns true if the user was succesfully recognized and the * password is valid for him, false otherwise. In case no username and/or * password was provided in the request, empty strings are provided as the * parameters of this method. * * @param ezcWebdavBasicAuth $data * @return bool */ // abstract public function authenticateBasic( ezcWebdavBasicAuth $data ); } ?>