Removed use of the deprecated function 'notify'
Tidy up of lib.php
CONTRIB-4067 - Query user table for necessary fields only to avoid 'column ambiguously defined' error in Oracle