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


PHP IUser::getUID方法代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     $connection = \OC::$server->getDatabaseConnection();
     $deleteStatement = $connection->prepare('DELETE FROM `*PREFIX*properties`' . ' WHERE `userid` = ?');
     $deleteStatement->execute(array($this->user->getUID()));
     $deleteStatement->closeCursor();
 }
开发者ID:rajeshpillai,项目名称:core,代码行数:7,代码来源:custompropertiesbackend.php

示例2: setRecoveryForUser

 /**
  * @param $enabled
  * @return bool
  */
 public function setRecoveryForUser($enabled)
 {
     $value = $enabled ? '1' : '0';
     try {
         $this->config->setUserValue($this->user->getUID(), 'encryption', 'recoveryEnabled', $value);
         return true;
     } catch (PreConditionNotMetException $e) {
         return false;
     }
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:14,代码来源:util.php

示例3: getMountsForUser

 /**
  * Get all mountpoints applicable for the user and check for shares where we need to update the etags
  *
  * @param \OCP\IUser $user
  * @param \OCP\Files\Storage\IStorageFactory $storageFactory
  * @return \OCP\Files\Mount\IMountPoint[]
  */
 public function getMountsForUser(IUser $user, IStorageFactory $storageFactory)
 {
     $shares = \OCP\Share::getItemsSharedWithUser('file', $user->getUID());
     $shares = array_filter($shares, function ($share) {
         return $share['permissions'] > 0;
     });
     $shares = array_map(function ($share) use($user, $storageFactory) {
         return new SharedMount('\\OC\\Files\\Storage\\Shared', '/' . $user->getUID() . '/' . $share['file_target'], array('share' => $share, 'user' => $user->getUID()), $storageFactory);
     }, $shares);
     // array_filter removes the null values from the array
     return array_filter($shares);
 }
开发者ID:evanjt,项目名称:core,代码行数:19,代码来源:mountprovider.php

示例4: getMountsForUser

 /**
  * Get the cache mount for a user
  *
  * @param IUser $user
  * @param IStorageFactory $loader
  * @return \OCP\Files\Mount\IMountPoint[]
  */
 public function getMountsForUser(IUser $user, IStorageFactory $loader)
 {
     $cacheBaseDir = $this->config->getSystemValue('cache_path', '');
     if ($cacheBaseDir !== '') {
         $cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user->getUID();
         if (!file_exists($cacheDir)) {
             mkdir($cacheDir, 0770, true);
         }
         return [new MountPoint('\\OC\\Files\\Storage\\Local', '/' . $user->getUID() . '/cache', ['datadir' => $cacheDir, $loader])];
     } else {
         return [];
     }
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:20,代码来源:CacheMountProvider.php

示例5: getMountsForUser

 /**
  * Get all mountpoints applicable for the user and check for shares where we need to update the etags
  *
  * @param \OCP\IUser $user
  * @param \OCP\Files\Storage\IStorageFactory $storageFactory
  * @return \OCP\Files\Mount\IMountPoint[]
  */
 public function getMountsForUser(IUser $user, IStorageFactory $storageFactory)
 {
     $shares = $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_USER, null, -1);
     $shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_GROUP, null, -1));
     $shares = array_filter($shares, function (\OCP\Share\IShare $share) {
         return $share->getPermissions() > 0;
     });
     $mounts = [];
     foreach ($shares as $share) {
         $mounts[] = new SharedMount('\\OC\\Files\\Storage\\Shared', $mounts, ['user' => $user->getUID(), 'newShare' => $share], $storageFactory);
     }
     // array_filter removes the null values from the array
     return array_filter($mounts);
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:21,代码来源:mountprovider.php

