By Juz on Sunday, 07 June 2015
Posted in Groups
Likes 0
Views 0.9K
Votes 0
Hi,

We've created private "invite-only" groups and enabled custom field to only allow admin to post in the group. Feature works somewhat. Although group member is unable to post in the share-box (gets an error message that you're not allowed to post), they're able to repost in this group. We believe that should not be allowed as well if we're restricting all share/post permissions for members in such groups. Can this be resolved?

Cheers!
Hey Juz,

I am sorry that delay of this reply, I already applied some hack in the following file, please have a check and backup it.

JoomlaFolder\media\com_easysocial\apps\event\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\event\guests\guests.php
JoomlaFolder\media\com_easysocial\apps\event\story\story.php
JoomlaFolder\media\com_easysocial\apps\event\links\links.php

JoomlaFolder\media\com_easysocial\apps\group\events\events.php
JoomlaFolder\media\com_easysocial\apps\group\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\group\links\links.php
JoomlaFolder\media\com_easysocial\apps\group\groups\groups.php

JoomlaFolder\media\com_easysocial\apps\user\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\user\story\story.php
JoomlaFolder\media\com_easysocial\apps\user\groups\groups.php
JoomlaFolder\media\com_easysocial\apps\user\links\links.php


I almost use the following code added at above files.

// check the event if not public and not owner, hide all the comment/repost/sharing
if (!$event->isOpen() && !$guest->isOwner()) {
$item->sharing = false;
$item->repost = false;
$item->commentLink = false;
}

// check the group if not public and not owner, hide all the comment/repost/sharing
if (!$group->isOpen() && !$group->isOwner()) {
$stream->sharing = false;
$stream->repost = false;
$stream->commentLink = false;
}



Hope this helps.
·
Friday, 24 July 2015 03:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Juz ,

I am really sorry for the delay of this reply as it is a weekend for us here.

Can you try download this few attachment file and replace in your site and see how it goes?

JoomlaFolder\media\com_easysocial\apps\group\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\group\links\links.php
JoomlaFolder\media\com_easysocial\apps\group\groups\groups.php
·
Sunday, 07 June 2015 13:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

I've replaced the files provided in your email response. However there's no change and users are still able to repost in invite only groups that has permission set for only admin to post anything to the group activity stream. We want to block both repost and social share feature in activity stream, if the group is set with custom field for only admin to post. How can we accomplish this?

Cheers!
Juz
·
Monday, 08 June 2015 09:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Juz,

Sorry for late reply to this,

Can you provide us some screenshot which "repost" are you referring to?

because I tested in my locally, the "Repost" link should be disappear, can you provide us with your Joomla backend and FTP access so we can help you check on this?
·
Monday, 08 June 2015 10:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

I have replaced the files you provided and there's still a problem. We do not want repost feature in groups. Is it possible to remove it completely? Pls. refer attachment reg. group permissions. We still see "repost" even after replacing files with what you've provided earlier. Can this be looked in to without backend access at this time?

Thx.
Juz
·
Friday, 26 June 2015 17:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Juz,

Sorry for late reply to this,

I've double check again, it seems like the code i provided is worked in my local site, can you provide us with your Joomla backend and FTP access so we can help you check on this and resolved this quickly?
·
Monday, 29 June 2015 16:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

Provided site access details. We want to remove Comment, Repost, Social Share option from posts in private groups. Is that possible?

Appreciate your help.

Cheers!
Juz
·
Thursday, 09 July 2015 10:25
·
0 Likes
·
0 Votes
·
0 Comments
·
HI Juz,

Sorry for late reply to this,

I already applied some hack for this restriction user permission do not have comment, social share, repost functionality from your private group and event.

This is those file i modified :
JoomlaFolder\media\com_easysocial\apps\group\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\event\guests\guests.php
JoomlaFolder\media\com_easysocial\apps\group\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\group\links\links.php
JoomlaFolder\media\com_easysocial\apps\group\groups\groups.php


So you have to backup by yourself for this customization for prevent future update.

Hope this help.
·
Thursday, 09 July 2015 15:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

The functionality still doesn't work as required. I noticed that you/team have created stackideasuser locally in our system. I've assigned that user to multiple private groups. Once you log in as that user, and check under groups you'll notice that the user is allowed to comment/ repost/social share. That option should be disabled/ not displayed.

