Support

Admin Tools

#13175 Block template=foo site template switch

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Monday, 06 August 2012 16:02 CDT

kush
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes
Have I searched the tickets before posting? Yes
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: 2.5.6
PHP version: 5.3.10
MySQL version: 14.14 Distrib 5.5.24
Host: Rackspace
Admin Tools version: 2.3.1

Description of my issue:

I assume that I'm missing something obvious here, but I still can't seem to figure it out after trying several times and searching the documentation/support tickets. I have "Block template=foo site template switch" set to "yes" and "Allow site templates" set to "no". Yet, I'm still able to load another existing template, for example, mysite.com/?template=atomic

What I do notice, is that without this option enabled, I get an error message from Joomla saying "The template for this display is not available. Please contact a Site administrator." -- IF -- I try to load a template that does not actually exist, (mysite.com?template=blah).

However, when I enable the option, instead of getting that error message, I am forwarded to my site's home page. So, Admin Tools IS doing something. But, I want to be able to disable the loading of all templates (whether they actually exist or not).

I've tried disabling sh404sef, and also tried turning off Joomla configuration SEF URLs and URL rewriting, but still I am able to load other templates. I've also tried this on my local machine (MAMP) running a fresh install of Joomla 2.5.6 and can't seem to get it to work at all (no forwarding, etc.). ::head scratch:: What am I doing wrong?

nicholas
Akeeba Staff
Manager
As per the documentation, go to Admin Tools, Web Application Firewall, Configure WAF and make sure the "Allow site templates" option is set to No. If it's set to "Yes" please read the documentation so that you understand why what you describe in your request actually happens.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

kush
Right. As I stated, I have "allow site templates" set to "no". I re-read the documentation anyway and still can't understand why it's not working. For what it's worth, I re-checked it in a fresh install of Joomla 2.5.6 on my local machine (MAMP), and it's behaving in the same way that it does on my live site.

Here is my setup:

Block tmpl=foo system template switch --- yes
List of allowed tmpl= keywords --- component,system,raw
Block template=foo site template switch --- yes
Allow site templates --- no

If I try to pull up a page with a non-existing template, ie: http://www.mysite.com/?template=xxx
- Admin Tools ignores the template line as expected, loads the page with the default template, and raises a security exception

If I try to pull up a page with a template that actually does exist, ie. http://www.mysite.com/?template=atomic
- Admin Tools does not ignore the template line, loads the page with the requested template, and does not raise a security exception

Sorry if I'm still missing something basic, as I did try extensively to figure this out on my own but still can't seem to get anywhere. Thanks.

nicholas
Akeeba Staff
Manager
You are right. It's not working as it should. There is a typo in line 602 of plugins/system/admintools/admintools/pro.php. It should read:
if(version_compare(JVERSION, '1.7.0', 'ge') && JRequest::getCmd('option','') == 'com_mailto') {

I have just uploaded a new dev release which includes this fix. Can you please install and verify that it works, please? Thank you in advance for your feedback!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

kush
I just installed the dev release and it now works! Thanks for the great component and support. Cheers.

nicholas
Akeeba Staff
Manager
Thank you for the heads up and the feedback!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!