View Full Version : Re-usable custom Permission Sets-Will pay if needed
ladyfyre
08-05-2002, 06:11 PM
Ok....this is a hack i think MANY admins here would LOVE to see created.
For those of us who have a large number of forums, and a tendency to add new ones frequently at the request of users...this would be a god-send.
I am think of a simple addition of a new table to store re-usable persmission sets. For example, our forums are grouped by Cities which serve as categories...but the subforums are often the same. Every time i add a new city, i have to spend large amounts of time setting the permissions for each forum...as different forums have different permissions for various usergroups.
It would be GREAT if I could instead set up once the usergroup permissions for one TYPE of forum, and then upon creation of it, have a drop down menu listing forum permission types or "Manual Edit", if it is does not fit any of them.
With over 280 forums, and over 30 usergroups....setting permissions is taking up WAYYYY too much of my time.
As always, if no one else sees the benefit in providing this hack based on how useful it would be....i can and will pay for someone to create it for me.
Logician
08-05-2002, 07:49 PM
1- Create your new forum in your Admin CP and note it's forum id (do NOT APPLY any permissions to your new forum after you created it)
2- Find the forum you want to apply(inherit) its permissions, note its forum id too.
3- Put this script into your Admin dir and call it like this
http://yoururl/board/admin/forumper.php?fromid=X&toid=Y
Replace X with the forumid of your existing forum whose permissions will be inherited and Y with the forumid of your new forum.
The script will handle the rest.. ;)
I know it's crude, but who needs "attractive user interface" anyway, it works.. I recommend applying it to your test board before you use it and backup your db just in case..
ladyfyre
08-05-2002, 08:07 PM
TY TY TY Logician...am heading out to test it now.
Question: If I decide for some reason to change a usergroup's access or something, and wanted to apply it to all forums of that type, will this hack work even if the forum's permissions have already been set? In other words, can it be used to update as well as set???
Logician
08-05-2002, 08:24 PM
Originally posted by ladyfyre
Question: If I decide for some reason to change a usergroup's access or something, and wanted to apply it to all forums of that type, will this hack work even if the forum's permissions have already been set? In other words, can it be used to update as well as set???
well I didnt design it to make updates but it's not hard to adapt anyway. Copy the content of the script to another script with a different name and add line:
$DB_site->query("DELETE * from forumpermission WHERE forumid='".$toid."'");
before
$permission=$DB_site->query("SELECT usergroupid,canview, cansearch, canemail, canpostnew, canmove, canopenclose, candeletethread, canreplyown, canreplyothers, canviewothers, caneditpost, candeletepost, canpostattachment, canpostpoll, canvote, cangetattachment FROM forumpermission WHERE forumid='".$fromid."'");
now when you call the script it will first delete the entire permissions for target (toid) forum and recreate them according to parent (fromid) forum..
Please do not apply this change to forumper.php, apply it to the second script you copy/pasted form forumper.php. Use forumper.php to copy permissions for a new forum and use the second script to update permissions for an existing forum..
I Hope it's clear.. :classic:
ladyfyre
08-06-2002, 05:23 AM
crystal clear :)
thanks a bunch.....it works like a charm :)
If I get the interface for it completed to make it all pretty, I will post it here for ya so you can release it if you want.
Logician
08-06-2002, 05:47 AM
Originally posted by ladyfyre
crystal clear :)
thanks a bunch.....it works like a charm :)
If I get the interface for it completed to make it all pretty, I will post it here for ya so you can release it if you want.
I prefer not to release hacks which I dont personally use/tested a long time so I'm not inclined to release it. But if you think it's appealing to others (which I doubt btw. :D ), you have my permission to release it.. :)
ladyfyre
08-06-2002, 05:53 AM
In that case, I guess once I have it all wrapped up I will do so, giving you full credit of course....
because I think MANY could stand to benefit from it...and because frankly, as large as my site is, if there was a bug in it's functionality, it would not take long at all for it to have popped up. But in the last several hours since it was installed, over 50,000 page views have occured in the areas it effected, and not one person has had a problem or sent in a help desk ticket....so it's definitely doing what it should be :)
neocorteqz
10-01-2002, 10:26 AM
Originally posted by Logician
well I didnt design it to make updates but it's not hard to adapt anyway. Copy the content of the script to another script with a different name and add line:
$DB_site->query("DELETE * from forumpermission WHERE forumid='".$toid."'");
before
$permission=$DB_site->query("SELECT usergroupid,canview, cansearch, canemail, canpostnew, canmove, canopenclose, candeletethread, canreplyown, canreplyothers, canviewothers, caneditpost, candeletepost, canpostattachment, canpostpoll, canvote, cangetattachment FROM forumpermission WHERE forumid='".$fromid."'");
now when you call the script it will first delete the entire permissions for target (toid) forum and recreate them according to parent (fromid) forum..
Please do not apply this change to forumper.php, apply it to the second script you copy/pasted form forumper.php. Use forumper.php to copy permissions for a new forum and use the second script to update permissions for an existing forum..
I Hope it's clear.. :classic:
I made a second file like you said. called up the script and got this error..
Invalid SQL: DELETE * from forumpermission WHERE forumid='12'
mysql error: You have an error in your SQL syntax near '* from forumpermission WHERE forumid='12'' at line 1
Logician
10-01-2002, 03:46 PM
My mistake..
The line
$DB_site->query("DELETE * from forumpermission WHERE forumid='".$toid."'");
should be:
$DB_site->query("DELETE from forumpermission WHERE forumid='".$toid."'");
neocorteqz
10-02-2002, 10:13 AM
thanks:) I'm such a n00b:p It told me exactly where the error was, and I didn't even know it.:D
Chris M
10-21-2002, 10:33 AM
I have 2 working versions if anyone wants them...
Satan
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.