Limiting Public Access to pages fails with server error
I'm trying to create a simple password protected area for a couple of pages on my site, everytime I fill out the necessry details I get the following error.
Anyone got any ideas? I've never setup a password protected area so any advice etc... would be much apprechiated!
Thanks!
Mike
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] umbraco.cms.businesslogic.Content.CreateContent(ContentType ct) +188 umbraco.cms.businesslogic.member.Member.MakeNew(String Name, String LoginName, String Email, MemberType mbt, User u) +598 umbraco.cms.businesslogic.member.Member.MakeNew(String Name, String Email, MemberType mbt, User u) +55 umbraco.presentation.umbraco.dialogs.protectPage.protect_Click(Object sender, CommandEventArgs e) +879 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +108 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
I think that my problem was the way I was trying to set the site up. I had a home page under "Content" and then, alongside it, a login page and an error page. I was trying to set up public access protection for the home page. This resulted in the
Object reference notset to an instance of an object
error.
I moved the login and error pages beneath the home page and set up protection on all of the other pages beneath the home page and it all worked fine.
I then moved the login and error pages back to the top level, but left the home page unprotected and it all still worked.
Try to protect the home page again though and the error returned.
Is Umbraco meant to cope with this situation? It is interesting that, if you put an ASP:LoginStatus control on the home page, it ALWAYS shows the user as logged out, even if they are successfully logged in. The same control on a sub page correctly shows the user as logged in.
The other problem I had was setting up single user protection.
If the user and password that you specifiy is not an existing MEMBER then the protection setup fails with an "object reference not set to an instance of an object" error as in the original post.
Limiting Public Access to pages fails with server error
I'm trying to create a simple password protected area for a couple of pages on my site, everytime I fill out the necessry details I get the following error.
Anyone got any ideas? I've never setup a password protected area so any advice etc... would be much apprechiated!
Thanks!
Mike
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
what version of umbraco are you using? I recall this in 4.0.3 when you didnt provide a login page least i think that was the issue.
Regards
Ismail
I'm using 4.5.2. It seems to give me this error when I specify the login page, if I dont specify a login page then it doesnt pass the validation...
Anyone???
I have exactly the same problem with 4.5.2. Site is running under Vista Business SP2 and IIS
There's a 4.5.2 compatible Client Area in http://our.umbraco.org/projects/starter-kits/standard-website, you could try this and if it works just have a look at the differences in your setup?
I think that my problem was the way I was trying to set the site up. I had a home page under "Content" and then, alongside it, a login page and an error page. I was trying to set up public access protection for the home page. This resulted in the
error.
I moved the login and error pages beneath the home page and set up protection on all of the other pages beneath the home page and it all worked fine.
I then moved the login and error pages back to the top level, but left the home page unprotected and it all still worked.
Try to protect the home page again though and the error returned.
Is Umbraco meant to cope with this situation? It is interesting that, if you put an ASP:LoginStatus control on the home page, it ALWAYS shows the user as logged out, even if they are successfully logged in. The same control on a sub page correctly shows the user as logged in.
The other problem I had was setting up single user protection.
If the user and password that you specifiy is not an existing MEMBER then the protection setup fails with an "object reference not set to an instance of an object" error as in the original post.
is working on a reply...