Give administrator user group access to change the templates

Your code modifications and patches you want to share with others.
Locked
craion
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Mon Sep 11, 2006 2:23 pm
Location: Argentina
Contact:

Give administrator user group access to change the templates

Post by craion » Sat Jun 13, 2009 1:23 pm

This post explains how to give administrator user group access to change the templates of the site in Joomla 1.5.X.

GO TO

libraries/joomla/user/authorization.php

FIND THIS

//$this->addACL( 'com_templates', 'manage', 'user', 'administrator' )

REPLACE FOR THIS

/* MY ADDON */
$this->addACL( 'com_templates', 'manage', 'users', 'administrator' );
/* MY ADDON */

DONE!

NOTE: after hours of searching how to do this, I´ve found it and I am sharing it with the community. I don´t know if this works on other servers, or have task related to security, use this hack under your own risk and always backup first. I think you can edit other parts of the file to give different access levels.

E N J O Y

:D

dotcom22
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 214
Joined: Mon Nov 19, 2007 10:33 pm

Re: Give administrator user group access to change the templates

Post by dotcom22 » Sat Apr 03, 2010 6:44 pm

Many thank for this trick :-)

In complement for avoid Admin users to touch something related to Admin Template Khepri (or any other Admin template installed) is possible to hide the Administrator link...

For do that you must edit the file "admin.templates.php" located inside /administrator/components/com_templates.

Find the following code:

Code: Select all

if ($client == 1) {
	JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0');
	JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1', true);
} elseif ($client == 0 && !$task) {
	JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0', true);
	JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1');
} else {
	JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0');
	JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1');
}

and replace with:

Code: Select all

if ($client == 1) {
	JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0');
	//JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1', true);
} elseif ($client == 0 && !$task) {
	JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0', true);
	//JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1');
} else {
	JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0');
	//JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1');
}
If you need as Super Admin to change something in Admin Template just type the follow url:

http://www.your-site.com/administrator/ ... s&client=1

cheers


Locked

Return to “Core Hacks and Patches”