R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
How to do UnAuthorize User by Progamitically??
Last Post 24 Feb 2009 02:33 PM by kevinmschreiner. 1 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
hitesh035User is Offline
New Member
New Member
Posts:2

--
24 Feb 2009 07:25 AM  
hi To All,

i want to do UnAuthorize User by Progamitically.

can any tell me it there any Fields in users,userProfile, aspnet_Users , aspnet_Membership etc... for UnAuthorize User??


Regards,
Hitesh Panchal
kevinmschreinerUser is Offline
Advanced Member
Advanced Member
Posts:729

--
24 Feb 2009 02:33 PM  
The column is isApproved from the aspnet_Membership table. The table is bound to the Users table of DNN by the username and ApplicationID. Provided below are two samples, one if you are unauthorizing the user by UserID the other if using the username. In both cases I assume you will only have one applicationID.

/* By UserID: */
UPDATE am
set am.isApproved = 1
from
aspnet_users au
join aspnet_membership am on
am.UserID = au.UserID
join users u on
au.Username = u.Username AND
u.UserID = @UserID


/* By Username: */
UPDATE am
set am.isApproved = 1
from
aspnet_users au
join aspnet_membership am on
am.UserID = au.UserID and
au.username = @Username
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share