[Web] Various PHP 8 fixes, partly fixes #4219

This commit is contained in:
andryyy
2021-08-09 08:28:22 +02:00
parent 7e958c9b26
commit 2cd0b56b14
15 changed files with 524 additions and 506 deletions

View File

@@ -1,16 +1,16 @@
<?php
function oauth2($_action, $_type, $_data = null) {
global $pdo;
global $redis;
global $lang;
if ($_SESSION['mailcow_cc_role'] != "admin") {
$_SESSION['return'][] = array(
'type' => 'danger',
global $pdo;
global $redis;
global $lang;
if ($_SESSION['mailcow_cc_role'] != "admin") {
$_SESSION['return'][] = array(
'type' => 'danger',
'log' => array(__FUNCTION__, $_action, $_type, $_data),
'msg' => 'access_denied'
);
return false;
}
'msg' => 'access_denied'
);
return false;
}
switch ($_action) {
case 'add':
switch ($_type) {
@@ -188,7 +188,7 @@ function oauth2($_action, $_type, $_data = null) {
$_SESSION['return'][] = array(
'type' => 'success',
'log' => array(__FUNCTION__, $_action, $_type, $_data),
'msg' => sprintf($lang['success']['items_deleted'], implode(', ', $access_tokens))
'msg' => sprintf($lang['success']['items_deleted'], implode(', ', (array)$access_tokens))
);
break;
case 'refresh_token':
@@ -210,7 +210,7 @@ function oauth2($_action, $_type, $_data = null) {
$_SESSION['return'][] = array(
'type' => 'success',
'log' => array(__FUNCTION__, $_action, $_type, $_data),
'msg' => sprintf($lang['success']['items_deleted'], implode(', ', $refresh_tokens))
'msg' => sprintf($lang['success']['items_deleted'], implode(', ', (array)$refresh_tokens))
);
break;
}
@@ -239,4 +239,4 @@ function oauth2($_action, $_type, $_data = null) {
}
break;
}
}
}