By Uwe Sunkel on Friday, 29 September 2017
Posted in General Issues
Likes 0
Views 483
Votes 0
Hi,

I have about 2500 users in my database. About 100 of them have a "Premium"-status and shall get complete access to the community (full functionality). The other 2400 users shall not get access to the community (deactivated in the profile type settings) but must have access to their profile data (e.g. for editing).

Now the problem is that I need to make the 2400 basic users searchable in the community. When I deactivate the users they don't show in the user lists and they cannot be searched.

How can I solve this?

1. Option 1: is there a way to make the basic profiles searchable although they don't have access to the community?
2. Option 2: can I allow access to the community for basic but then restrict the options to the very basic functions. This means that they should not be allowed to eg. see other users, do any searches, send any messages, see the activity stream etc. The only thing they would be allowed to see and do is see and edit their own profile. No other functionality.

I hope that I have described good enough what I mean and want to achieve. Otherwise please ask me for more details.

Regards,
Uwe
Hi Uwe,

Kindly find my response for your inquiries below:
1. Option 1: is there a way to make the basic profiles searchable although they don't have access to the community?

-> I thinks this inquiry is related to the #2 where if you disable the Allow Community Access where, if you disable this setting other still can search this user, however, other user will not able to view this user profile.

2. Option 2: can I allow access to the community for basic but then restrict the options to the very basic functions. This means that they should not be allowed to eg. see other users, do any searches, send any messages, see the activity stream etc. The only thing they would be allowed to see and do is see and edit their own profile. No other functionality.

-> You can disable the setting:
1. Click Profile types>select profile type>disable Allow Community Access: http://take.ms/YuRfj
·
Friday, 29 September 2017 11:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Fadhli,

I cannot confirm this. When I disable Community Access to a certain profile type then users with this profile type cannot be searched and found in the community. But this what I need.

So I have to ask the question again. Obviously option 1 is not possible. How then can I restrict users of this profile type to the very basic functions. This means that they should not be allowed to eg. see other users, do any searches, send any messages, see the activity stream etc. The only thing they would be allowed to see and do is see and edit their own profile. No other functionality.

Regards,
Uwe
·
Friday, 29 September 2017 13:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Uwe,

Do you have reindex smart search yet when you're testing the above?
To re-index:
1. Click Components>smart search>clear index and re-index it back http://take.ms/jqKQy http://take.ms/hpIam
Make sure you've enable the smart search - easysocial user plugin beforehand : http://take.ms/ZdnCR
·
Friday, 29 September 2017 15:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Maybe we are talking about different searches. I am testing the "Advanced Search" from the user menu. When I allow access to the users of profile type = "Basic" then I can find all of them with the Advanced Search. When I deactivate access to the community I am getting zero results with the same search.
·
Friday, 29 September 2017 18:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

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

Perhaps you can provide us with your following details at http://stackideas.com/dashboard/site so we can better have a check?

1. Joomla backend
2. FTP access
3. Which page located that advanced search
·
Saturday, 30 September 2017 13:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Alex,

please have a look at the attached screenshots. The advanced search comes from the ES user menu when you click on the small cog wheel icon (advanced_search.png).

1. profile type "Basic" has access to the community - advances search show the results (results with access.png)
2. switch off access to the community for "Basic" (no access.png)
3. now the same advanced search shows no records (no results.png)

Is this expected behavior? If yes then I am back to option 2: how to restrict users with this profile type to only see and and edit their own profile.

Regards,
Uwe
·
Saturday, 30 September 2017 15:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Uwe,

When a user does not have community access, by default the system doesn't allow their profiles to be search-able. If you need to allow their profiles to still be search-able, edit the file /plugins/finder/easysocialusers/easysocialusers.php and at line 218 locate the codes below and remove them.

[gist]
// check if the user's profile has the community access or not. if not, set access = 3 so that only admin can search.
if (! $user->hasCommunityAccess()) {
$access = 3;
}
[/gist]

P/S: Once you have done that, you will need to purge the smart search and run the indexer again.
·
Saturday, 30 September 2017 17:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

