fetaure/491: fixing problems reported by reviewer.

* use the l() function
* use the format_date() function
* check permission in preprocess.