protected function setUp() { $this->backup = OC_Mount_Config::setUp(); // register dummy backend $result = OC_Mount_Config::registerBackend('Test_Mount_Config_Dummy_Backend', array('backend' => 'Test Dummy', 'configuration' => array(), 'has_dependencies' => true)); $this->assertTrue($result); }
protected function setUp() { parent::setUp(); OC_Mount_Config::registerBackend('Test_Mount_Config_Dummy_Storage', array('backend' => 'dummy', 'priority' => 150, 'configuration' => array())); \OC_User::createUser(self::TEST_USER1, self::TEST_USER1); \OC_User::createUser(self::TEST_USER2, self::TEST_USER2); \OC_Group::createGroup(self::TEST_GROUP1); \OC_Group::createGroup(self::TEST_GROUP1B); \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1); \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1B); \OC_Group::createGroup(self::TEST_GROUP2); \OC_Group::createGroup(self::TEST_GROUP2B); \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2); \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2B); \OC_User::setUserId(self::TEST_USER1); $this->userHome = \OC_User::getHome(self::TEST_USER1); @mkdir($this->userHome); $this->dataDir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/'); $this->oldAllowedBackends = OCP\Config::getAppValue('files_external', 'user_mounting_backends', ''); $this->allBackends = OC_Mount_Config::getBackends(); OCP\Config::setAppValue('files_external', 'user_mounting_backends', implode(',', array_keys($this->allBackends))); OC_Mount_Config::$skipTest = true; Test_Mount_Config_Hook_Test::setupHooks(); }
<?php /** * ownCloud - Files ConoHa * * @copyright 2015 Stylez Corp. <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ if (\OC_App::isEnabled('files_external') && \OC_App::isEnabled('files_external_conoha')) { $l = \OC::$server->getL10N('files_external_conoha'); $user = OC_User::getUser(); OC::$CLASSPATH['OC\\Files\\Storage\\ConoHa'] = 'files_external_conoha/lib/conoha.php'; OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; $version = OC_Util::getVersion(); // Support for ver 8.2 higher if ($version[0] >= 8 && $version[1] >= 2) { OC::$CLASSPATH['OCA\\Files\\External\\Api'] = 'files_external/lib/api.php'; OC::$CLASSPATH['OCA\\Files_External\\Lib\\Backend\\ConoHa'] = 'files_external_conoha/lib/backend/conoha.php'; $container = OC_Mount_Config::$app->getContainer(); $container->registerService('L10n', function ($c) use($l) { return $l; }); $service = $container->query('OCA\\Files_External\\Service\\BackendService'); $service->registerBackend($container->query('OCA\\Files_External\\Lib\\Backend\\ConoHa')); } else { OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\ConoHa', array('backend' => (string) $l->t('ConoHa Object Storage'), 'priority' => 100, 'configuration' => array('user' => (string) $l->t('Username'), 'password' => '&*' . $l->t('Password (required for ConoHa Object Storage)'), 'region' => '&' . $l->t('Region (optional for ConoHa Object Storage)'), 'url' => '&' . $l->t('URL of identity endpoint (required for ConoHa Object Storage)'), 'tenant' => '&' . $l->t('Tenantname (required for ConoHa Object Storage)'), 'service_name' => '&' . $l->t('Service Name (required for ConoHa Object Storage)'), 'bucket' => (string) $l->t('Bucket'), 'timeout' => '&' . $l->t('Timeout of HTTP requests in seconds')), 'has_dependencies' => true)); } }
OC::$CLASSPATH['OC\\Files\\Storage\\Dropbox'] = 'files_external/lib/dropbox.php'; OC::$CLASSPATH['OC\\Files\\Storage\\SFTP'] = 'files_external/lib/sftp.php'; OC::$CLASSPATH['OC\\Files\\Storage\\SFTP_Key'] = 'files_external/lib/sftp_key.php'; OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; OC::$CLASSPATH['OCA\\Files\\External\\Api'] = 'files_external/lib/api.php'; require_once __DIR__ . '/../3rdparty/autoload.php'; OCP\App::registerAdmin('files_external', 'settings'); if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == 'yes') { OCP\App::registerPersonal('files_external', 'personal'); } \OCA\Files\App::getNavigationManager()->add(["id" => 'extstoragemounts', "appname" => 'files_external', "script" => 'list.php', "order" => 30, "name" => $l->t('External storage')]); // connecting hooks OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\\OC_Mount_Config', 'initMountPointsHook'); OCP\Util::connectHook('OC_User', 'post_login', 'OC\\Files\\Storage\\SMB_OC', 'login'); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Local', ['backend' => (string) $l->t('Local'), 'priority' => 150, 'configuration' => ['datadir' => (string) $l->t('Location')]]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\AmazonS3', ['backend' => (string) $l->t('Amazon S3'), 'priority' => 100, 'configuration' => ['key' => (string) $l->t('Key'), 'secret' => '*' . $l->t('Secret'), 'bucket' => (string) $l->t('Bucket')], 'has_dependencies' => true]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\AmazonS3', ['backend' => (string) $l->t('Amazon S3 and compliant'), 'priority' => 100, 'configuration' => ['key' => (string) $l->t('Access Key'), 'secret' => '*' . $l->t('Secret Key'), 'bucket' => (string) $l->t('Bucket'), 'hostname' => '&' . $l->t('Hostname'), 'port' => '&' . $l->t('Port'), 'region' => '&' . $l->t('Region'), 'use_ssl' => '!' . $l->t('Enable SSL'), 'use_path_style' => '!' . $l->t('Enable Path Style')], 'has_dependencies' => true]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Dropbox', ['backend' => 'Dropbox', 'priority' => 100, 'configuration' => ['configured' => '#configured', 'app_key' => (string) $l->t('App key'), 'app_secret' => '*' . $l->t('App secret'), 'token' => '#token', 'token_secret' => '#token_secret'], 'custom' => 'dropbox', 'has_dependencies' => true]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\FTP', ['backend' => 'FTP', 'priority' => 100, 'configuration' => ['host' => (string) $l->t('Host'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'root' => '&' . $l->t('Remote subfolder'), 'secure' => '!' . $l->t('Secure ftps://')], 'has_dependencies' => true]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Google', ['backend' => 'Google Drive', 'priority' => 100, 'configuration' => ['configured' => '#configured', 'client_id' => (string) $l->t('Client ID'), 'client_secret' => '*' . $l->t('Client secret'), 'token' => '#token'], 'custom' => 'google', 'has_dependencies' => true]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Swift', ['backend' => (string) $l->t('OpenStack Object Storage'), 'priority' => 100, 'configuration' => ['user' => (string) $l->t('Username'), 'bucket' => (string) $l->t('Bucket'), 'region' => '&' . $l->t('Region (optional for OpenStack Object Storage)'), 'key' => '&*' . $l->t('API Key (required for Rackspace Cloud Files)'), 'tenant' => '&' . $l->t('Tenantname (required for OpenStack Object Storage)'), 'password' => '&*' . $l->t('Password (required for OpenStack Object Storage)'), 'service_name' => '&' . $l->t('Service Name (required for OpenStack Object Storage)'), 'url' => '&' . $l->t('URL of identity endpoint (required for OpenStack Object Storage)'), 'timeout' => '&' . $l->t('Timeout of HTTP requests in seconds')], 'has_dependencies' => true]); if (!OC_Util::runningOnWindows()) { OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\SMB', ['backend' => 'SMB / CIFS', 'priority' => 100, 'configuration' => ['host' => (string) $l->t('Host'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'share' => (string) $l->t('Share'), 'root' => '&' . $l->t('Remote subfolder')], 'has_dependencies' => true]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\SMB_OC', ['backend' => (string) $l->t('SMB / CIFS using OC login'), 'priority' => 90, 'configuration' => ['host' => (string) $l->t('Host'), 'username_as_share' => '!' . $l->t('Username as share'), 'share' => '&' . $l->t('Share'), 'root' => '&' . $l->t('Remote subfolder')], 'has_dependencies' => true]); } OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\DAV', ['backend' => 'WebDAV', 'priority' => 100, 'configuration' => ['host' => (string) $l->t('URL'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'root' => '&' . $l->t('Remote subfolder'), 'secure' => '!' . $l->t('Secure https://')], 'has_dependencies' => true]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\OwnCloud', ['backend' => 'ownCloud', 'priority' => 100, 'configuration' => ['host' => (string) $l->t('URL'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'root' => '&' . $l->t('Remote subfolder'), 'secure' => '!' . $l->t('Secure https://')]]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\SFTP', ['backend' => 'SFTP', 'priority' => 100, 'configuration' => ['host' => (string) $l->t('Host'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'root' => '&' . $l->t('Remote subfolder')]]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\SFTP_Key', ['backend' => 'SFTP with secret key login', 'priority' => 100, 'configuration' => array('host' => (string) $l->t('Host'), 'user' => (string) $l->t('Username'), 'public_key' => (string) $l->t('Public key'), 'private_key' => '#private_key', 'root' => '&' . $l->t('Remote subfolder')), 'custom' => 'sftp_key']); $mountProvider = new \OCA\Files_External\Config\ConfigAdapter(); \OC::$server->getMountProviderCollection()->registerProvider($mountProvider);
<?php /** * Copyright (c) 2013 Thomas Müller <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ $l = \OC_L10N::get('files_irods'); OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; // connecting hooks OCP\Util::connectHook('OC_User', 'post_login', 'OC\\Files\\Storage\\iRODS', 'login'); OC_Mount_Config::registerBackend('\\OCA\\Files_iRODS\\iRODS', array('backend' => 'iRODS', 'configuration' => array('host' => (string) $l->t('Host'), 'port' => (string) $l->t('Port'), 'use_logon_credentials' => '!' . $l->t('Use ownCloud login'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'auth_mode' => (string) $l->t('Authentication Mode'), 'zone' => (string) $l->t('Zone'), 'root' => (string) $l->t('Root'))));
OC::$CLASSPATH['OC\\Files\\Storage\\Swift'] = 'files_external/lib/swift.php'; OC::$CLASSPATH['OC\\Files\\Storage\\SMB'] = 'files_external/lib/smb.php'; OC::$CLASSPATH['OC\\Files\\Storage\\SMB_OC'] = 'files_external/lib/smb_oc.php'; OC::$CLASSPATH['OC\\Files\\Storage\\AmazonS3'] = 'files_external/lib/amazons3.php'; OC::$CLASSPATH['OC\\Files\\Storage\\Dropbox'] = 'files_external/lib/dropbox.php'; OC::$CLASSPATH['OC\\Files\\Storage\\SFTP'] = 'files_external/lib/sftp.php'; OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; OC::$CLASSPATH['OCA\\Files\\External\\Api'] = 'files_external/lib/api.php'; OCP\App::registerAdmin('files_external', 'settings'); if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == 'yes') { OCP\App::registerPersonal('files_external', 'personal'); } \OCA\Files\App::getNavigationManager()->add(array("id" => 'extstoragemounts', "appname" => 'files_external', "script" => 'list.php', "order" => 30, "name" => $l->t('External storage'))); // connecting hooks OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\\OC_Mount_Config', 'initMountPointsHook'); OCP\Util::connectHook('OC_User', 'post_login', 'OC\\Files\\Storage\\SMB_OC', 'login'); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Local', array('backend' => (string) $l->t('Local'), 'priority' => 150, 'configuration' => array('datadir' => (string) $l->t('Location')))); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\AmazonS3', array('backend' => (string) $l->t('Amazon S3'), 'priority' => 100, 'configuration' => array('key' => (string) $l->t('Key'), 'secret' => '*' . $l->t('Secret'), 'bucket' => (string) $l->t('Bucket')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\AmazonS3', array('backend' => (string) $l->t('Amazon S3 and compliant'), 'priority' => 100, 'configuration' => array('key' => (string) $l->t('Access Key'), 'secret' => '*' . $l->t('Secret Key'), 'bucket' => (string) $l->t('Bucket'), 'hostname' => '&' . $l->t('Hostname'), 'port' => '&' . $l->t('Port'), 'region' => '&' . $l->t('Region'), 'use_ssl' => '!' . $l->t('Enable SSL'), 'use_path_style' => '!' . $l->t('Enable Path Style')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Dropbox', array('backend' => 'Dropbox', 'priority' => 100, 'configuration' => array('configured' => '#configured', 'app_key' => (string) $l->t('App key'), 'app_secret' => '*' . $l->t('App secret'), 'token' => '#token', 'token_secret' => '#token_secret'), 'custom' => 'dropbox', 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\FTP', array('backend' => 'FTP', 'priority' => 100, 'configuration' => array('host' => (string) $l->t('Host'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'root' => '&' . $l->t('Root'), 'secure' => '!' . $l->t('Secure ftps://')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Google', array('backend' => 'Google Drive', 'priority' => 100, 'configuration' => array('configured' => '#configured', 'client_id' => (string) $l->t('Client ID'), 'client_secret' => '*' . $l->t('Client secret'), 'token' => '#token'), 'custom' => 'google', 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Swift', array('backend' => (string) $l->t('OpenStack Object Storage'), 'priority' => 100, 'configuration' => array('user' => (string) $l->t('Username'), 'bucket' => (string) $l->t('Bucket'), 'region' => '&' . $l->t('Region (optional for OpenStack Object Storage)'), 'key' => '&*' . $l->t('API Key (required for Rackspace Cloud Files)'), 'tenant' => '&' . $l->t('Tenantname (required for OpenStack Object Storage)'), 'password' => '&*' . $l->t('Password (required for OpenStack Object Storage)'), 'service_name' => '&' . $l->t('Service Name (required for OpenStack Object Storage)'), 'url' => '&' . $l->t('URL of identity endpoint (required for OpenStack Object Storage)'), 'timeout' => '&' . $l->t('Timeout of HTTP requests in seconds')), 'has_dependencies' => true)); if (!OC_Util::runningOnWindows()) { OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\SMB', array('backend' => 'SMB / CIFS', 'priority' => 100, 'configuration' => array('host' => (string) $l->t('Host'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'share' => (string) $l->t('Share'), 'root' => '&' . $l->t('Root')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\SMB_OC', array('backend' => (string) $l->t('SMB / CIFS using OC login'), 'priority' => 90, 'configuration' => array('host' => (string) $l->t('Host'), 'username_as_share' => '!' . $l->t('Username as share'), 'share' => '&' . $l->t('Share'), 'root' => '&' . $l->t('Root')), 'has_dependencies' => true)); } OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\DAV', array('backend' => 'WebDAV', 'priority' => 100, 'configuration' => array('host' => (string) $l->t('URL'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'root' => '&' . $l->t('Root'), 'secure' => '!' . $l->t('Secure https://')), 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\OwnCloud', array('backend' => 'ownCloud', 'priority' => 100, 'configuration' => array('host' => (string) $l->t('URL'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'root' => '&' . $l->t('Remote subfolder'), 'secure' => '!' . $l->t('Secure https://')))); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\SFTP', array('backend' => 'SFTP', 'priority' => 100, 'configuration' => array('host' => (string) $l->t('Host'), 'user' => (string) $l->t('Username'), 'password' => '*' . $l->t('Password'), 'root' => '&' . $l->t('Root'))));
<?php /** * Copyright (c) 2014, 2015 Alexandre Relange <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ $l = \OC::$server->getL10N('files_hubic'); OC::$CLASSPATH['OC\\Files\\Storage\\Hubic'] = 'files_hubic/lib/hubic.php'; \OCA\Files\App::getNavigationManager()->add(["id" => 'hubicstoragemounts', "appname" => 'files_hubic', "script" => 'list.php', "order" => 30, "name" => $l->t('Hubic External storage')]); OC_Mount_Config::registerBackend('\\OC\\Files\\Storage\\Hubic', ['backend' => (string) $l->t('Hubic'), 'priority' => 100, 'configuration' => ['configured' => '#configured', 'client_id' => (string) $l->t('Client ID'), 'client_secret' => '&*' . $l->t('Client secret'), 'hubic_token' => '#hubic token', 'swift_token' => '#swift token'], 'custom' => '../../files_hubic/js/hubic', 'has_dependencies' => true]);