potential showstopping error with using phptemplate overrides?
Dublin Drupaller - January 24, 2005 - 11:18
| Project: | PHPTemplate |
| Version: | 4.5.x-1.x-dev |
| Component: | Template Defaults |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi,
Have been playing with PHP template and while it is great, I just thought I'd flag a problem I experienced that isn't made clear in the handbook...i.e. when you override theme_functions in drupal using php template...it ignores the user_access flags set in USER-CONFIGURE-PERMISSIONS.
I haven't as yet got a workaround for this. Thought I'd flag it anyway as it is a bit of a showstopper if you have logged-in-user-only info on your drupal site.
Anyone else experienced this?
Anyone know if it is as simple as pasting a PHP check_user_access script in the override.tlp.php file or is it a matter of hacking the phptemplate engine?
cheers
Dub

#1
addendum..
any php experts out there help with giving phptemplate the once over?
Am guessing if someting as basic as checking user access has slipped through there maybe other basic functions that have been overlooked with the php template engine.
Thanks in advance for any help...
Dub
#2
I am not sure what you mean here ?
If you mean someone with direct access to your source files for the site can comprimise your site security, I can assure you that has nothing to do with phptemplate.
Also , it is not the theme code's responsibility to check user permissions, that has to be done by the programmer before the theme() function is executed.
#3
I wonder if this is related to a problem I am having. Currently I am overiding several theme functions with callbacks in my template.php file. It works great for everyone: anonymous users and logged in user, except for me. I am the admin user. You know, the first user who creates an account for my drupal site. And when I am logged in none of the over-rides I have in the template.php file are taking affect. Everything just looks like it's default appearance. Now my node.tpl.php and page.tpl.php files are working, but not the custom ones? Is this related, and is this even a PHPTemplate problem, or is it a problem with my files???? And yeah, I am using 4.5 and the latest public release of PHPTemplate, not CVS or anything.
peace
#4
Hi Bryan,
I didn't have the same problem when using phptemplate overrides.
Something that might be worth trying (and is just a guess) would be to edit your own account (site administrator) and enable the "highest" role available and see if that gets around the problem.
It might not..but it won't take long to test.
The logic/guess is based on the notion that its seems to be only difference between what you are doing and what I'm doing ..i.e. I have created an "Site Admin" role that allows others on a team to have certain privilages and am using the role name as a "key" to determine certain blocks & overrides. See example below.
<?phpglobal $user;
if (in_array('Site Admin',$user->roles)) { output goes here
}
?>
It's a long shot and a guess..but maybe worth trying....
Dub