Recently Viewed...
DNN Modules
SnowCovered Top Sellers

Ultra Media Gallery 5.3
Ultra Media Gallery is the most popular photo gallery and media gallery module for DotNetNuke, the major purpose of this module is to allow you create unlimited pictures and medias to your gallery and organize them by albums, your albums and medias are browsed in flash interface.

Ultra Video Gallery 2.3
Ultra Video Gallery is a brother product of Ultra Media Gallery, The major purpose of this product is to provide an easy way to add videos in various formats to your website by and play them in a unique flash gallery.

Engage: Publish 5.1
Content Workflow + Versioning + Categorization + Multiple Display Options = Truly Advanced DotNetNuke Content Management (Requires DNN 4.5.1 or later)

Flex By DrNuke
The Flex skins are professionally designed, coded and packaged by a team of DotNetNuke experts. Available in 8 great colours, each with 15 banner images, 2 menu types and a choice of 3 background styles. The entire pack features a total of 2472 skins!

XMod 5.1
Version 5 of the perennial best-selling tool for creating data-based solutions in DNN without custom programming. This version focuses on greater flexibility, expandability, and ease-of-use.

Events Calendar and Registration 2.1.8 for DNN4.xx
One stop solution for events calendar and events registration! Demo site available for free trial.

Open-DocumentLibrary v3.0
Powerful, Ajax Enabled, Easy to Use. Document Management has never been better. Open-DocumentLibrary allows DotNetNuke users to share and manage documents in a flexible, intelligent way, offering granular control over Folder and Document access.

DNNMasters SEO Suite Enterprise w/Source
If you want better Search Engine ranking you need KeepAlive, URL Rewrite, Custom 404 error, Custom Redirect, Friendly URL's, Sitemap, Google Sitemap.DNNMasters SEO Suite delivers all of it and more!

Form Master 1.6 For DNN 4
Form Master 1.6 improves on the success of version 1.5 with new features in Function, and Presentation, while maintaining the Intuitive User Interface. Form Master 1.6 delivers visual form design where input fields can easily be created, modified, and moved.

Aero // 8 colors // multi-theme skin pack (v1.2)
aero is a flexible skin pack, featuring 8 incredible colors.Combine 3 background layouts, 3 widths and 6 headers to create your own, personalized site.Now also in Color Specific Packs!!
    |   Register   |   Sunday, September 07, 2008   
Data Springs Product Forums...
Subject: Auto-Authorize Users
Prev Next
You are not authorized to post a reply.

Author Messages
Bryan
Posts:1
new to the springs
new to the springs

04/11/2007 6:41 AM  
I am looking for a method to allow users to be automatically authorized for a portal when they enter a "Authorization Code" upon registration.  I have setup a link Dynamic Registration field to link to the DNN Core Authorize field.  I assume that this could be done with a Dynamic SQL statement that change the 'Authroize' field from NO to YES, but I don't know enough SQL to figure our the the specifics.  The linked dynamic authorized field is [DR Authorize].  Any help would be appreciated.
Chad
Posts:1873
river guide
river guide

04/12/2007 10:22 AM  
Hi. Well yes 'linking' an authorized field to the core field really wouldn't be enough. This is because the SQL event would take place after the authorized field/linked field was saved. You would need to create a SQL event directly to update the user.

Scenerio: You have a textbox field called 'Authorizion code'

Then you execute the SQL Event and would probalby need to research the steps for an 'if statement' in SQL but the update would need to update the DNN Membership table directly. I would suggest for testing purposes creating a stored procedure and then just passing the values to the stored proceudre in the SQL event.

I.e. stored procedure:
CREATE PROCEDURE AuthUserBasedOnCode
@code varchar(50) , @UserID integer
AS
SET NOCOUNT ON
SELECT AuthCode FROM yourtable
IF @@ROWCOUNT = 0
BEGIN
-- Don't authorize the user because the auth code was not in the table
END
ELSE
BEGIN
UPDATE aspnet_Membership
Set IsApproved = -1
WHERE user_id=@UserID
END

That would the the stored procedure. The SQL event would look something like:
exec AuthUserBasedOnCode '$(AuthCodeShortFieldName)', $(UserID)

The only issue here is that the membership table directly has a UserID GUID and not a userID integer. I forget what the relationional table is but you would need to get the GUID from from the UserID integer before actually updating the table in the procedure.

IF you end up needing some assistance you might submit a request for some consulting or development hours for our team on this. Or if anyone else has done this please post to help out, I think once the stored procedure and event was written it could be very helpful for others.

-Chad

Chad
Posts:1873
river guide
river guide

04/12/2007 10:35 AM  
There is also a table called UserPortals which might need to be updated as well.

-Chad
David
Posts:2
new to the springs
new to the springs

07/01/2008 12:54 PM  
We ran into this problem as well. Here is the script that we used to solve it.

CREATE PROCEDURE [dbo].[Fresco_AuthorizeUser]

@UserId int,
@PortalId int
AS

declare @UserName nvarchar(100)

select @UserName = Username from Users where UserID = @UserId
if (@UserName is not null)
begin
update aspnet_membership
set IsApproved = 1
where UserID = (select UserID from aspnet_Users where UserName = @UserName)

update UserPortals
set Authorised = 1
where UserId = @UserId and PortalId = @PortalId
end

Then create an completion event using this code:


execute Fresco_AuthorizeUser $(UserID), $(PortalID)

-David L
You are not authorized to post a reply.



ActiveForums 3.7

Copyright 2005 - 2008 by Data Springs, Inc.
Terms Of Use | Privacy Statement