[BETA] Deny Permission

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
LifeIsPain
Former Team Member
Posts: 2148
Joined: Tue Oct 01, 2002 7:04 am
Location: Way Way Behind

[BETA] Deny Permission

Post by LifeIsPain »

I wanted a way keep certain people from posting in private forums, but still have them listed in the Usergroup that allows a user to view the forum, or to stop a certain person from posting in a registered area, and there wasn't a way before. I have seen several requests for this as well, so I made my first non-trivial mod.

New: If you are the board admin and are in the group, use the first option of replace, and you won't be denied.

Code: Select all

##############################################################
## MOD Title: Deny Permsission
## MOD Author: LifeIsPain <brian@orvp.net> (Brian Evans)
## MOD Description: Adds an option to a users or groups permissions settings to deny them access
##        to a given setting. This will override any setting that would give them
##        permission to do that action. The folder permission level must be set to
##        Private / ACL for you to deny someone permission. Board Adminis will not be
##        denied rights of the group.
## MOD Version: 0.6.2
##
## Installation Level: easy
## Installation Time: 5 Minutes
## Files To Edit: includes/auth.php, language/lang_english/lang_admin.php, admin/admin_ug_auth.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes: NEW: Board Admins can be set not to be banned with the rest of the group. If you
##     need to be able to ban yourself (remember, any admin can unban himself) for some
##     reason, use the commands under [ OR ] for legacy support If you need to ban a
##     user from a setting normally for registered users, install Niels Chr. Denmark's
##     Auto Group mod as well.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
Download the code (1 file) here.
Last edited by LifeIsPain on Wed Jan 01, 2003 11:47 pm, edited 2 times in total.
LifeIsPain - one who needs to be smackedLife is pain, highness! Anyone who says differently is selling something.
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Nice one. Been hoping somebody would come up with this.
Defend the game:
Image
Stain
Registered User
Posts: 12
Joined: Tue Apr 09, 2002 11:01 pm
Contact:

Post by Stain »

Code: Select all

Parse error: parse error in /var/www/html/stain/language/lang_english/lang_admin.php on line 141

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/stain/language/lang_english/lang_admin.php:141) in /var/www/ html/stain/admin/index.php on line 581

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/stain/language/lang_english/lang_admin.php:141) in /var/www/ html/stain/admin/index.php on line 582
:(

phpBB 2.0.3 is installed, but I have installed a Banner code mod:

Code: Select all

// Start Banner Code 
ob_start();
require("menu.htm");
$banner = ob_get_contents();
ob_end_clean();
$template->assign_vars(array('BANNER' => $banner));
// End banner code
help? :)
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Looks like there is a wee buglet in the mod...

in lang_main.php
find

Code: Select all

$lang['Denied_Access'] = 'Denied Access;' // This is for Deny Permission Mod
replace with

Code: Select all

$lang['Denied_Access'] = 'Denied Access'; // This is for Deny Permission Mod
Defend the game:
Image
LifeIsPain
Former Team Member
Posts: 2148
Joined: Tue Oct 01, 2002 7:04 am
Location: Way Way Behind

Post by LifeIsPain »

/me scratches head

Huhm, yea, I remember when I had that error, but I had fixed it, and well, I guess I didn't get it fixed in this version here. Dope. Well, I fixed the online version now.

Oh, and it is lang_admin.php, not lang_main.php where this problem is. Just a bit of a difference.
LifeIsPain - one who needs to be smackedLife is pain, highness! Anyone who says differently is selling something.
LifeIsPain
Former Team Member
Posts: 2148
Joined: Tue Oct 01, 2002 7:04 am
Location: Way Way Behind

Post by LifeIsPain »

Ok, I am adding this as an extra note because now, I gave the way for a board admin not to be disallowed. I want to make an option for the group leader not to be disallowed, but I can't figure out how to do that for now, but if you are admin, well, you should be able to still do admin stuff.

So the current version is 0.6.2
LifeIsPain - one who needs to be smackedLife is pain, highness! Anyone who says differently is selling something.
kkks
Registered User
Posts: 50
Joined: Mon Jul 08, 2002 3:48 am
Location: Auckland, New Zealand
Contact:

