Restrict Access on a Page - نوشته شده در (2172 Views)
Average Member
Zuel
مطلب: 540
540
I am creating my own asp pages not relevent to the forums just the website itself and I included

config.asp
inc_func_secure.asp
inc_header.asp

To prevent people from accessing the page without logging in. Now is there is a way to incorporate the usergroup mod in that page so only a certain group or groups can see the page?
I think I will have to hardcode the values. Anyone play with this before?<
My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
Not entirely sure... but if you are using the forums user management you will also need to include inc_sha256.asp as well.<
نوشته شده در
Average Member
Zuel
مطلب: 540
540
Works fine without it. But I'll include that file then test for a change.<
My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File
نوشته شده در
Average Member
Zuel
مطلب: 540
540
Internal Server Error when I include inc_sha256.asp.

I didn't run it on my local machine so I don't know what threw the error. I'll just leave it off for now.
I basically took the same includes default.asp had.<
My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
Odd... last time I left it out it wouldn't work... as long as its working wink<
نوشته شده در
Average Member
Zuel
مطلب: 540
540
Back to the original question. Has anyone made a page restricted to a usergroup only?<
My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File
نوشته شده در
Average Member
Roger Fredriksson
مطلب: 556
556
While waiting for some real Snitzer to answer I would test to use USERGROUP_ID in a query based on the table FORUM_USERGROUPS and FORUM_USERGROUPS_MEMBER for checking if the user has access to the page or not.<
rf/www.avgifter.com
نوشته شده در
Average Member
Zuel
مطلب: 540
540
Originally posted by Roger Fredriksson
While waiting for some real Snitzer to answer I would test to use USERGROUP_ID in a query based on the table FORUM_USERGROUPS and FORUM_USERGROUPS_MEMBER for checking if the user has access to the page or not.

Having said that. I need to make a SQL script that says something similar too:

dbo.FORUM_USERGROUP_USERS
SELECT MEMBER_ID
WHERE USERGROUP_ID = 1 or USERGROUP_ID = 2

Then I need a way to check MEMBER_ID vs their ID. If it doesn't match, then Response.Redirect, else show page.
If anyone gets this, can you please point me in the right direction.
Thanks!<
My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File
نوشته شده در
Average Member
Roger Fredriksson
مطلب: 556
556
MemberID is present when you include the files in your post above. Cheating by using Access i get this SQL:

SELECT [FORUM_USERGROUPS].[USERGROUP_ID], [FORUM_USERGROUP_MEMBERS].[MEMBER_ID] FROM FORUM_USERGROUPS INNER JOIN FORUM_USERGROUP_MEMBERS ON [FORUM_USERGROUPS].[USERGROUP_ID]=[FORUM_USERGROUP_MEMBERS].[USERGROUP_ID] WHERE ((([FORUM_USERGROUPS].[USERGROUP_ID])=2 Or ([FORUM_USERGROUPS].[USERGROUP_ID])=3) And (([FORUM_USERGROUP_MEMBERS].[MEMBER_ID])=[MemberID]));

After generating the recordset it ought to be some easy way to find out if it is empty(=redirect) or not(=access) (While Not objRS.EOF....?) Haven´t got the time just now to look it up - I´ll be back in a couple of hours if no one else steps in and tell you the smartest way to do what originally asked for. (If I am lost I do hope they also delete my posts)<
rf/www.avgifter.com
نوشته شده در
Average Member
Roger Fredriksson
مطلب: 556
556
The easy way: If oRS.RecordCount = 0 then redirect else acess (a kind of shorthand asp!!) should do the trick, would it not?<
rf/www.avgifter.com
نوشته شده در
Average Member
Zuel
مطلب: 540
540
Man, thanks for the info. I will test it out when I get some sleep. wink<
My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File
شما باید یک متن وارد کنید