[21/01/07] Page Permissions

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
24
80%
Very Good
4
13%
Good
1
3%
Fair
1
3%
Poor
0
No votes
 
Total votes: 30

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [21/01/07] Page Permissions

Post by drathbun »

This is not intended to be insulting, but are you absolutely sure you made the edits to includes/functions.php correctly? If you missed that, the page permissions module will never be called, and nothing will happen.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

debbuxton
Registered User
Posts: 9
Joined: Thu Dec 22, 2005 1:32 am

Re: [21/01/07] Page Permissions

Post by debbuxton »

Not insulting at all. I had double-checked last night that step also, but went ahead and triple-checked. It was in there.

I have decided I must have a conflict with another mod as users started having some posting issues. I have had to disable this for now and maybe will come back to it later.

Thanks anyway for the help!

deb

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [21/01/07] Page Permissions

Post by drathbun »

What was the other MOD, and can you provide details about what the posting issues are?

This MOD was designed to be as unobtrusive as possible. There are very few edits to the core code, and most of the logic is self-contained within the one included file. You really have my curiousity up now. :)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [21/01/07] Page Permissions

Post by drathbun »

I have no idea what the timeframe is, but I have started a topic in the DEV forum called Page Permissions II. If you have any feature requests or suggestions please drop in and share your ideas. I only have one primary new feature at the moment and that is to be able to support pages outside of $phpbb_root_path. If there is anything else, please drop me a line in the DEV topic. Thanks. :geek:
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

debbuxton
Registered User
Posts: 9
Joined: Thu Dec 22, 2005 1:32 am

Re: [21/01/07] Page Permissions

Post by debbuxton »

Hey there,

I may try again to install the mod now that I have cleaned everything out again.

I know of these mods:
topic display order *this one as I recall makes a lot of changes in viewforum.php
Multiple BBCode MOD
EasyMOD
DB Maintenance

Will let you know how things go a second time if I get a chance.

deb

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [21/01/07] Page Permissions

Post by drathbun »

Let me know if I can help, please. I have not had any reports exactly like this so I would like to know what the issue(s) might be. With proper permission from you, of course, I can try logging in to your server to help debug. If you want to take that approach please PM me. No pressure, just making the offer.

I am particularly interested to find out if there is some sort of conflict that I can address since I am starting to plan out ideas for Version 2 of this MOD. :)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

ilovephp_123
Registered User
Posts: 14
Joined: Sat Jul 28, 2007 4:47 am

Re: [21/01/07] Page Permissions

Post by ilovephp_123 »

Hi this sounds like a great mod! I would really like to use it, except I'm pretty much a "noob" and I'm not quite sure how to install it. I tried using easymod, but it says this each time:
1 Warning(s) reported by the SQL Parser

1. Identifier "key" is a reserved keyword (reference: SQL 99), statement: 1, table: "phpbb_pages"
Also, I tried doing it manually but like I said I'm a noob and I dont quite understand this part.

Code: Select all

#-----[ SQL ]-------------------------------------
# Special Instructions: Change phpbb_ to whatever your table
# prefix is.
#
CREATE TABLE phpbb_pages
(page_id		mediumint(5) unsigned not null auto_increment
,page_name		varchar(32) not null
,page_parm_name		varchar(32) default ''
,page_parm_value	varchar(32) default ''
,page_key		varchar(255) default ''
,member_views		int(11) unsigned default 0
,guest_views		int(11) unsigned default 0
,disable_page		tinyint(1) unsigned default 0
,auth_level		tinyint(2) unsigned default 0
,min_post_count		mediumint(8) unsigned default 0
,max_post_count		mediumint(8) unsigned default 0
,group_list		varchar(255) default ''
,disabled_message	varchar(255) default ''
,primary key (page_id)
,unique key (page_key)
);



#
#-----[ SQL ]-------------------------------------
# Special Instructions: Page extentions are set to php; if you
# use php3 (or other) change these statements or update the
# rows via the ACP module. Check the table prefix as well.
#
insert into phpbb_pages (page_name, page_key) values ('index.php', 'index.php');
insert into phpbb_pages (page_name, page_key) values ('viewforum.php', 'viewforum.php');
insert into phpbb_pages (page_name, page_key) values ('viewtopic.php', 'viewtopic.php');
insert into phpbb_pages (page_name, page_key) values ('faq.php', 'faq.php');
insert into phpbb_pages (page_name, page_key) values ('search.php', 'search.php');
insert into phpbb_pages (page_name, page_key) values ('login.php', 'login.php');
insert into phpbb_pages (page_name, page_key, auth_level) values ('memberlist.php', 'memberlist.php', 1);
insert into phpbb_pages (page_name, page_key, page_parm_name, page_parm_value, auth_level) values ('profile.php', 'profile.php?mode=viewprofile', 'mode', 'viewprofile', 1);
insert into phpbb_pages (page_name, page_key, page_parm_name, page_parm_value) values ('profile.php', 'profile.php?mode=register', 'mode', 'register');
Sorry if you get this question a lot. Any help would be greatly appreciated, and thanks ahead of time! :mrgreen:

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [21/01/07] Page Permissions