Can you pls. check again.

Thanks.
Juz
·
Tuesday, 21 July 2015 08:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Juz,

Sorry for late reply to this,

I've checked again and access in your all of your private group, it seems like all the comment/repost/socialshare is disappeared now, check my screenshot below. Am i missing something here? Please advise.
·
Tuesday, 21 July 2015 12:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Pls. refer the attachment. Image 2 is fine. Functionality once a user clicked a group.

However, as you can see in image 1, comment, repost and social share buttons are still visible. Image 1 is what you'll see as you sign in and click on any one of my classes. How do we accomplish the same on this screen?

Appreciate your understanding, patience & great help!

Cheers.
Juz
·
Tuesday, 21 July 2015 13:01
·
0 Likes
·
0 Votes
·
0 Comments
·
hey Juz,

I have tried to connect in your FTP server but it seems like that is not working. Can you help?
·
Tuesday, 21 July 2015 19:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Sorry about that. I've just checked and should be working now. Pls. retry with details shared earlier.

Cheers!
Juz
·
Tuesday, 21 July 2015 21:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Juz,

It seems like I still can't able to connect with your FTP server, this is what warning message I hitting :
Error:	Cannot establish FTP connection to an SFTP server. Please select proper protocol.
Error: Critical error
Error: Could not connect to server


By the way, can you download my attachment file and replace in this 3 file location in your server?
JoomlaFolder\media\com_easysocial\apps\user\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\user\story\story.php
JoomlaFolder\media\com_easysocial\apps\user\groups\groups.php

And see how it goes?
·
Tuesday, 21 July 2015 22:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Perhaps correct port not specified in connect request. Have shared site details again. Pls. note comments section.

I replaced the 3 files in respective locations. Here's what happened:

1) Login using administrator profile: Although functionality seems to work, we did not want Comment, Repost & Social Share removed for Administrator. We want it removed only for registered members. So that check needs to happen. Both here as well as once clicked and within group page (previous updated files). Noticed that within groups also (previous files) this check wasn't done.

2) We noted that although Comment, Repost etc. were removed for photos they exist for events. Need to remove from events as well. But only for registered members.

3) Login using registered member profile: There's some problem with the code as the system hangs (unable to load stream/ story).

Appreciate your help.
Juz
·
Tuesday, 21 July 2015 23:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Juz,

1) Login using administrator profile: Although functionality seems to work, we did not want Comment, Repost & Social Share removed for Administrator. We want it removed only for registered members. So that check needs to happen. Both here as well as once clicked and within group page (previous updated files). Noticed that within groups also (previous files) this check wasn't done.

I have updated this 3 file in your site :
JoomlaFolder\media\com_easysocial\apps\user\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\user\story\story.php
JoomlaFolder\media\com_easysocial\apps\user\groups\groups.php

this will be fix when you click group filter from dashboard.
Groupadmin - Able to like/comment/repost
Groupmember - Not able to like/comment/repost

2) We noted that although Comment, Repost etc. were removed for photos they exist for events. Need to remove from events as well. But only for registered members.

Perhaps you can create a new event in the group so I can directly check on this.
By the way, I checked on your site, it seems like this few file get overridden :
JoomlaFolder\media\com_easysocial\apps\group\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\event\guests\guests.php
JoomlaFolder\media\com_easysocial\apps\group\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\group\links\links.php
JoomlaFolder\media\com_easysocial\apps\group\groups\groups.php

May i know do you have backup those files?

3) Login using registered member profile: There's some problem with the code as the system hangs (unable to load stream/ story).

I've checked in your user profile, it seems work fine when i click on the filter on dashboard and user profile, may i know how to replicate this issues?
·
Wednesday, 22 July 2015 00:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Thanks again for the awesome support so far.

Ok now back to the issue;)

#1) Login using administrator profile: seems to work ok for admin profile. However, unable to test using registered member profile. The activity stream/ story doesn't display at all. Pls. login using registered member profile (stackideastester) you've created earlier to replicate the issue. Alternatively, I've provided a sample a/c under site details.

#2) Action for events: Pls. login using a registered member profile and you'll notice the issue.

#3) Login using registered member profile: same as above.

