Membership - adding methods (programming help)

M

mazdotnet

Hi all,

I just found out that ASP.NET membership does not have a method to
lock accounts (only Unlock user)
See http://forums.asp.net/p/825946/825946.aspx

Question was 'I understand that the MembershipUser.UnlockUser method
will unlock an account (set the aspnet_Membership IsLockedOut back to
0 so on), but I see no way to Set LockUser. Is there nothing built in
to Membership to do this? '

A user responsed 'No, you have to create your own method that will
lock the user. '. I haven't done much inheritance coding... What's the
best way of doing this? Do I create a new class that inherits from
Membership? Can you please show me a sample code? I would do it by
creating a class ex. ManageUser and add method 'LockUser' but from my
understanding it's better to extend the current Membership class and
add the new method. If you can sort of map out the main class
structure that would be perfect.

Thx
M.
 
C

Cubaman

Hi all,

I just found out that ASP.NET membership does not have a method to
lock accounts (only Unlock user)
Seehttp://forums.asp.net/p/825946/825946.aspx

Question was 'I understand that the MembershipUser.UnlockUser method
will unlock an account (set the aspnet_Membership IsLockedOut back to
0 so on), but I see no way to Set LockUser. Is there nothing built in
to Membership to do this? '

A user responsed 'No, you have to create your own method that will
lock the user. '. I haven't done much inheritance coding... What's the
best way of doing this? Do I create a new class that inherits from
Membership? Can you please show me a sample code? I would do it by
creating a class ex. ManageUser and add method 'LockUser' but from my
understanding it's better to extend the current Membership class and
add the new method. If you can sort of map out the main class
structure that would be perfect.

Thx
M.

Hello:
In case you're using Sql server as repository, the best way to achieve
this is to extend SqlMembership, wich is the class that manage users.
Once you add your method to the new class, you shoul add it to your
system.web provider section in
Webconfig file.

<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider"
type="MyNamespace.MyMembershipProvider" connectionStringName="ConStr"
applicationName="AppName" minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
requiresQuestionAndAnswer="false" enablePasswordReset="true"
enablePasswordRetrieval="false"/>
</providers>
</membership>

Best regards
Oscar Acosta
 
M

mazdotnet

Hello:
In case you're using Sql server as repository, the best way to achieve
this is to extend SqlMembership, wich is the class that manage users.
Once you add your method to the new class, you shoul add it to your
system.web provider section in
Webconfig file.

<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider"
type="MyNamespace.MyMembershipProvider" connectionStringName="ConStr"
applicationName="AppName" minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
requiresQuestionAndAnswer="false" enablePasswordReset="true"
enablePasswordRetrieval="false"/>
</providers>
</membership>

Best regards
Oscar Acosta- Hide quoted text -

- Show quoted text -

Thank you
M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top