示例6: getDirtyMountPoints

 /**
  * Get all mountpoints we need to update the etag for
  *
  * @return string[]
  */
 protected function getDirtyMountPoints()
 {
     $dirty = array();
     $mountPoints = $this->config->getAppKeys('files_external');
     foreach ($mountPoints as $mountPoint) {
         if (substr($mountPoint, 0, 1) === '/') {
             $updateTime = $this->config->getAppValue('files_external', $mountPoint);
             $userTime = $this->config->getUserValue($this->user->getUID(), 'files_external', $mountPoint);
             if ($updateTime > $userTime) {
                 $dirty[] = $mountPoint;
             }
         }
     }
     return $dirty;
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:20,代码来源:etagpropagator.php

示例7: getMountsForUser

 /**
  * Get all mountpoints applicable for the user and check for shares where we need to update the etags
  *
  * @param \OCP\IUser $user
  * @param \OCP\Files\Storage\IStorageFactory $storageFactory
  * @return \OCP\Files\Mount\IMountPoint[]
  */
 public function getMountsForUser(IUser $user, IStorageFactory $storageFactory)
 {
     $shares = \OCP\Share::getItemsSharedWithUser('file', $user->getUID());
     $propagator = $this->propagationManager->getSharePropagator($user->getUID());
     $propagator->propagateDirtyMountPoints($shares);
     $shares = array_filter($shares, function ($share) {
         return $share['permissions'] > 0;
     });
     $shares = array_map(function ($share) use($user, $storageFactory) {
         // for updating etags for the share owner when we make changes to this share.
         $ownerPropagator = $this->propagationManager->getChangePropagator($share['uid_owner']);
         return new SharedMount('\\OC\\Files\\Storage\\Shared', '/' . $user->getUID() . '/' . $share['file_target'], array('propagationManager' => $this->propagationManager, 'propagator' => $ownerPropagator, 'share' => $share, 'user' => $user->getUID()), $storageFactory);
     }, $shares);
     // array_filter removes the null values from the array
     return array_filter($shares);
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:23,代码来源:mountprovider.php

示例8: onPostRemoveUser

 public function onPostRemoveUser(IGroup $group, IUser $targetUser)
 {
     $targetUserId = $targetUser->getUID();
     $sharesAfter = $this->getUserShares($targetUserId);
     $this->propagateSharesDiff($targetUserId, $this->userShares[$targetUserId], $sharesAfter);
     unset($this->userShares[$targetUserId]);
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:7,代码来源:grouppropagationmanager.php

示例9: getMountsForUser

 /**
  * Get all mountpoints applicable for the user and check for shares where we need to update the etags
  *
  * @param \OCP\IUser $user
  * @param \OCP\Files\Storage\IStorageFactory $storageFactory
  * @return \OCP\Files\Mount\IMountPoint[]
  */
 public function getMountsForUser(IUser $user, IStorageFactory $storageFactory)
 {
     $shares = \OCP\Share::getItemsSharedWithUser('file', $user->getUID());
     $propagator = $this->propagationManager->getSharePropagator($user->getUID());
     $propagator->propagateDirtyMountPoints($shares);
     $shares = array_filter($shares, function ($share) {
         return $share['permissions'] > 0;
     });
     return array_map(function ($share) use($user, $storageFactory) {
         Filesystem::initMountPoints($share['uid_owner']);
         // for updating etags for the share owner when we make changes to this share.
         $ownerPropagator = $this->propagationManager->getChangePropagator($share['uid_owner']);
         // for updating our etags when changes are made to the share from the owners side (probably indirectly by us trough another share)
         $this->propagationManager->listenToOwnerChanges($share['uid_owner'], $user->getUID());
         return new SharedMount('\\OC\\Files\\Storage\\Shared', '/' . $user->getUID() . '/' . $share['file_target'], array('propagator' => $ownerPropagator, 'share' => $share, 'user' => $user->getUID()), $storageFactory);
     }, $shares);
 }
开发者ID:brunomilet,项目名称:owncloud-core,代码行数:24,代码来源:mountprovider.php

示例10: testShowHiddenFiles

 public function testShowHiddenFiles()
 {
     $show = false;
     $this->config->expects($this->once())->method('setUserValue')->with($this->user->getUID(), 'files', 'show_hidden', $show);
     $expected = new Http\Response();
     $actual = $this->apiController->showHiddenFiles($show);
     $this->assertEquals($expected, $actual);
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:8,代码来源:ApiControllerTest.php

示例11: getHomeMountForUser

 /**
  * Get the cache mount for a user
  *
  * @param IUser $user
  * @param IStorageFactory $loader
  * @return \OCP\Files\Mount\IMountPoint[]
  */
 public function getHomeMountForUser(IUser $user, IStorageFactory $loader)
 {
     $arguments = ['user' => $user];
     if (\OC\Files\Cache\Storage::exists('local::' . $user->getHome() . '/')) {
         $arguments['legacy'] = true;
     }
     return new MountPoint('\\OC\\Files\\Storage\\Home', '/' . $user->getUID(), $arguments, $loader);
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:15,代码来源:LocalHomeMountProvider.php

示例12: __construct

 /**
  * @param IUser $user current user, must match the propagator's
  * user
  * @param \OC\Files\Cache\ChangePropagator $changePropagator change propagator
  * initialized with a view for $user
  * @param \OCP\IConfig $config
  * @param PropagationManager $manager
  * @param IGroupManager $groupManager
  */
 public function __construct(IUser $user, $changePropagator, $config, PropagationManager $manager, IGroupManager $groupManager)
 {
     $this->userId = $user->getUID();
     $this->user = $user;
     $this->changePropagator = $changePropagator;
     $this->config = $config;
     $this->manager = $manager;
     $this->groupManager = $groupManager;
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:18,代码来源:recipientpropagator.php

示例13: runScanner

 /**
  * @param IUser $user
  */
 protected function runScanner(IUser $user)
 {
     try {
         $scanner = new Scanner($user->getUID(), $this->dbConnection, $this->logger);
         $scanner->backgroundScan('');
     } catch (\Exception $e) {
         $this->logger->logException($e, ['app' => 'files']);
     }
     \OC_Util::tearDownFS();
 }
开发者ID:loulancn,项目名称:core,代码行数:13,代码来源:scanfiles.php

示例14: getMountsForUser

 /**
  * Get all mountpoints applicable for the user and check for shares where we need to update the etags
  *
  * @param \OCP\IUser $user
  * @param \OCP\Files\Storage\IStorageFactory $storageFactory
  * @return \OCP\Files\Mount\IMountPoint[]
  */
 public function getMountsForUser(IUser $user, IStorageFactory $storageFactory)
 {
     $shares = $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_USER, null, -1);
     $shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_GROUP, null, -1));
     // filter out excluded shares and group shares that includes self
     $shares = array_filter($shares, function (\OCP\Share\IShare $share) use($user) {
         return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID();
     });
     $mounts = [];
     foreach ($shares as $share) {
         try {
             $mounts[] = new SharedMount('\\OC\\Files\\Storage\\Shared', $mounts, ['user' => $user->getUID(), 'newShare' => $share], $storageFactory);
         } catch (\Exception $e) {
             $this->logger->logException($e);
             $this->logger->error('Error while trying to create shared mount');
         }
     }
     // array_filter removes the null values from the array
     return array_filter($mounts);
 }
开发者ID:drognisep,项目名称:Portfolio-Site,代码行数:27,代码来源:MountProvider.php

示例15: createKeyPair

 /**
  * create new private/public key-pair for user
  *
  * @return array|bool
  */
 public function createKeyPair()
 {
     $log = $this->logger;
     $res = $this->getOpenSSLPKey();
     if (!$res) {
         $log->error("Encryption Library couldn't generate users key-pair for {$this->user->getUID()}", ['app' => 'encryption']);
         if (openssl_error_string()) {
             $log->error('Encryption library openssl_pkey_new() fails: ' . openssl_error_string(), ['app' => 'encryption']);
         }
     } elseif (openssl_pkey_export($res, $privateKey, null, $this->getOpenSSLConfig())) {
         $keyDetails = openssl_pkey_get_details($res);
         $publicKey = $keyDetails['key'];
         return ['publicKey' => $publicKey, 'privateKey' => $privateKey];
     }
     $log->error('Encryption library couldn\'t export users private key, please check your servers OpenSSL configuration.' . $this->user->getUID(), ['app' => 'encryption']);
     if (openssl_error_string()) {
         $log->error('Encryption Library:' . openssl_error_string(), ['app' => 'encryption']);
     }
     return false;
 }
开发者ID:rosarion,项目名称:core,代码行数:25,代码来源:crypt.php


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