Private page only for one defined user

Topics: Developer Forum
May 19, 2014 at 11:01 AM
Hi friends,
i've a new problem... I want to set a private webpage for only one defined user. I've tryed to edit this code:
    <%
    * Use this code in each page you want to protect  (CookieLogin and TableAuth routines are in main.prg)
    CookieLogin()  && checks for cookie to authenticate 
    IF !(oSession.VALUE("authenticated"))               && check dbf authentication if no cookie or cookie fails
         TableAuth(ALLTRIM(oRequest.FORM("Login")),ALLTRIM(oRequest.FORM("Password")),oRequest.FORM("C1"))    &&values from form
    ENDIF
    IF !(oSession.VALUE("authenticated")) 
        oSession.VALUE("previous",oProp.Action)  && save target
        oResponse.Redirect(JUSTPATH(oProp.ScriptPath)+[/login]+oProp.Ext)  && if still not authenticated goto login
    ENDIF 
    %>
with this
    <%
    * Use this code in each page you want to protect  (CookieLogin and TableAuth routines are in main.prg)
    CookieLogin()  && checks for cookie to authenticate 
    IF !(oSession.VALUE("authenticated"))               && check dbf authentication if no cookie or cookie fails
         TableAuth(ALLTRIM(oRequest.FORM("Login")),ALLTRIM(oRequest.FORM("Password")),oRequest.FORM("C1"))    &&values from form
    ENDIF
    IF !(oSession.VALUE("authenticated")) OR (oSession.VALUE("authenticated") AND oSession.VALUE("_codcli")!="0000001")
        oSession.VALUE("previous",oProp.Action)  && save target
        oResponse.Redirect(JUSTPATH(oProp.ScriptPath)+[/login]+oProp.Ext)  && if still not authenticated goto login
    ENDIF 
    %>
It should be ok but i receive an error in main.prg :(
Marked as answer by mr_ocean on 5/19/2014 at 5:18 AM
May 19, 2014 at 12:17 PM
Close the topic. It's only a problem of not compiled Main.prg. All works fine!