release v5.1.0 #428
1 changed files with 8 additions and 17 deletions
commit
0da550e3eb
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
namespace OCA\SideMenu\AppInfo;
|
||||
|
||||
use OC;
|
||||
use OC\AllConfig;
|
||||
use OC\App\AppStore\Fetcher\CategoryFetcher;
|
||||
use OC\AppFramework\Http\Request;
|
||||
use OC\Security\CSP\ContentSecurityPolicyNonceManager;
|
||||
use OC\User\User;
|
||||
use OCA\SideMenu\Service\AppRepository;
|
||||
|
|
@ -31,23 +32,12 @@ use Psr\Container\ContainerInterface;
|
|||
class Application extends App implements IBootstrap
|
||||
{
|
||||
public const APP_ID = 'side_menu';
|
||||
|
||||
public const APP_NAME = 'Custom menu';
|
||||
|
||||
/**
|
||||
* @var OC\AllConfig
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var ContentSecurityPolicyNonceManager
|
||||
*/
|
||||
protected $cspnm;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
protected $user;
|
||||
protected AllConfig $config;
|
||||
protected ContentSecurityPolicyNonceManager $cspnm;
|
||||
protected Request $request;
|
||||
protected ?User $user = null;
|
||||
|
||||
public function __construct(array $urlParams = [])
|
||||
{
|
||||
|
|
@ -96,6 +86,7 @@ class Application extends App implements IBootstrap
|
|||
$this->config = \OC::$server->getConfig();
|
||||
$this->cspnm = \OC::$server->getContentSecurityPolicyNonceManager();
|
||||
$this->user = \OC::$server[IUserSession::class]->getUser();
|
||||
$this->request = \OC::$server->getRequest();
|
||||
|
||||
if (!$this->isEnabled()) {
|
||||
return;
|
||||
|
|
@ -106,7 +97,7 @@ class Application extends App implements IBootstrap
|
|||
|
||||
protected function isEnabled(): bool
|
||||
{
|
||||
if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match('/MemoriesNative/', $_SERVER['HTTP_USER_AGENT'])) {
|
||||
if (isset($this->request->server['HTTP_USER_AGENT']) && preg_match('/MemoriesNative/', $this->request->server['HTTP_USER_AGENT'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue