Moderation only for Super-Administrator

Phoca Guestbook - creating guestbooks in Joomla! CMS
hbrui
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 10 Apr 2009, 15:47

Moderation only for Super-Administrator

Post by hbrui »

Hi,

I installed PhocaGuestbook and really like it, but have some problems with it. The complete translation I could fix with forum serarch. My most important problem to be solved is: only users in group "Super-Administrators" are shown the delete and unpublish icons in frontend. No other group will be accepted, even when added to com_phocaguestbook\helpers\phocaguestbook.php or/and com_phocaguestbook\views\phocaguestbook\view.html.php to be flagged as administrator. I`m not an expert in coding, so I just try to find the matching passages. I installed phoca guestbook on Joomla 1.5.10 on two different webservers, but get the same result. Only Superadmin are allowed to moderate in frontend. How can I fix this?

Thanks for any help.
Bernd
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48714
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Moderation only for Super-Administrator

Post by Jan »

Hi, you need to customize the code, so. e.g. you will set other user group or direct some user to moderate the forum, this needs to be changed:

components\com_phocaguestbook\views\phocaguestbook\view.html.php

line 31

Jan
If you find Phoca extensions useful, please support the project
hbrui
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 10 Apr 2009, 15:47

Re: Moderation only for Super-Administrator

Post by hbrui »

Hi Jan,

thanks for your tip. But I already tried to add group manager here. Even tried to add just a specific user by adding "|| $user->usertype == strtolower('test')" after the administrator, but it is ignored.
Without any modification all users of the administrator group should see the trash and unpublish-icon. But on my webspace only Super-Administrator see those icons. So there must be an existing problem with the code without me (=noob :idea: ) tampering with it.

Any hints?
Bernd
sweet160
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 05 Apr 2009, 17:47

Re: Moderation only for Super-Administrator

Post by sweet160 »

Hi,

I have the same problem here,
Would like to give publishers the right to manage the messages in Phoca Guestbook, FRONT end
but I dont know how to make it happen...

Jo
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48714
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Moderation only for Super-Administrator

Post by Jan »

hbrui

Hi, be aware, usertype is not user or username.


See the controller too:
components\com_phocaguestbook\controllers\phocaguestbook.php

436, 475

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48714
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Moderation only for Super-Administrator

Post by Jan »

Hi, I am testing it (as administrator only) and get no problem there :idea:

Jan
If you find Phoca extensions useful, please support the project
Alhifi
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 13 Jan 2010, 14:37

Re: Moderation only for Super-Administrator

Post by Alhifi »

hbrui wrote: ... Even tried to add just a specific user by adding "|| $user->usertype == strtolower('test')" after the administrator, but it is ignored.
...
I actually have the same problem, i want to add the group "Manager" to get the access-rights for "delete" and "unpublish", so i tried the way above ... and it's very simply, why the original script did only work with "Super Administrator" and not with "Administrator".

File /component/views/phocaguestbook/views/view.html.php Line 31:
Original (wrong):

Code: Select all

if (strtolower($user->usertype) == strtolower('super administrator') || $user->usertype == strtolower('administrator')) {
What is wrong? See the missing 'strtolower' in the second check of usertype ...

Correct:

Code: Select all

if (strtolower($user->usertype) == strtolower('super administrator') || strtolower($user->usertype) == strtolower('administrator')) {
Extended with group "Manager":

Code: Select all

if ( strtolower($user->usertype) == strtolower('super administrator') || strtolower($user->usertype) == strtolower('administrator') || strtolower($user->usertype) == strtolower('manager')) {
Hope it helps, it's working for me ...

Actually i finished to change phocaguestbook to do the publishing, unpublishing and deleting on the frontend ... working fine.

Bye
Alhifi

BTW: Sorry for my bad english ...
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48714
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Moderation only for Super-Administrator

Post by Jan »

Hi, thank you for this information.

Jan
If you find Phoca extensions useful, please support the project
hbrui
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 10 Apr 2009, 15:47

Re: Moderation only for Super-Administrator

Post by hbrui »

Wonderful, thanks for this solution. It works fine now for my Managers :twisted:
Post Reply