示例#1
0
 /**
  * Process storage ready for mounting
  *
  * @param StorageConfig $storage
  * @param IUser $user
  */
 private function prepareStorageConfig(StorageConfig &$storage, IUser $user)
 {
     foreach ($storage->getBackendOptions() as $option => $value) {
         $storage->setBackendOption($option, \OC_Mount_Config::setUserVars($user->getUID(), $value));
     }
     $objectStore = $storage->getBackendOption('objectstore');
     if ($objectStore) {
         $objectClass = $objectStore['class'];
         $storage->setBackendOption('objectstore', new $objectClass($objectStore));
     }
     $storage->getAuthMechanism()->manipulateStorageConfig($storage);
     $storage->getBackend()->manipulateStorageConfig($storage);
 }
示例#2
0
 /**
  * Process storage ready for mounting
  *
  * @param StorageConfig $storage
  * @param IUser $user
  */
 private function prepareStorageConfig(StorageConfig &$storage, IUser $user)
 {
     foreach ($storage->getBackendOptions() as $option => $value) {
         $storage->setBackendOption($option, \OC_Mount_Config::setUserVars($user->getUID(), $value));
     }
     $objectStore = $storage->getBackendOption('objectstore');
     if ($objectStore) {
         $objectClass = $objectStore['class'];
         if (!is_subclass_of($objectClass, '\\OCP\\Files\\ObjectStore\\IObjectStore')) {
             throw new \InvalidArgumentException('Invalid object store');
         }
         $storage->setBackendOption('objectstore', new $objectClass($objectStore));
     }
     $storage->getAuthMechanism()->manipulateStorageConfig($storage);
     $storage->getBackend()->manipulateStorageConfig($storage);
 }