当前位置: 首页>>代码示例>>PHP>>正文


PHP IAppManager::isEnabledForUser方法代码示例

本文整理汇总了PHP中OCP\App\IAppManager::isEnabledForUser方法的典型用法代码示例。如果您正苦于以下问题:PHP IAppManager::isEnabledForUser方法的具体用法?PHP IAppManager::isEnabledForUser怎么用?PHP IAppManager::isEnabledForUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OCP\App\IAppManager的用法示例。


在下文中一共展示了IAppManager::isEnabledForUser方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: forceSingleUserAndTrashbin

 /**
  * Set single user mode and disable the trashbin app
  */
 protected function forceSingleUserAndTrashbin()
 {
     $this->wasTrashbinEnabled = $this->appManager->isEnabledForUser('files_trashbin');
     $this->wasSingleUserModeEnabled = $this->config->getSystemValue('singleuser', false);
     $this->config->setSystemValue('singleuser', true);
     $this->appManager->disableApp('files_trashbin');
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:10,代码来源:EncryptAll.php

示例2: isCertificateImportAllowed

 /**
  * check if certificate import is allowed
  *
  * @return bool
  */
 protected function isCertificateImportAllowed()
 {
     $externalStorageEnabled = $this->appManager->isEnabledForUser('files_external');
     if ($externalStorageEnabled) {
         $backends = \OC_Mount_Config::getPersonalBackends();
         if (!empty($backends)) {
             return true;
         }
     }
     return false;
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:16,代码来源:certificatecontroller.php

示例3: __construct

 /**
  * @param IManager $encryptionManager
  * @param IAppManager $appManager
  * @param IConfig $config
  * @param QuestionHelper $questionHelper
  */
 public function __construct(IManager $encryptionManager, IAppManager $appManager, IConfig $config, QuestionHelper $questionHelper)
 {
     parent::__construct();
     $this->appManager = $appManager;
     $this->encryptionManager = $encryptionManager;
     $this->config = $config;
     $this->questionHelper = $questionHelper;
     $this->wasTrashbinEnabled = $this->appManager->isEnabledForUser('files_trashbin');
     $this->wasSingleUserModeEnabled = $this->config->getSystemValue('singleuser', false);
     $this->config->setSystemValue('singleuser', true);
     $this->appManager->disableApp('files_trashbin');
 }
开发者ID:unrealbato,项目名称:core,代码行数:18,代码来源:encryptall.php

示例4: isSharingEnabled

 /**
  * Check whether sharing is enabled
  * @return bool
  */
 private function isSharingEnabled()
 {
     // FIXME: This check is done here since the route is globally defined and not inside the files_sharing app
     // Check whether the sharing application is enabled
     if (!$this->appManager->isEnabledForUser($this->appName)) {
         return false;
     }
     // Check whether public sharing is enabled
     if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') {
         return false;
     }
     return true;
 }
开发者ID:heldernl,项目名称:owncloud8-extended,代码行数:17,代码来源:sharingcheckmiddleware.php

示例5: buildProviderList

 /**
  * @return \OCP\AppFramework\Http\JSONResponse
  */
 public function buildProviderList()
 {
     $services = ['version' => 2, 'PRIVATE_DATA' => ['version' => 1, 'endpoints' => ['store' => '/ocs/v2.php/privatedata/setattribute', 'read' => '/ocs/v2.php/privatedata/getattribute', 'delete' => '/ocs/v2.php/privatedata/deleteattribute']]];
     if ($this->appManager->isEnabledForUser('files_sharing')) {
         $services['SHARING'] = ['version' => 1, 'endpoints' => ['share' => '/ocs/v2.php/apps/files_sharing/api/v1/shares']];
         $services['FEDERATED_SHARING'] = ['version' => 1, 'endpoints' => ['share' => '/ocs/v2.php/cloud/shares', 'webdav' => '/public.php/webdav/']];
     }
     if ($this->appManager->isEnabledForUser('activity')) {
         $services['ACTIVITY'] = ['version' => 1, 'endpoints' => ['list' => '/ocs/v2.php/cloud/activity']];
     }
     if ($this->appManager->isEnabledForUser('provisioning_api')) {
         $services['PROVISIONING'] = ['version' => 1, 'endpoints' => ['user' => '/ocs/v2.php/cloud/users', 'groups' => '/ocs/v2.php/cloud/groups', 'apps' => '/ocs/v2.php/cloud/apps']];
     }
     return new \OCP\AppFramework\Http\JSONResponse($services);
 }
开发者ID:evanjt,项目名称:core,代码行数:18,代码来源:provider.php

示例6: showFile

 /**
  * Redirects to the file list and highlight the given file id
  *
  * @param string $fileId file id to show
  * @return RedirectResponse redirect response or not found response
  * @throws \OCP\Files\NotFoundException
  *
  * @NoCSRFRequired
  * @NoAdminRequired
  */
 public function showFile($fileId)
 {
     $uid = $this->userSession->getUser()->getUID();
     $baseFolder = $this->rootFolder->get($uid . '/files/');
     $files = $baseFolder->getById($fileId);
     $params = [];
     if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
         $baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/');
         $files = $baseFolder->getById($fileId);
         $params['view'] = 'trashbin';
     }
     if (!empty($files)) {
         $file = current($files);
         if ($file instanceof Folder) {
             // set the full path to enter the folder
             $params['dir'] = $baseFolder->getRelativePath($file->getPath());
         } else {
             // set parent path as dir
             $params['dir'] = $baseFolder->getRelativePath($file->getParent()->getPath());
             // and scroll to the entry
             $params['scrollto'] = $file->getName();
         }
         return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', $params));
     }
     throw new \OCP\Files\NotFoundException();
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:36,代码来源:ViewController.php

示例7: testIsEnabledForUserLoggedIn

 public function testIsEnabledForUserLoggedIn()
 {
     $user = new User('user1', null);
     $this->userSession->expects($this->once())->method('getUser')->will($this->returnValue($user));
     $this->groupManager->expects($this->once())->method('getUserGroupIds')->with($user)->will($this->returnValue(array('foo', 'bar')));
     $this->appConfig->setValue('test', 'enabled', '["foo"]');
     $this->assertTrue($this->manager->isEnabledForUser('test'));
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:8,代码来源:manager.php

示例8: isSharingEnabled

 /**
  * Check whether sharing is enabled
  * @return bool
  */
 private function isSharingEnabled()
 {
     // FIXME: This check is done here since the route is globally defined and not inside the files_sharing app
     // Check whether the sharing application is enabled
     if (!$this->appManager->isEnabledForUser($this->appName)) {
         return false;
     }
     return true;
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:13,代码来源:sharingcheckmiddleware.php

示例9: isCertificateImportAllowed

 /**
  * check if certificate import is allowed
  *
  * @return bool
  */
 protected function isCertificateImportAllowed()
 {
     $externalStorageEnabled = $this->appManager->isEnabledForUser('files_external');
     if ($externalStorageEnabled) {
         $backendService = \OC_Mount_Config::$app->getContainer()->query('OCA\\Files_External\\Service\\BackendService');
         if ($backendService->getBackendsVisibleFor(\OCA\Files_External\Service\BackendService::VISIBILITY_PERSONAL)) {
             return true;
         }
     }
     return false;
 }
开发者ID:hyb148,项目名称:core,代码行数:16,代码来源:certificatecontroller.php

示例10: isCertificateImportAllowed

 /**
  * check if certificate import is allowed
  *
  * @return bool
  */
 protected function isCertificateImportAllowed()
 {
     $externalStorageEnabled = $this->appManager->isEnabledForUser('files_external');
     if ($externalStorageEnabled) {
         /** @var \OCA\Files_External\Service\BackendService $backendService */
         $backendService = \OC_Mount_Config::$app->getContainer()->query('\\OCA\\Files_External\\Service\\BackendService');
         if ($backendService->isUserMountingAllowed()) {
             return true;
         }
     }
     return false;
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:17,代码来源:CertificateController.php

示例11: __construct

 /**
  * @param string $appName
  * @param IRequest $request
  * @param IUserManager $userManager
  * @param IGroupManager $groupManager
  * @param IUserSession $userSession
  * @param IConfig $config
  * @param bool $isAdmin
  * @param IL10N $l10n
  * @param ILogger $log
  * @param \OC_Defaults $defaults
  * @param IMailer $mailer
  * @param string $fromMailAddress
  * @param IURLGenerator $urlGenerator
  * @param IAppManager $appManager
  */
 public function __construct($appName, IRequest $request, IUserManager $userManager, IGroupManager $groupManager, IUserSession $userSession, IConfig $config, $isAdmin, IL10N $l10n, ILogger $log, \OC_Defaults $defaults, IMailer $mailer, $fromMailAddress, IURLGenerator $urlGenerator, IAppManager $appManager)
 {
     parent::__construct($appName, $request);
     $this->userManager = $userManager;
     $this->groupManager = $groupManager;
     $this->userSession = $userSession;
     $this->config = $config;
     $this->isAdmin = $isAdmin;
     $this->l10n = $l10n;
     $this->log = $log;
     $this->defaults = $defaults;
     $this->mailer = $mailer;
     $this->fromMailAddress = $fromMailAddress;
     $this->urlGenerator = $urlGenerator;
     // check for encryption state - TODO see formatUserForIndex
     $this->isEncryptionAppEnabled = $appManager->isEnabledForUser('encryption');
     if ($this->isEncryptionAppEnabled) {
         // putting this directly in empty is possible in PHP 5.5+
         $result = $config->getAppValue('encryption', 'recoveryAdminEnabled', 0);
         $this->isRestoreEnabled = !empty($result);
     }
 }
开发者ID:evanjt,项目名称:core,代码行数:38,代码来源:userscontroller.php

示例12: checkAppEnabled

 /**
  * This method is called before any HTTP after auth and checks if the user has access to the app
  *
  * @throws \Sabre\DAV\Exception\Forbidden
  * @return bool
  */
 public function checkAppEnabled()
 {
     if (!$this->appManager->isEnabledForUser($this->app)) {
         throw new Forbidden();
     }
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:12,代码来源:AppEnabledPlugin.php


注:本文中的OCP\App\IAppManager::isEnabledForUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。