added PHP changes to user module and fixed bugs