can this be done by custom override?
·
Saturday, 30 September 2017 17:13
·
0 Likes
·
0 Votes
·
0 Comments
·
No, unfortunately it cannot be done through overrides as this is a plugin.
·
Saturday, 30 September 2017 17:14
·
0 Likes
·
0 Votes
·
0 Comments
·
... which means that I have to repeat these changes after every update?
·
Saturday, 30 September 2017 17:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, that is correct unless we add a settings for this.
·
Saturday, 30 September 2017 17:23
·
0 Likes
·
0 Votes
·
0 Comments
·
ok - thanks. I will now re-index and then test if it is working. I will revert after testing.
·
Saturday, 30 September 2017 17:29
·
0 Likes
·
0 Votes
·
0 Comments
·
No problem.
·
Saturday, 30 September 2017 17:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

After indexing and testing I must say that the suggested change is NOT working. I have tested a couple of search phrases which are indexed and available in smart search. But searching for them from the community still shows no results.

Any other idea?
·
Saturday, 30 September 2017 19:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Are you searching for users without community access or are you logged in as a user without community access to perform the search?

The hack on the search I provided earlier is to allow users to search for anyone (regardless if they have community access or not)
·
Saturday, 30 September 2017 23:16
·
0 Likes
·
0 Votes
·
0 Comments
·
I am logged in as a user who has full access to the community. I have an own profile type named "Premium". With this user I am performing a search for users who don't have access to the community. Those users have an own profile type named "Basic". I understand what you say - the hack should make it possible for me to search for all users, also the non-access users. But this is not working with the hack provided.

Here is how I am testing: When I allow access to the users with profile type = Basic then I can find all of them by searching. When I switch off access in the backend then none of these users can be found. It happens in the same second I am switching off access. As soon as I click on "no access" the search gives me zero results. So access obviously is the key.
·
Sunday, 01 October 2017 04:14
·
0 Likes
·
0 Votes
·
0 Comments
·
After you switch them off in the back end, purge and re-index the smart search again. Also, it looks like there are more than 1 place that is performing those checks.

Edit the file /administrator/components/com_easysocial/includes/search/search.php and at line 455, also remove the codes below,

[gist]
// Depend on the setting if allow admin search ESAD users so the ESAD result will be appear.
if (!($this->my->isSiteAdmin()) && !$user->hasCommunityAccess()) {
$excludeCnt++;
continue;
}
[/gist]
·
Sunday, 01 October 2017 16:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Unfortunately the result is the same. Still I am getting no results on performing the search.

I really appreciate your support - even on weekends ... but I think that we are on the wrong track. Would it make sense to you to have look at the backend and perform a search from the frontend by yourself?

Regards,
Uwe
·
Sunday, 01 October 2017 17:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Uwe,

Can you remove the code below in file .../administrator/components/com_easysocial/models/search.php as shown here: http://take.ms/bv6Jy

up.`community_access` = 1

on line 466, So on the line it only be like:

$query .= ' INNER JOIN `#__social_profiles` as up on upm.`profile_id` = up.`id`';

and try again? and may I know do you want the premium can access the basic user profile as well?

You're suggested to backup the file that you want to customize beforehand for precaution
·
Monday, 02 October 2017 11:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Muhammad,

Removing this code results in a 404-error when I am trying to search for other users. Even those who are searchable (Premium).

Regards,
Uwe
·
Monday, 02 October 2017 13:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Uwe,

May I know, do you using EasySocial version 2.0.25? I've try to replicate locally remove the code I'm mention above it seems I doesn't hit the 404-error
Perhaps, can you replace the attached file below in the:
.../administrator/components/com_easysocial/models/search.php
and see how it goes?

You're suggested to backup the file that you want to replace beforehand for precaution
·
Monday, 02 October 2017 15:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes I am on 2.0.25.

I have exchanged the search.php with your file. No it is possible (!) to search the basic users and the results are shown. This is a big step forward! Thanks.

BUT: it is not possible to click on the profile names and open the profile in detail view. This is only working for profiles with profile type = Premium. Is there another hack to achieve this?

And there is one more important question: is it possible to put this functionality as a button in the backend. It is not required by default. Therefore I have to hack the search.php for my situation. But when I do an update this hack will be overwritten.
·
Monday, 02 October 2017 20:58
·
0 Likes
·
0 Votes
·
0 Comments
·
If a user doesn't have community access, others would not be able to view them. This is why it isn't rendered in the search in the first place.

I am really sorry but this is beyond the scope of our support and we would not be able to assist you with the rest of the hacks.
·
Tuesday, 03 October 2017 00:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Fair enough. I understand that. There is another approach which we can check. I will open a new ticket for that.

Thanks and regards,
Uwe
·
Tuesday, 03 October 2017 16:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for understanding Uwe, and appreciate it very much.
·
Tuesday, 03 October 2017 16:30
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post