From surface electrical properties to spontaneous potentials in porous media