Post by kkks »

This MOD looks good to me.
Just a question, can I use this MOD to deny one particular user from POSTING, but still able to VIEW and READ ?
SillyDog701: Netscape Browser Archive | Browser Version Guide | Message Centre | MacCentre701
MozInfo - Mozilla Information Centre
LifeIsPain
Former Team Member
Posts: 2148
Joined: Tue Oct 01, 2002 7:04 am
Location: Way Way Behind

Post by LifeIsPain »

Yes, this was my primary intent when I created the mod. Once again, I find this a very usefull addition to the Auto Group mod. You will need to create a Group for every user (more details can be found here) and then you will be able to deny that one user the ability to post.
LifeIsPain - one who needs to be smackedLife is pain, highness! Anyone who says differently is selling something.
kkks
Registered User
Posts: 50
Joined: Mon Jul 08, 2002 3:48 am
Location: Auckland, New Zealand
Contact:

Post by kkks »

Okay, it is just what I need.
I will install it once I clean out other stuffs.
SillyDog701: Netscape Browser Archive | Browser Version Guide | Message Centre | MacCentre701
MozInfo - Mozilla Information Centre
Jorden
Registered User
Posts: 1
Joined: Sat Mar 29, 2003 11:47 pm

Post by Jorden »

Can this MOD be set per forum, or will it override the ability to post in all forums at once?
LifeIsPain
Former Team Member
Posts: 2148
Joined: Tue Oct 01, 2002 7:04 am
Location: Way Way Behind

Post by LifeIsPain »

The pemissions layout of the board stays the same. So you will have to set each forum individually (so you would just be denying from one forum at a time)
LifeIsPain - one who needs to be smackedLife is pain, highness! Anyone who says differently is selling something.
User avatar
Carpe Diem
Registered User
Posts: 580
Joined: Tue Dec 10, 2002 11:19 pm

Post by Carpe Diem »

Hello Lifeispain!

Thank you for the mod. I was having a couple of questions here:

1. When you say "if you're an admin and are in the group, use the FIRST OPTION of replace".. do you mean the part that says:

Code: Select all

#
#-----[ OR ]------------------------------------------
#
switch($type)
{
	case AUTH_ACL:
		$result = $u_access[$j][$key];

	case AUTH_MOD:
		$result = $result | $u_access[$j]['auth_mod'];

	case AUTH_ADMIN:
		$result = $result | $is_admin;
		break;
}

$auth_user = $auth_user | $result;
Because if I understand you correctly, this would be the FIRST OPTION to the regular replace frase... am I correct?

Also, I have the junor admin mod installed (That is not the same as the super moderator mod or the extended super moderator mod); it can be found here.

My question is, since this mod is not integrated in the regular auth system like all/reg/mod/admin choices, is there still a way to also give a junior admin the same rights as a regular admin?

Thx a lot in advance!
LifeIsPain
Former Team Member
Posts: 2148
Joined: Tue Oct 01, 2002 7:04 am
Location: Way Way Behind

Post by LifeIsPain »

The first option would have been the part before the #---[ OR ]----- (now a depricated command) and is what should be used to stay in line with how the admin feature works. As far as Junior Admin, I briefly looked at the code, and you would be able to deny them access to a forum using this method.
LifeIsPain - one who needs to be smackedLife is pain, highness! Anyone who says differently is selling something.
User avatar
Carpe Diem
Registered User
Posts: 580
Joined: Tue Dec 10, 2002 11:19 pm

Post by Carpe Diem »

LifeIsPain wrote: The first option would have been the part before the #---[ OR ]----- (now a depricated command) and is what should be used to stay in line with how the admin feature works. As far as Junior Admin, I briefly looked at the code, and you would be able to deny them access to a forum using this method.


Thank you very much for your quick reply!
:)
Keito-kun
Registered User
Posts: 9
Joined: Fri Oct 10, 2003 2:44 pm
Location: Norway
Contact:

Post by Keito-kun »

When I installed this mod, I couldn't see any of my forums.
Do I have to config in the admin-panel before normal users can see the forums?
Post Reply

Return to “[2.0.x] MODs in Development”