Post by drathbun »

It says "warning" rather than "error", does that mean it failed to install?

For the record, I don't use EasyMOD, so I can't comment on it. But from what I understand EM is used to install MODs during the validation process. So it should work.

If you can't get it to work via that route, you will need some way to run the SQL code manually. You would need to first confirm what your table prefix is. That information is stored in your config.php file. Don't post that file here, it contains your database password. Just look at the file, and find this line:

Code: Select all

$table_prefix = "phpbb_";
If your line looks just like that, you're fine. If you have something other than phpbb_ as your table prefix, then you need to edit the SQL part and replace every phpbb_ with whatever you have in your config file.

Finally, you need to be able to run that query. If you have a control panel (CPanel or otherwise) it will often have a link to something called phpMyAdmin. If not, you might need to ask your host for help in running the queries associated with this MOD.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

User avatar
Starbuck
Registered User
Posts: 183
Joined: Fri Aug 01, 2003 3:26 am

Re: [21/01/07] Page Permissions

Post by Starbuck »

as requested, I am posting here to see why this mod doesn't seem to want to install with EasyMOD.

Here are the two errors that are given afte clicking process.
CRITICAL ERROR
COPY FAILED: The target file to be copied [./mods/permission/root/templates/subSilver/admin/page_permissions_list_body.tpl] could not be found.
copy root/templates/subSilver/admin/page_permissions_list_body.tpl to templates/subSilver/admin/page_permissions_list_body.tpl
MOD script line #236 :: FAQ :: Report
Then the following:
Critical Error

COPY FAILED: The target file to be copied [./mods/permission/root/templates/subSilver/admin/page_permissions_edit_body.tpl] could not be found.
copy root/templates/subSilver/admin/page_permissions_edit_body.tpl to templates/subSilver/admin/page_permissions_edit_body.tpl
MOD script line #236 :: FAQ :: Report
Reading the error response it seemed that simply copying the two stated files to the location shown would fix it. Sadly it didn't. Not sure why.

It said in the block below that it only processed two commands. here they are:
SQL #195
CREATE TABLE phpbb_pages
(page_id mediumint(5) unsigned not null auto_increment
,page_name varchar(32) not null
,page_parm_name varchar(32) default ''
,page_parm_value varchar(32) default ''
,page_key varchar(255) default ''
,member_views int(11) unsigned default 0
,guest_views int(11) unsigned default 0
,disable_page tinyint(1) unsigned default 0
,auth_level tinyint(2) unsigned default 0
,min_post_count mediumint(8) unsigned default 0
,max_post_count mediumint(8) unsigned default 0
,group_list varchar(255) default ''
,disabled_message varchar(255) default ''
,primary key (page_id)
,unique key (page_key)
);




SQL #220
insert into phpbb_pages (page_name, page_key) values ('index.php', 'index.php');
insert into phpbb_pages (page_name, page_key) values ('viewforum.php', 'viewforum.php');
insert into phpbb_pages (page_name, page_key) values ('viewtopic.php', 'viewtopic.php');
insert into phpbb_pages (page_name, page_key) values ('faq.php', 'faq.php');
insert into phpbb_pages (page_name, page_key) values ('search.php', 'search.php');
insert into phpbb_pages (page_name, page_key) values ('login.php', 'login.php');
insert into phpbb_pages (page_name, page_key, auth_level) values ('memberlist.php', 'memberlist.php', 1);
insert into phpbb_pages (page_name, page_key, page_parm_name, page_parm_value, auth_level) values ('profile.php', 'profile.php?mode=viewprofile', 'mode', 'viewprofile', 1);
insert into phpbb_pages (page_name, page_key, page_parm_name, page_parm_value) values ('profile.php', 'profile.php?mode=register', 'mode', 'register');
Any thoughts on what happened & why?

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [21/01/07] Page Permissions

Post by drathbun »

Starbuck wrote:Reading the error response it seemed that simply copying the two stated files to the location shown would fix it. Sadly it didn't. Not sure why.
What was the result after doing the copy manually?

