Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • ss 16 posts 36 karma points
    Feb 17, 2010 @ 06:20
    ss
    0

    umbraco

    How to check for confirmed member while login using the default member table in umbraco...

  • Stephan Lonntorp 195 posts 212 karma points
    Feb 17, 2010 @ 07:14
    Stephan Lonntorp
    0

    You'll need to add your own mechanism to confirm the member and update, for instance, a bool property on the member, and then in your login routine, check that value and act on it. Pretty much in the same way as you would in any ASP.NET Membership scenario.

     

    BR

    Stephan

  • ss 16 posts 36 karma points
    Feb 17, 2010 @ 08:24
    ss
    0

    The Member table(umbraco) has only the following fields as Email,login name,and password.. but i have an extra field confirm member(checkbox in umbraco).. i dont konw where the value of checkbox gets stored.. and how do i check whether the member is confirmed by the administrator while they login..

  • Scott Hugh Alexandar Petersen 349 posts 164 karma points
    Feb 17, 2010 @ 10:47
    Scott Hugh Alexandar Petersen
    1

    Hello SS

    You do not have to know where the value gets stored because the api will take care of this for you.

    If you look at the following tutorial then you should be able to do it.

    First you should create a class with your own namespace etc which will override the Umbraco validateuser method like this:

    namespace customNS {
     public class CustomMSP : umbraco.providers.members.UmbracoMembershipProvider {
      public override bool ValidateUser(string username, string password) {
    string encodedPassword = EncodePassword(password);
       umbraco.cms.businesslogic.member.Member member = umbraco.cms.businesslogic.member.Member.GetMemberFromLoginNameAndPassword(username, encodedPassword));
       if (member == null) {
        return false;
       } else {
        try {
         if (member.getProperty("confirm").Value.ToString() == "1") {
          return true;
         } else {
          return false;
         }
        }
        catch {
         return false;
        }
       }
       return (member != null);
      }
     }
    }'

    Next you should build that and put it into the bin directory

    Lastly you should modify your web.config to the following (outcomment the standard membership provider and put this in right below, this way you can always go back if needed).

    <add name="UmbracoMembershipProvider" type="customNS.CustomMSP" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Member Type" passwordFormat="Hashed" />

    Scott

Please Sign in or register to post replies

Write your reply to:

Draft