addFilter( new ezcAuthenticationDatabaseFilter( $database ) ); if ( !$authentication->run() ) { // authentication did not succeed, so inform the user $status = $authentication->getStatus(); $err = array( 'ezcAuthenticationDatabaseFilter' => array( ezcAuthenticationDatabaseFilter::STATUS_USERNAME_INCORRECT => 'Incorrect username', ezcAuthenticationDatabaseFilter::STATUS_PASSWORD_INCORRECT => 'Incorrect password' ) ); foreach ( $status as $line ) { list( $key, $value ) = each( $line ); echo $err[$key][$value] . "\n"; } } else { // authentication succeeded, so allow the user to see his content } ?>