Added some methods to User.php

error with the main database object