+1-888-365-2779
Try Now
More in this section

Forums / Security / Problems Login control and other components

Problems Login control and other components

11 posts, 0 answered
  1. Daniel
    Daniel avatar
    62 posts
    Registered:
    20 Apr 2009
    17 Jun 2009
    Link to this post
    Hello

    Again let me apologise for the simplicity of this post.

    Basically I am using the telerik users table provided by sitefinity to log in and out users. Yesterday I developed (with help) a registration process which works fine however today I have come to realise that the login/out control no longer appears to work.

    All it does is refresh the current page, I have since realised that the same is true when I am in sitfinity and try to publish or cancel changes to a page.

    I am a bit confused as to why this is happening!

    Also sorry if there is already a fix to this issue i just couldn't find it ;-)

    Thank you in advance for your help

    Daniel
  2. Daniel
    Daniel avatar
    62 posts
    Registered:
    20 Apr 2009
    17 Jun 2009
    Link to this post
    My apologies it is the login view control that I first Realised was producing the undesired result!

    thank you

    Daniel
  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Jun 2009
    Link to this post
    Hi Daniel,

    We are glad that you were able to find what the problem was. We would like to know if you were able to resolve this issue, or you would require additional help on it.

    Regards,
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  4. Daniel
    Daniel avatar
    62 posts
    Registered:
    20 Apr 2009
    17 Jun 2009
    Link to this post
    Sorry. No I wasnt able to fix the problem I just meant that I was using the login View control and not the login control as I thought I stated in the first post

    Sorry for the confusion!!
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Jun 2009
    Link to this post
    Hello Daniel,

    Thank you for the information. Here is a sample implementation of a custom control for registering users. It is very simple but it will illustrate how to make use of the membership provider.

    CustomRegister.ascx:
    <p>Username:<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox></p
    <p>Password:<asp:TextBox ID="txtPassword" runat="server" ></asp:TextBox></p
    <p>E-mail:<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox></p
    <p>Role:<asp:TextBox ID="txtRole" runat="server"></asp:TextBox></p
    <asp:Button ID="btnRegister" runat="server" onclick="btnRegister_Click"  
        Text="Register" /> 

    and the code behind CustomRegister.ascx.cs:
    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Web; 
    using System.Web.UI; 
    using System.Web.UI.WebControls; 
    using System.Web.Security; 
    using Telerik.Security; 
    using System.Web.Profile; 
     
    public partial class CustomControls_CustomRegister : System.Web.UI.UserControl 
        protected void Page_Load(object sender, EventArgs e) 
        { 
     
        } 
        protected void btnRegister_Click(object sender, EventArgs e) 
        { 
            MembershipUser mymanager = new UserManager().CreateUser(txtUserName.Text, txtPassword.Text, txtEmail.Text); 
            UserManager manager = new UserManager(); 
            ProfileBase profile = ProfileBase.Create(txtUserName.Text); 
            if (!manager.RoleProvider.RoleExists(txtRole.Text)) 
            { 
                Roles.CreateRole(txtRole.Text); 
                Roles.AddUserToRole(txtUserName.Text, txtRole.Text); 
            } 
            else manager.AddUserToRole(txtUserName.Text, txtRole.Text); 
            profile.Save(); 
        } 


    I have also tested it with the Login View control and could not notice any odd behavior. Can you please make sure that you have set the appropriate permissions for each role that you have created in your Administration tab in Permissions section when you log in with your admin account (CmsAcces for example), also have you set permissions for different modules and pages to different roles.

    If the problem persists, please elaborate a bit more on it.

    Sincerely,
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Daniel
    Daniel avatar
    62 posts
    Registered:
    20 Apr 2009
    17 Jun 2009
    Link to this post
    Hello Rado,

    I am afraid I havent explained my self correctly, all the registration stuff works as intended.

    Since then I have created 3 other users (through sitefinty) all with adminitrative roles however none of them can publish a page all the button does is reload the edit page.

    I then go to the front end and as I have been logged in to sitefinity the login view shows I am logged in so I click logout and again all this does is refresh the page.

    I have also noticed that the account created when the application was created has had its password not sure who did this but I used to use that account to test these things out lol. I have tried resetting the password but it still wont let me log in!

    Sorry for the consfusion I hope this clears things up.

    Daniel
  7. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Jun 2009
    Link to this post
    Hi Daniel,

    Are you using a customized Login View control. I have tried to reproduce what you are explaining. As I went to the public part of the web site and clicked Logout in the Login View control it logged me out, both from the public and administrative part of the web site. I have tested it both with users created with my custom control and through Sitefinity. The control is logging me out and refreshes the page. However you can set custom behavior to your Login View control. To do this:

    1) Open your Sitefinity web-site in Visual Studio
    2) Go to folder Sitefinity\UserControls\Login
    3) Open the LoginViewControl.ascx file and set the desired behavior.

    For example, I have added
    LogoutAction="RedirectToLoginPage" 
    to this line:
    <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="~/Default.aspx"  
                    LogoutAction="RedirectToLoginPage"/> ) 
    This redirects me to my Sitefinity Login Page.

    As for reseting your administrator password, please read:
    Resetting Administrator Password.

    I hope that this will answer your questions. If you need anything else, please feel free to contact us.

    Best wishes,
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Daniel
    Daniel avatar
    62 posts
    Registered:
    20 Apr 2009
    18 Jun 2009
    Link to this post
    Hello Rado,

    Thank you for your help I have managed to successfully change the admin password (I couldn't find that document anywhere sorry!).

    However still when editing the pages within sitefinity i get a very annoying problem.

    If I try to drag a control on from the toolbox the page reloads as normal but the control has not been added. or if I try to delete a control on the page the message box asks if I am sure i click ok the page reloads but the control still exists!

    Thanks again

    Daniel
  9. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    18 Jun 2009
    Link to this post
    Hello Daniel,

    Could you please check if there is a case described in the KB Article Sitefinity page freezes in Edit mode, that matches with what you have in your case?

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  10. Daniel
    Daniel avatar
    62 posts
    Registered:
    20 Apr 2009
    18 Jun 2009
    Link to this post
    Hi Rado\Georgi

    Thank you for your help with this over the past couple of days. That was the cause of my problems!

    A bit weird that you cant use Postback URL I see there is a work around which is great.

    Thanks once again.

    Daniel
  11. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    18 Jun 2009
    Link to this post
    Hi Daniel,

    I too think that the PostBackUrl property should not cause any problems. That is why we will have this fixed with the new page editor in Sitefinity 4.0.

    Good luck with the project!

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
11 posts, 0 answered