The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Creating a user and forum; setting permissions
I'm working on a script that hooks into the vB framework and from submitting one form, it creates a new user, a new forum, and gives permission to only that user to view/post in the new forum. Basically, we want our customers to have "private" forums that only them and staff can see & use.
I can create/set these things (user, forum, permissions, access mask) manually and it works just like I want it to, but when trying to do it all in one shot using my script, something's not getting done. First, I'm creating a user - no problem. Looking at the user in the admin cp, everything's perfect. Next, I'm creating a forum named after a custom field from the new user's profile (company name). Looking at the forum in the admin cp, everything's perfect. Then I set the group permissions on the forum. I looked at forumpermission.php and basically copied the routine for setting all the groups to 'deny', but I'm excluding the admins, mods and superusers. Looking at the permissions in the admin cp, everything's perfect. Finally, I set the access mask. For this I'm just inserting a row into the 'access' table, setting the fields as userid=$newuserid, forumid=$newforumid and accessmask=1. Looking at the mask in the admin cp, everything's perfect. Now... when I load the vB home page in a different browser (I use Firefox normally, I use IE for testing so there are no cookie issues), I can see the forum I just created. I'm viewing the site as a guest - not logged in at all - and I also can't see the customer forums I set up manually (as it should be). So something's not being done. Every setting is correct, according to what can be viewed in the admin cp, yet guests and other customers are still able to see the forum that they shouldn't be able to view. I'm pretty sure the problem is in the section that's setting up the group permissions. Here's the code I'm using for that, plus the code for setting the access mask: PHP Code:
Any suggestions? Before I go digging through a lot of vB code that I'm not too likely to understand very well (I have very little OOP experience), I'm hoping that someone can say "I see the problem, you're not doing <insert simple thing here>!". If anyone wants to see more of the script, or even the whole thing, just let me know. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|