Opened 4 years ago
Closed 4 years ago
#620 closed Enhancement (fixed)
"Friends only" Level access
| Reported by: | mmontesp | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.5 |
| Component: | Core | Version: | 1.1 |
| Severity: | minor | Keywords: | friends, access, level access |
| Cc: | brettp | Difficulty: |
Description
Hi!
I have made a little hack in order to have a "friends only" level acces without making friends collections. It avoid data redundancy of a collection "All my friends" on data base.
The changes:
File /engine/lib/access.php Line 165:
Original:
if (empty($sql))
$sql = " ({$table_prefix}access_id in {$access} or ({$table_prefix}access_id = 0 and {$table_prefix}owner_guid = $owner))";
Modified:
global $CONFIG;
if (empty($sql))
$sql = " ({$table_prefix}access_id in {$access} or {$table_prefix}owner_guid = $owner or ({$table_prefix}access_id = -1 and {$table_prefix}owner_guid in (select guid_one from {$CONFIG->dbprefix}entity_relationships where guid_two = $owner and relationship = 'friend')))";
File /engine/lib/access.php Line 200:
Original:
$tmp_access_array = array(0 => elgg_echo("PRIVATE"), 1 => elgg_echo ("LOGGED_IN"), 2 => elgg_echo("PUBLIC"));
Modified:
$tmp_access_array = array(0 => elgg_echo("PRIVATE"), 1 => elgg_echo ("LOGGED_IN"), 2 => elgg_echo("PUBLIC"), -1 => elgg_echo("FRIENDS"));
File /engine/lib/access.php Line 439:
Added:
define('ACCESS_FRIENDS',-1);
The modified file is attached
Regards!
Attachments (1)
Change History (7)
Changed 4 years ago by mmontesp
comment:1 Changed 4 years ago by dansari
This is a duplicate of #74.
comment:2 Changed 4 years ago by mmontesp
Isn't the same sql query ;)
comment:3 Changed 4 years ago by marcus
- Priority changed from major to minor
Thanks, will look into this.
comment:4 Changed 4 years ago by gabrielinux
Hi, can we close this ticket? It's a duplicate of #74.
comment:5 Changed 4 years ago by mmontesp
12/12/08 08:29:35 changed by mmontesp ΒΆ
Isn't the same sql query ;)
Just let the developers to choose the best solution, this is not a war.
comment:6 Changed 4 years ago by marcus
- Resolution set to fixed
- Status changed from new to closed

Modified file