Author |
Topic |
Nathan
Help Moderator
USA
7664 Posts |
Posted - 21 November 2003 : 20:37:00
|
Its not so much the active page as the active users 'panel' on the main page where groups are traditionally represented by color highlighting.
Also, I hope to eventually have group affect the "rank" (similar to # of stars here at snitz) of the users. In that case, I would need a one to one relationship between users and groups.
I guess thats really my problem, is I'm not sure which of the above methods to use to produce a one to one mapping from a many to one mapping.
Really it all boils down to what the users would rather have. Admin control, or member control. |
Nathan Bales CoreBoard | Active Users Download |
|
|
Kent
Junior Member
United States
193 Posts |
Posted - 21 November 2003 : 23:04:21
|
I have this great mod running without problems (I think!) on a test version of my portal with an Access database, and am trying to get the restrictions set up the way I want them... prior to going live on SQL Server...
Is there any way to configure it so that the forum is still listed on default.asp, but if you are not a member of a specific usergroup, then you are denied access to it, much like the "Allowed Member List" now functions....
I want the forum listed (showing the number of topics, etc.) to entice the registered user to pay for the "premium access." If I set the appropriate user group to Deny, it hides the forum on default.asp... by design, I understand....
Am I missing something in how these settings interact with each other? If not, where on default.asp could I make the change so that Deny doesn't hide the forum?
Thanks! |
Edited by - Kent on 21 November 2003 23:06:34 |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 22 November 2003 : 08:30:11
|
David, i got that error in the beta 1 version of the mod. The changes you made, by adding a check for EOF, is correct. The green code you highlighted won't be executed because blnAM = 0.
Anyways, I got some more bug fixes in this beta. I made sure I read the whoooole topic this time to make sure there weren't any fixes that I missed.
3 problems I encountered in the admin_usergroups.asp file (all lines have been shortened to not make this topic too wide): - I got that error on line 117, in regards to the LIMIT in the sql query. As Rui pointed out this is a MySQL specific keyword. Using TopSQL function was suggested and I changed line 117 from this:set rsGroup = my_conn.execute("SELECT USERGROUP_ID FROM " & strTablePrefix & "USERGROUPS ORDER BY USERGROUP_ID DESC LIMIT 0,1") to this:set rsGroup = my_conn.execute(TopSQL("SELECT USERGROUP_ID FROM " & strTablePrefix & "USERGROUPS ORDER BY USERGROUP_ID DESC;",1))
- The other problem was, I entered a quote ' in the group description and get an error in the sql query, line 115:my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC) VALUES " & _
"('" & Request.Form("GroupName") & "', '" & Request.Form("GroupDesc") & "')") I added chkString to the sql query to make it look like this:my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC,AUTOJOIN,MEM_HIDE,MOD_HIDE) VALUES " & _
"('" & chkString(Request.Form("GroupName"),"SQLString") & "', '" & chkString(Request.Form("GroupDesc"),"SQLString") & "')")
- Last problem was the check boxes were not staying checked when I created a new group. Someone mentioned that here before. What I did was updated the database with the options, when the group name and description was beig updated. After line 114, I added the following code:intAJ = 0
intModH = 0
intMemH = 0
if Request.Form("GroupAutoJoin") = "on" then intAJ = 1
if Request.Form("MemHideGroup") = "on" then intMemH = 1
if Request.Form("ModHideGroup") = "on" then intModH = 1
Then I changed the sql query on line 122 from this:my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC,AUTOJOIN,MEM_HIDE,MOD_HIDE) VALUES " & _
"('" & chkString(Request.Form("GroupName"),"SQLString") & "', '" & chkString(Request.Form("GroupDesc"),"SQLString") & "')") to this:my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC,AUTOJOIN,MEM_HIDE,MOD_HIDE) VALUES " & _
"('" & chkString(Request.Form("GroupName"),"SQLString") & "', '" & chkString(Request.Form("GroupDesc"),"SQLString") & "', " & intAJ & ", " & intMemH & ", " & intModH & ")")
That's it. (for now) |
Support Snitz Forums
|
Edited by - Davio on 24 November 2003 12:54:35 |
|
|
DavidRhodes
Senior Member
United Kingdom
1222 Posts |
Posted - 22 November 2003 : 09:49:44
|
quote: Originally posted by Davio
David, i got that error in the beta 1 version of the mod. The changes you made, by adding a check for EOF, is correct. The green code you highlighted won't be executed because blnAM = 0.
Are you sure, in my scenario I think blnAM should be 1.
strSql = "SELECT MEMBER_ID, FORUM_ID FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE FORUM_ID = " & cLng(fForum_ID)
strSql = strSql & " AND MEMBER_ID = " & cLng(fMemberID)
Set rsAllowedMember = Server.CreateObject("ADODB.Recordset")
rsAllowedMember.open strSql, my_Conn
blnAM = 0
if not rsAllowedMember.bof and not rsAllowedMember.eof then blnAM = 1
rsAllowedMember.close
set rsAllowedMember = nothing blnAM is set to 1 if the member is an allowed member of the forum.
Strange thing is, Scenario 1: there are 3 admins (inc me), I am not in the allowed member list, they are, but we can all see the forum anyway because we are admins. I don't get the error but the other 2 do.
Scenario 2: Same forum, all removed from the allowed member list, all of us get the error.
I tried adding the extra BOF check but that didn't work
|
The UK MkIVs Forum |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 22 November 2003 : 10:59:07
|
Kent, you don't need to use deny. The MOD is intended to work in conjunction with Allowed User forums. Just make those forums Allowed User forums and make the "premium" usergroups' permission Allow for those groups. |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
richfed
Average Member
United States
999 Posts |
Posted - 22 November 2003 : 16:00:13
|
Excellent ReadMe format, Nikkol ...
One glitch, I think, in the register.asp section ... 2 changes, yes? There appears to be a redundant/mixed-up box of code in that section [on the readme file]. I muddled through that. I think it's working.
Another thing, and this must have been me ... I must have spaced out while coding this thing, but for the life of my I could swear that the code on pop_profile.asp was already there!!! I don't rememember adding it; went to do so, and there it was!
----> EDIT: Used your file! Oooops!
Anyway, thanks for the MOD. |
Rich [size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1] |
Edited by - richfed on 22 November 2003 16:08:34 |
|
|
Kent
Junior Member
United States
193 Posts |
Posted - 22 November 2003 : 16:17:36
|
Nikkol,
I'm not getting an option for Allow for the premium usergroup (or the default one either) -- only Do Not Set, Read-Only, and Deny... |
|
|
DavidRhodes
Senior Member
United Kingdom
1222 Posts |
Posted - 22 November 2003 : 17:50:39
|
richfed, Yeah you're right, forgot to mention that, there is a stray code box in the read me file
Kent, You need to set the forum to Allowed Member List to use the UserGroups as they are intended. |
The UK MkIVs Forum |
|
|
Kent
Junior Member
United States
193 Posts |
Posted - 22 November 2003 : 19:26:34
|
Doh! Once I saved the setting for Allowed Member List, I could see the option for Allow....
Thanks, David! |
|
|
richfed
Average Member
United States
999 Posts |
Posted - 22 November 2003 : 19:39:44
|
quote: Originally posted by Davio
3 problems I encountered in the admin_usergroups.asp file (all lines have been shortened to not make this topic too wide): - I got that error on line 117, in regards to the LIMIT in the sql query. As Rui pointed out this is a MySQL specific keyword. Using TopSQL function was suggested and I changed line 117 from this:set rsGroup = my_conn.execute("SELECT USERGROUP_ID FROM " & strTablePrefix & "USERGROUPS ORDER BY USERGROUP_ID DESC LIMIT 0,1") to this:set rsGroup = my_conn.execute(TopSQL("SELECT USERGROUP_ID FROM " & strTablePrefix & "USERGROUPS ORDER BY USERGROUP_ID DESC;",1))
- The other problem was, I entered a quote ' in the group description and get an error in the sql query, line 115:my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC) VALUES & _
('" & Request.Form("GroupName") & "', '" & Request.Form("GroupDesc") & "')") I added chkString to the sql query to make it look like this:my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC,AUTOJOIN,MEM_HIDE,MOD_HIDE) VALUES & _
('" & chkString(Request.Form("GroupName"),"SQLString") & "', '" & chkString(Request.Form("GroupDesc"),"SQLString") & "')")
- Last problem was the check boxes were not staying checked when I created a new group. Someone mentioned that here before. What I did was updated the database with the options, when the group name and description was beig updated. After line 114, I added the following code:intAJ = 0
intModH = 0
intMemH = 0
if Request.Form("GroupAutoJoin") = "on" then intAJ = 1
if Request.Form("MemHideGroup") = "on" then intMemH = 1
if Request.Form("ModHideGroup") = "on" then intModH = 1
Then I changed the sql query on line 122 from this:my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC,AUTOJOIN,MEM_HIDE,MOD_HIDE) VALUES & _
('" & chkString(Request.Form("GroupName"),"SQLString") & "', '" & chkString(Request.Form("GroupDesc"),"SQLString") & "')") to this:my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC,AUTOJOIN,MEM_HIDE,MOD_HIDE) VALUES & _
('" & chkString(Request.Form("GroupName"),"SQLString") & "', '" & chkString(Request.Form("GroupDesc"),"SQLString") & "', " & intAJ & ", " & intMemH & ", " & intModH & ")")
This MOD will take some getting used to. I tried to set-up a group and encountered the line 115 error Davio mentions. Tried your fix and received a syntax error. Ought not the "& _" in there be eliminated? It did work after I removed that.
By the way, the tables installed flawlessly on MS-SQL Server, and I didn't notice any MOD conflicts in the coding process - I don't have every MOD, but I have installed a great deal of them on my forum. Haven't gotten too deeply into actually using the MOD yet, but I did access all the asp pages involved and all seems well.
Very useful MOD, as soon as I can figure it all out! |
Rich [size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1] |
|
|
vmplanet
Junior Member
112 Posts |
Posted - 23 November 2003 : 12:53:53
|
Just a small question. I have a very active forum and the forum is working perfect. I also have Usergroup 1.0 Beta on it. Now i see there is a Beta 2. Is it wise to update? The usergroup i use now is without any error. I have a forum on mysql. |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 24 November 2003 : 12:52:43
|
Richfed, I put those & _ in to shorten the long lines in my post. |
Support Snitz Forums
|
|
|
Kent
Junior Member
United States
193 Posts |
Posted - 28 November 2003 : 23:26:50
|
David,
Have you made any progress on that function to control other pages?
I've tried several things, hacking (since I'm not a programmer), and had no luck....
I was thinking of a simple include page (that could be used to "protect" any page) that performed the check, and redirected if the member is not allowed, but I can't even get that to work...
I don't need anything elaborate... I just need something that I can use...
TIA Kent |
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 01 December 2003 : 14:15:27
|
vmplanet,
If you are not seeing any problems, do not upgrade. There were no security related issues adressed in this, it is mearly what you have already done (applied all the fixes in this thread) |
Reinsnitz (Mike) |
|
|
wizard
Junior Member
208 Posts |
Posted - 02 December 2003 : 08:53:01
|
OK. Just got a chance to try this out. I'm on SQL Server. The db setup works fine. I got confused by the mix up in the readme though but got that figured out. One thing is the config.asp whereby a conn string was added. I skipped that one as it seems for MySQL. Hope that wouldn't affect anything.
Everything seem fine. But I had some encounters:
(1) Under inc_profile.asp, if admin allowed members is installed, the usergroup code goes after it and not before it. Mine doesn't work if it was added before. The show before/after code in the readme file didn't show the extra admin allowed stuff even though some of the other codings did.
(2) Is there a script to help move all users to a usergroup? I tried moving all to a usergroup and my com hang. Later I tried one section by section and I noticed the following:
- All users with the character "~" didn't got moved over by some weird reason. - I could only move about half. Then no matter what I do, adding it, saving, etc. The changes would not be recorded. Changes to options are saved. But not changes to the list of members. Upon moving, the 2 list are updated but somehow it dosn't get saved.
(3) I get the following error when I add a new usergroup in admin but the changes is still saved anyway:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near 'LIMIT'.
/admin_usergroups.asp, line 117
(4) A confirmation when del the usergroups would be good.
Anyway, this is a great MOD!
|
|
|
Topic |
|
|
|