This MOD is really quite simple to install. There are only a few file edits, everything else is SQL or COPY commands. If the edits have been done, please try uploading all of the files into their proper folders manually.
It said in the block below that it only processed two commands. here they are:
SQL #195
CREATE TABLE phpbb_pages
(page_id mediumint(5) unsigned not null auto_increment
,page_name varchar(32) not null
,page_parm_name varchar(32) default ''
,page_parm_value varchar(32) default ''
,page_key varchar(255) default ''
,member_views int(11) unsigned default 0
,guest_views int(11) unsigned default 0
,disable_page tinyint(1) unsigned default 0
,auth_level tinyint(2) unsigned default 0
,min_post_count mediumint(8) unsigned default 0
,max_post_count mediumint(8) unsigned default 0
,group_list varchar(255) default ''
,disabled_message varchar(255) default ''
,primary key (page_id)
,unique key (page_key)
);




SQL #220
insert into phpbb_pages (page_name, page_key) values ('index.php', 'index.php');
insert into phpbb_pages (page_name, page_key) values ('viewforum.php', 'viewforum.php');
insert into phpbb_pages (page_name, page_key) values ('viewtopic.php', 'viewtopic.php');
insert into phpbb_pages (page_name, page_key) values ('faq.php', 'faq.php');
insert into phpbb_pages (page_name, page_key) values ('search.php', 'search.php');
insert into phpbb_pages (page_name, page_key) values ('login.php', 'login.php');
insert into phpbb_pages (page_name, page_key, auth_level) values ('memberlist.php', 'memberlist.php', 1);
insert into phpbb_pages (page_name, page_key, page_parm_name, page_parm_value, auth_level) values ('profile.php', 'profile.php?mode=viewprofile', 'mode', 'viewprofile', 1);
insert into phpbb_pages (page_name, page_key, page_parm_name, page_parm_value) values ('profile.php', 'profile.php?mode=register', 'mode', 'register');
Any thoughts on what happened & why?
Those are two commands, so I assume it's ok. :) There are multiple SQL statements in the second SQL instruction, so perhaps EasyMOD is treating it as one large command.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

hungrywolf
Registered User
Posts: 11
Joined: Mon Oct 01, 2007 5:18 am

Re: [21/01/07] Page Permissions

Post by hungrywolf »

Hi,

Sorry for having a very nooby question but I installed the mod with EasyMod and it installed perfectly.

How do I now add further pages? The other pages that are already added in the Page Permissions in the work fine. I tried adding a page "viewtopic.php?t=687" (for example) and set the permission to "Registered" but still anyone seems to access that page.

Also, the custom message doesn't seem to be displayed even though I have specified them.

Any ideas?

Thanks for a great mod idea !

Regards,

hungrywolf
Registered User
Posts: 11
Joined: Mon Oct 01, 2007 5:18 am

Re: [21/01/07] Page Permissions

Post by hungrywolf »

Sorry, I figured out how to add the page correctly and it work now perfectly.

Also, I realized that the custom messages were only for disabled pages.

If we could have custom messages for all types of access control, that would be great !

Thanks for a GREAT Mod !

Regards,

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [21/01/07] Page Permissions

Post by drathbun »

hungrywolf wrote:I realized that the custom messages were only for disabled pages.

If we could have custom messages for all types of access control, that would be great !
I'm not sure I get what you mean on this one...
Thanks for a GREAT Mod !
You're most welcome. 8-)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

gerike
Registered User
Posts: 1
Joined: Mon Oct 08, 2007 9:39 pm

Re: [21/01/07] Page Permissions

Post by gerike »

Lovely mod, but I am not a programmer... What I know about code you can put in your eye and it won't hurt. I am looking for something to restrict the member list to registered and above only... This MOD would do it, but I can't even begin to try to do what the instructions indicate... Is there an easier way?

hungrywolf
Registered User
Posts: 11
Joined: Mon Oct 01, 2007 5:18 am

Re: [21/01/07] Page Permissions

Post by hungrywolf »

drathbun wrote:
hungrywolf wrote:I realized that the custom messages were only for disabled pages.

If we could have custom messages for all types of access control, that would be great !
I'm not sure I get what you mean on this one...
I mean that you get a custom message only when your page is disabled.

What if you have an option that your Registered user needs at least 5 posts? I would have liked to have a custom message say "You can only access this topic if you are Registered and have made at least 5 posts" when that user clicks on the Topic.

Post Reply

Return to “[2.0.x] MOD Database Releases”