CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Smarty Variable Modifiers / Overrides to address template permission issues
Pages: [1]

Author Topic: Smarty Variable Modifiers / Overrides to address template permission issues  (Read 794 times)

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Smarty Variable Modifiers / Overrides to address template permission issues
February 28, 2013, 10:22:13 am
There are many issues raised in the forums with the template_c directory and permissions.  There are probably many reasons for this, civicrm is called by different users (ie drush and apache/PHP, backups, etc.)  My config relies on shared group writes.  I noticed the template directory umask is different than most other files and found this which makes it readable for groups:
 /**
     * default file permissions
     *
     * @var integer
     */
    var $_file_perms           = 0644;
in /packages/Smarty/Smarty.class.php

Is there an easy way to override all smarty permissions (short of extension / hook?)  Ideally overriding them in civicrm.settings.php .... There are probably other things people want to override ...

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Smarty Variable Modifiers / Overrides to address template permission issues
February 28, 2013, 10:55:52 am

1. Should probably be done with a setting in the db rather than a constant in civicrm.settings.php (we've been moving away from that for some time). Eileen has done a fair bit of work in 4.3 to make adding a setting fairly easy. We probably want to cache this setting in the config object since this is used for pretty much all civi pages

2. Once we have a setting with a default value of (0644), you can patch the code in CRM/Core/Smarty.php to override the default _file_perms

This is a really nice simple project and would make a good addition to 4.4

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Smarty Variable Modifiers / Overrides to address template permission issues
February 28, 2013, 11:39:39 am
I have done 2. for now - I found many posts about the template permissions (ie $_file_perms ) - wonder if that one merits special attention or at least documentation.  I can write something if you can suggest the best place (or perhaps this is it!).

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Smarty Variable Modifiers / Overrides to address template permission issues
February 28, 2013, 04:47:56 pm

For sure documentation to allow users to avoid that error is great

I would check the wiki and see if there is a section on "common problems" etc. Also maybe a "tip" on the install / upgrade pages

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Smarty Variable Modifiers / Overrides to address template permission issues

This forum was archived on 2017-11-26.