Nigerian candidate wins court ruling