Template Access Restriction Overview
Posted: 30 January 2007 11:01 AM   [ Ignore ]  
Research Assistant
RankRankRank
Total Posts:  360
Joined  06-09-2006

Hi,

It would be great if I could get an overview of all the access restrictions set on my different templates. Now I have to click the Access link on all my seperate templates or I can make settings to multiple templates. But I get no overview. I find that rather uncomforting.

Is there maybe some kind of plugin or extension that can do such a thing. I’m only looking for somthing like:

Template Name | Can View
———————————————-
index | All
about | Members, Guests
peronal | members
etc…

Thanks!

Profile
 
 
Posted: 30 January 2007 11:13 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32775
Joined  05-14-2004

Have you checked the “Template Preferences Manager”? That lets you mass-change access restrictions.  You could probably get an overview with some queries as well, something akin to the cheat sheet.

 Signature 
Profile
MSG
 
 
Posted: 30 January 2007 11:45 AM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Due to the way the data is stored (the member groups NOT allowed to view the template is stored), i can’t quickly see a way to get the data out that you wanted, however you could try this in the query tab:

SELECT CONCAT_WS('/',tg.group_name,t.template_name) AS 'Template Name', GROUP_CONCAT(mg.group_title) AS 'Cannot view' FROM exp_template_groups AS tg LEFT JOIN exp_templates AS t ON t.group_id = tg.group_id LEFT JOIN exp_template_no_access AS tn ON tn.template_id = t.template_id LEFT JOIN exp_member_groups AS mg ON mg.group_id = tn.member_group WHERE tn.template_id != '' GROUP BY t.template_id

Which will give you the templates that have access restrictions, and the groups that cannot view them.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 31 January 2007 03:49 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
RankRankRank
Total Posts:  360
Joined  06-09-2006

This should do the trick. It is what I need. The query string is great! Couldn’t have done it myself big surprise

I tried to stick the query in the cheat sheet. But I’m not getting the right results. Probably because it’s a complicated query. Maybe I have to use php instead of the EE query module. I’ll figure it out.

Thanks a lot!

Profile
 
 
Posted: 31 January 2007 05:02 AM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

replace ‘Template Name’ with just template_name, and ‘Cannot View’ with cannot_view.  The variables in the query module should then just be {template_name} and {cannot_view}.  :D

example code

{exp:query sql="as above"}
{template_name}
- {cannot_view}
{
/exp:query}

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 31 January 2007 05:24 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
RankRankRank
Total Posts:  360
Joined  06-09-2006

Bingo! Thanks a million butch!!!!!

Profile
 
 
Posted: 05 February 2007 07:28 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  134
Joined  08-23-2006

A “reset to default” button would be handy as well for that page!

Thanks for the query script, I´m sure I will use it.

 Signature 

Currently running EE 1.6.4 Build: 20080808

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64551 Total Logged-in Users: 32
Total Topics: 81154 Total Anonymous Users: 20
Total Replies: 436583 Total Guests: 186
Total Posts: 517737    
Members ( View Memberlist )