Merge pull request #7879 from MrPetovan/bug/warnings

Fix ACL-related warnings
This commit is contained in:
Philipp 2019-11-30 13:17:44 +01:00 committed by GitHub
commit b61f475c47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 17 deletions

View file

@ -30,15 +30,26 @@ class Page implements ArrayAccess
/** /**
* @var array Contains all stylesheets, which should get loaded during page * @var array Contains all stylesheets, which should get loaded during page
*/ */
private $stylesheets; private $stylesheets = [];
/** /**
* @var array Contains all scripts, which are added to the footer at last * @var array Contains all scripts, which are added to the footer at last
*/ */
private $footerScripts; private $footerScripts = [];
/** /**
* @var array The page content, which are showed directly * @var array The page content, which are showed directly
*/ */
private $page; private $page = [
'aside' => '',
'bottom' => '',
'content' => '',
'footer' => '',
'htmlhead' => '',
'nav' => '',
'page_title' => '',
'right_aside' => '',
'template' => '',
'title' => '',
];
/** /**
* @var string The basepath of the page * @var string The basepath of the page
*/ */
@ -50,19 +61,6 @@ class Page implements ArrayAccess
public function __construct(string $basepath) public function __construct(string $basepath)
{ {
$this->basePath = $basepath; $this->basePath = $basepath;
$this->page = [
'aside' => '',
'bottom' => '',
'content' => '',
'footer' => '',
'htmlhead' => '',
'nav' => '',
'page_title' => '',
'right_aside' => '',
'template' => '',
'title' => ''
];
} }
/** /**

View file

@ -333,6 +333,13 @@ class ACL extends BaseObject
// Defaults user permissions // Defaults user permissions
if (empty($default_permissions)) { if (empty($default_permissions)) {
$default_permissions = self::getDefaultUserPermissions($user); $default_permissions = self::getDefaultUserPermissions($user);
} else {
$default_permissions = [
'allow_cid' => $default_permissions['allow_cid'] ?? [],
'allow_gid' => $default_permissions['allow_gid'] ?? [],
'deny_cid' => $default_permissions['deny_cid'] ?? [],
'deny_gid' => $default_permissions['deny_gid'] ?? [],
];
} }
if (count($default_permissions['allow_cid']) if (count($default_permissions['allow_cid'])
@ -352,7 +359,7 @@ class ACL extends BaseObject
$pubmail_enabled = false; $pubmail_enabled = false;
if (function_exists('imap_open') && !Config::get('system', 'imap_disabled')) { if (function_exists('imap_open') && !Config::get('system', 'imap_disabled')) {
$mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', $user['úid']]); $mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', $user['uid']]);
if (DBA::isResult($mailacct)) { if (DBA::isResult($mailacct)) {
$mail_enabled = true; $mail_enabled = true;
$pubmail_enabled = !empty($mailacct['pubmail']); $pubmail_enabled = !empty($mailacct['pubmail']);