how to avoid an author can modify his article
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
- newart
- Joomla! Enthusiast
- Posts: 216
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
how to avoid an author can modify his article
In the new 1.5 joomla I'd like to have authors that cannot modify any article.
How-to-do?
Normally I use the standard joomla but in this case I have to hack, sorry... well, What part of the line code I have to hack?
Thanks in advance for your help!
How-to-do?
Normally I use the standard joomla but in this case I have to hack, sorry... well, What part of the line code I have to hack?
Thanks in advance for your help!
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com
http://www.eon-project.com
Re: how to avoid an author can modify his article
Just a thought and I'm not certain it is plausible. Could you limit the editing via the templates to editors and above? I'm also not certain how this would be accomplished.
http://springhillalumni.org • Springhill High School Alumni Association
- newart
- Joomla! Enthusiast
- Posts: 216
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
Re: how to avoid an author can modify his article
by logic you can simply delete the modify icons in such a way that you cannot see a link for modifying an article but in this case you have to think that all guests cannot do anything... or simply you have to hack that icon link to be viewable only for up to authors level... but in this case the problem is, you cannot see it but you can do it - I don't like that solution... and you?
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com
http://www.eon-project.com
Re: how to avoid an author can modify his article
I didn't say it was a great idea. ;)newart wrote:by logic you can simply delete the modify icons in such a way that you cannot see a link for modifying an article but in this case you have to think that all guests cannot do anything... :-\ or simply you have to hack that icon link to be viewable only for up to authors level... but in this case the problem is, you cannot see it but you can do it - :P I don't like that solution... and you? ;)
How about this file components/com_content/views/article/view.html.php around line 170. The number would probably need to be higher than 19. There is probably a better solution. Hopefully, someone else can point it out.
Code: Select all
// Make sure you are logged in and have the necessary access rights
if ($user->get('gid') < [b][color=red]19[/color][/b]) {
JError::raiseError( 403, JText::_('ALERTNOTAUTH') );
return;
}
http://springhillalumni.org • Springhill High School Alumni Association
- newart
- Joomla! Enthusiast
- Posts: 216
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
Re: how to avoid an author can modify his article
yes, maybe a solution, here is the DB table of
jos_core_acl_aro_groups
id parent_id name lft rgt value
17 0 ROOT 1 22 ROOT
28 17 USERS 2 21 USERS
29 28 Public Frontend 3 12 Public Frontend
18 29 Registered 4 11 Registered
19 18 Author 5 10 Author
20 19 Editor 6 9 Editor
21 20 Publisher 7 8 Publisher
30 28 Public Backend 13 20 Public Backend
23 30 Manager 14 19 Manager
24 23 Administrator 15 18 Administrator
25 24 Super Administrator 16 17 Super Administrator
in this case the GID numbers for authors is 19 (I hope is the right value)...
jos_core_acl_aro_groups
id parent_id name lft rgt value
17 0 ROOT 1 22 ROOT
28 17 USERS 2 21 USERS
29 28 Public Frontend 3 12 Public Frontend
18 29 Registered 4 11 Registered
19 18 Author 5 10 Author
20 19 Editor 6 9 Editor
21 20 Publisher 7 8 Publisher
30 28 Public Backend 13 20 Public Backend
23 30 Manager 14 19 Manager
24 23 Administrator 15 18 Administrator
25 24 Super Administrator 16 17 Super Administrator
in this case the GID numbers for authors is 19 (I hope is the right value)...
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com
http://www.eon-project.com
Re: how to avoid an author can modify his article
I knew there was a table that explained each level. I just couldn't remember which one.
http://springhillalumni.org • Springhill High School Alumni Association
- newart
- Joomla! Enthusiast
- Posts: 216
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
Re: how to avoid an author can modify his article
Thank you very much Opie!
what done and just tested: if ($user->get('gid') < gets 20
in this case the author can view the modify icon but cannot modify anything, linked to an error page: the 403 one for a denied access. The problem arising is that now he cannot insert any new article... I have the priority to avoid errors or problems when an author modifies something so the solution is to sacrifice the new article insert feature. I have no choise!
Thank you very much for your solution. Anyway if there are other tips or solutions please post here, I think that problem is a common one as long as joomla hasn't a good ACL.
what done and just tested: if ($user->get('gid') < gets 20
in this case the author can view the modify icon but cannot modify anything, linked to an error page: the 403 one for a denied access. The problem arising is that now he cannot insert any new article... I have the priority to avoid errors or problems when an author modifies something so the solution is to sacrifice the new article insert feature. I have no choise!
Thank you very much for your solution. Anyway if there are other tips or solutions please post here, I think that problem is a common one as long as joomla hasn't a good ACL.
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com
http://www.eon-project.com
Re: how to avoid an author can modify his article
You might change the if statement I pointed to earlier to check the $article->id. If it is greater than 0 it should already be an article, so you would want to exit out of the function. Something like this may work:
Code: Select all
// Make sure you are logged in and have the necessary access rights
if ($user->get('gid') < 19 && $article->id > 0) {
JError::raiseError( 403, JText::_('ALERTNOTAUTH') );
return;
}
http://springhillalumni.org • Springhill High School Alumni Association
- newart
- Joomla! Enthusiast
- Posts: 216
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
Re: how to avoid an author can modify his article
Opie wrote:You might change the if statement I pointed to earlier to check the $article->id. If it is greater than 0 it should already be an article, so you would want to exit out of the function. Something like this may work:Code: Select all
// Make sure you are logged in and have the necessary access rights
if ($user->get('gid') < 19 && $article->id > 0) {
JError::raiseError( 403, JText::_('ALERTNOTAUTH') );
return;
}
good idea, tomorrow I'll test it!
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com
http://www.eon-project.com
- newart
- Joomla! Enthusiast
- Posts: 216
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
Re: how to avoid an author can modify his article
I know I cannot wait for a minute - just tested but when you enter as an author all is working normally (setted gid at 20 or 19). So I deleted the new piece of code in favour of the first one.
Thank you very much for your idea anyway!
Thank you very much for your idea anyway!
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com
http://www.eon-project.com
Re: how to avoid an author can modify his article
I forgot to change the 'gid' number You might check 'gid' number you first used.
http://springhillalumni.org • Springhill High School Alumni Association
- newart
- Joomla! Enthusiast
- Posts: 216
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
Re: how to avoid an author can modify his article
yesterday used by 20 too - it was the same
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com
http://www.eon-project.com
Re: how to avoid an author can modify his article
As long as your satisfied, then that is all that matters.newart wrote:yesterday used by 20 too - it was the same
Good luck.
http://springhillalumni.org • Springhill High School Alumni Association
- newart
- Joomla! Enthusiast
- Posts: 216
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
Re: how to avoid an author can modify his article
yep thanx you're great!
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com
http://www.eon-project.com