added function to read document from the cgi script and modified the code so that when user is logged in, the document is read from the cgi
added function to read document from the cgi script and modified the code so that when user is logged in, the document is read from the cgi