Browse Source

Move get_acl_permissions to Acl

pull/4517/head
Hypolite Petovan 3 years ago
parent
commit
2b35938e34
4 changed files with 8 additions and 8 deletions
  1. +0
    -4
      include/acl_selectors.php
  2. +3
    -1
      mod/bookmarklet.php
  3. +2
    -1
      mod/events.php
  4. +3
    -2
      mod/network.php

+ 0
- 4
include/acl_selectors.php View File

@ -9,10 +9,6 @@ use Friendica\Model\Contact;
require_once "mod/proxy.php";
function get_acl_permissions($user = null) {
return Acl::getDefaultUserPermissions($user);
}
function populate_acl($user = null, $show_jotnets = false) {
return Acl::getFullSelectorHTML($user, $show_jotnets);
}


+ 3
- 1
mod/bookmarklet.php View File

@ -2,7 +2,9 @@
/**
* @file mod/bookmarklet.php
*/
use Friendica\App;
use Friendica\Core\Acl;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Module\Login;
@ -35,7 +37,7 @@ function bookmarklet_content(App $a)
'default_location' => $a->user['default-location'],
'nickname' => $a->user['nickname'],
'lockstate' => ((is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))) ? 'lock' : 'unlock'),
'default_perms' => get_acl_permissions($a->user),
'default_perms' => Acl::getDefaultUserPermissions($a->user),
'acl' => populate_acl($a->user, true),
'bang' => '',
'visitor' => 'block',


+ 2
- 1
mod/events.php View File

@ -6,6 +6,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Core\Acl;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
@ -480,7 +481,7 @@ function events_content(App $a) {
require_once 'include/acl_selectors.php' ;
$perms = get_acl_permissions($orig_event);
$perms = Acl::getDefaultUserPermissions($orig_event);
if ($mode === 'new' || $mode === 'copy') {
$acl = (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user)));


+ 3
- 2
mod/network.php View File

@ -9,6 +9,7 @@ use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\Acl;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
@ -427,7 +428,7 @@ function networkFlatView(App $a, $update = 0)
'lockstate' => (((is_array($a->user) &&
((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
(strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
'default_perms' => get_acl_permissions($a->user),
'default_perms' => Acl::getDefaultUserPermissions($a->user),
'acl' => populate_acl($a->user, true),
'bang' => '',
'visitor' => 'block',
@ -576,7 +577,7 @@ function networkThreadedView(App $a, $update, $parent)
'lockstate' => ((($gid) || ($cid) || ($nets) || (is_array($a->user) &&
((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
(strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
'default_perms' => get_acl_permissions($a->user),
'default_perms' => Acl::getDefaultUserPermissions($a->user),
'acl' => populate_acl((($gid || $cid || $nets) ? $def_acl : $a->user), true),
'bang' => (($gid || $cid || $nets) ? '!' : ''),
'visitor' => 'block',


Loading…
Cancel
Save