Rework DateTime handling in class.sqlLogDriver.php

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
Add PostgreSQL database support

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
Do not use mysql escaping (`), use dibi one ([])

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
Use COUNT(*) instead of counting the returned number of login

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
Do no reinvent dibi (use %in)

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>