#4) File backups. Yes we made file backups earlier. However quite a few files seem to have changed. We do have the backups of all files you've listed in your most recent post above. As long as those are the only files that were modified.

Cheers!
Juz
·
Wednesday, 22 July 2015 08:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Juz,

I am sorry for the delay of this reply,

Yes, seems like only you provided that new registered user account can replicate this issue, by the way, I already fix it. Take a look of my screenshot here : http://screencast.com/t/3XgfLu1fo

Can you replace back those customization files in your site? So I can help you hack for the group admin have permission to comment/repost/socialshare.
JoomlaFolder\media\com_easysocial\apps\group\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\event\guests\guests.php
JoomlaFolder\media\com_easysocial\apps\group\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\group\links\links.php
JoomlaFolder\media\com_easysocial\apps\group\groups\groups.php
·
Wednesday, 22 July 2015 23:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Thanks for fixing the issue. Pls. let us know the files modified so that we can keep a copy.

I don't understand your comment "Can you replace back those customization files in your site? So I can help you hack for the group admin have permission to comment/repost/socialshare."

You want us to replace which files? You mean put back the original files before customization? Or put back the files you/team changed as part of this feature request?

Am somewhat confused.
Juz
·
Thursday, 23 July 2015 00:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Juz,

Sorry for confusing, what i mean is I noticed all the files already revert back to orginal because I checked the file modify date is same as other file date. May i know do you have backup to store in some way? If yes, can you temporary zip the file together and attach in your next reply?
JoomlaFolder\media\com_easysocial\apps\group\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\events\events.php
JoomlaFolder\media\com_easysocial\apps\event\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\event\guests\guests.php
JoomlaFolder\media\com_easysocial\apps\group\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\group\links\links.php
JoomlaFolder\media\com_easysocial\apps\group\groups\groups.php
·
Thursday, 23 July 2015 00:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Sure. I've enclosed zip file. There are 4 under group and 3 under events.

Our concern: not sure how the file reverted back to original. We made no changes. Also on the frontend the functionality seems to work as we hope. So do we need to change the files again. Is it possible for you to quickly compare the files. Just want to be doubly sure that checking-in the attached files do not cause any further issues;)

Can you highlight/ explain the code that you've modified to accomplish this? Also, were these the only files updated? You mentioned earlier 3 other files updated but that caused other issue where registered member stream could not open. What changes were made to rectify the problem.

I have updated this 3 file in your site :
JoomlaFolder\media\com_easysocial\apps\user\photos\photos.php
JoomlaFolder\media\com_easysocial\apps\user\story\story.php
JoomlaFolder\media\com_easysocial\apps\user\groups\groups.php


We want to be sure we have backup of all the files override so that once we update to 1.3.29 we're able to accomplish the same (and in future). Pls. help.
Juz
·
Thursday, 23 July 2015 12:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Thanks for your help and getting this thru. One quick clarification. You code checks for isOwner(). Is there an isAdmin() as well. There could be certain groups where owner is not the group admin. Does that mean we have to check for both isOwner() && isAdmin() to allow/disallow the functionality. We'll make the changes once you can confirm the functionality/our understanding.

Thanks.
Juz
·
Friday, 24 July 2015 08:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Juz,

You're welcome.

Yes, we do have isAdmin() as well. You can take a look of my following sample code :
		
// Get the current logged in user.
$my = FD::user();

// Check current logged in user is it Superadmin
$my->isSiteAdmin()

// Check the current logged in user is it event admin
$event->isAdmin()

// Check the current logged in user is it group admin
$group->isAdmin()

//Note : the variable depend on what you define the group/event

Hope this helps.
·
Friday, 24 July 2015 10:53
·
0 Likes
·
0 Votes
·
0 Comments
·
So we could replace !$guest->isOwner() with (!$guest->isOwner() | !$guest->isAdmin()). That should work I guess. So group owner or admin can publish/repost/social share. Group members cannot. Did I miss anything? Or is it not as straight-forward as it appears?
Juz
·
Friday, 24 July 2015 18:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Juz,

Yes, you can do something checking in the following code:

// If this is not a public event and (event owner or event admin)
if (!$event->isOpen() && (!$guest->isOwner() || !$guest->isAdmin()) {
$item->sharing = false;
$item->repost = false;
$item->commentLink = false;
}
·
Friday, 24 July 2015 19:08
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post