@@ -6,10 +6,10 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\ShareByMail\\Activity' => $baseDir . '/../lib/Activity.php', |
|
10 | - 'OCA\\ShareByMail\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
11 | - 'OCA\\ShareByMail\\Capabilities' => $baseDir . '/../lib/Capabilities.php', |
|
12 | - 'OCA\\ShareByMail\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
13 | - 'OCA\\ShareByMail\\Settings\\SettingsManager' => $baseDir . '/../lib/Settings/SettingsManager.php', |
|
14 | - 'OCA\\ShareByMail\\ShareByMailProvider' => $baseDir . '/../lib/ShareByMailProvider.php', |
|
9 | + 'OCA\\ShareByMail\\Activity' => $baseDir.'/../lib/Activity.php', |
|
10 | + 'OCA\\ShareByMail\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
11 | + 'OCA\\ShareByMail\\Capabilities' => $baseDir.'/../lib/Capabilities.php', |
|
12 | + 'OCA\\ShareByMail\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
13 | + 'OCA\\ShareByMail\\Settings\\SettingsManager' => $baseDir.'/../lib/Settings/SettingsManager.php', |
|
14 | + 'OCA\\ShareByMail\\ShareByMailProvider' => $baseDir.'/../lib/ShareByMailProvider.php', |
|
15 | 15 | ); |
@@ -6,32 +6,32 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitShareByMail |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\ShareByMail\\' => 16, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\ShareByMail\\' => |
18 | - array ( |
|
19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
18 | + array( |
|
19 | + 0 => __DIR__.'/..'.'/../lib', |
|
20 | 20 | ), |
21 | 21 | ); |
22 | 22 | |
23 | - public static $classMap = array ( |
|
24 | - 'OCA\\ShareByMail\\Activity' => __DIR__ . '/..' . '/../lib/Activity.php', |
|
25 | - 'OCA\\ShareByMail\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
26 | - 'OCA\\ShareByMail\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php', |
|
27 | - 'OCA\\ShareByMail\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
28 | - 'OCA\\ShareByMail\\Settings\\SettingsManager' => __DIR__ . '/..' . '/../lib/Settings/SettingsManager.php', |
|
29 | - 'OCA\\ShareByMail\\ShareByMailProvider' => __DIR__ . '/..' . '/../lib/ShareByMailProvider.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'OCA\\ShareByMail\\Activity' => __DIR__.'/..'.'/../lib/Activity.php', |
|
25 | + 'OCA\\ShareByMail\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
26 | + 'OCA\\ShareByMail\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php', |
|
27 | + 'OCA\\ShareByMail\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
28 | + 'OCA\\ShareByMail\\Settings\\SettingsManager' => __DIR__.'/..'.'/../lib/Settings/SettingsManager.php', |
|
29 | + 'OCA\\ShareByMail\\ShareByMailProvider' => __DIR__.'/..'.'/../lib/ShareByMailProvider.php', |
|
30 | 30 | ); |
31 | 31 | |
32 | 32 | public static function getInitializer(ClassLoader $loader) |
33 | 33 | { |
34 | - return \Closure::bind(function () use ($loader) { |
|
34 | + return \Closure::bind(function() use ($loader) { |
|
35 | 35 | $loader->prefixLengthsPsr4 = ComposerStaticInitShareByMail::$prefixLengthsPsr4; |
36 | 36 | $loader->prefixDirsPsr4 = ComposerStaticInitShareByMail::$prefixDirsPsr4; |
37 | 37 | $loader->classMap = ComposerStaticInitShareByMail::$classMap; |
@@ -29,34 +29,34 @@ |
||
29 | 29 | |
30 | 30 | class SettingsManager { |
31 | 31 | |
32 | - /** @var IConfig */ |
|
33 | - private $config; |
|
34 | - |
|
35 | - private $sendPasswordByMailDefault = 'yes'; |
|
36 | - |
|
37 | - private $enforcePasswordProtectionDefault = 'no'; |
|
38 | - |
|
39 | - public function __construct(IConfig $config) { |
|
40 | - $this->config = $config; |
|
41 | - } |
|
42 | - |
|
43 | - /** |
|
44 | - * should the password for a mail share be send to the recipient |
|
45 | - * |
|
46 | - * @return bool |
|
47 | - */ |
|
48 | - public function sendPasswordByMail(): bool { |
|
49 | - $sendPasswordByMail = $this->config->getAppValue('sharebymail', 'sendpasswordmail', $this->sendPasswordByMailDefault); |
|
50 | - return $sendPasswordByMail === 'yes'; |
|
51 | - } |
|
52 | - |
|
53 | - /** |
|
54 | - * do we require a share by mail to be password protected |
|
55 | - * |
|
56 | - * @return bool |
|
57 | - */ |
|
58 | - public function enforcePasswordProtection(): bool { |
|
59 | - $enforcePassword = $this->config->getAppValue('sharebymail', 'enforcePasswordProtection', $this->enforcePasswordProtectionDefault); |
|
60 | - return $enforcePassword === 'yes'; |
|
61 | - } |
|
32 | + /** @var IConfig */ |
|
33 | + private $config; |
|
34 | + |
|
35 | + private $sendPasswordByMailDefault = 'yes'; |
|
36 | + |
|
37 | + private $enforcePasswordProtectionDefault = 'no'; |
|
38 | + |
|
39 | + public function __construct(IConfig $config) { |
|
40 | + $this->config = $config; |
|
41 | + } |
|
42 | + |
|
43 | + /** |
|
44 | + * should the password for a mail share be send to the recipient |
|
45 | + * |
|
46 | + * @return bool |
|
47 | + */ |
|
48 | + public function sendPasswordByMail(): bool { |
|
49 | + $sendPasswordByMail = $this->config->getAppValue('sharebymail', 'sendpasswordmail', $this->sendPasswordByMailDefault); |
|
50 | + return $sendPasswordByMail === 'yes'; |
|
51 | + } |
|
52 | + |
|
53 | + /** |
|
54 | + * do we require a share by mail to be password protected |
|
55 | + * |
|
56 | + * @return bool |
|
57 | + */ |
|
58 | + public function enforcePasswordProtection(): bool { |
|
59 | + $enforcePassword = $this->config->getAppValue('sharebymail', 'enforcePasswordProtection', $this->enforcePasswordProtectionDefault); |
|
60 | + return $enforcePassword === 'yes'; |
|
61 | + } |
|
62 | 62 | } |
@@ -35,16 +35,16 @@ |
||
35 | 35 | use OCP\AppFramework\Bootstrap\IRegistrationContext; |
36 | 36 | |
37 | 37 | class Application extends App implements IBootstrap { |
38 | - public const APP_ID = 'sharebymail'; |
|
38 | + public const APP_ID = 'sharebymail'; |
|
39 | 39 | |
40 | - public function __construct() { |
|
41 | - parent::__construct(self::APP_ID); |
|
42 | - } |
|
40 | + public function __construct() { |
|
41 | + parent::__construct(self::APP_ID); |
|
42 | + } |
|
43 | 43 | |
44 | - public function register(IRegistrationContext $context): void { |
|
45 | - $context->registerCapability(Capabilities::class); |
|
46 | - } |
|
44 | + public function register(IRegistrationContext $context): void { |
|
45 | + $context->registerCapability(Capabilities::class); |
|
46 | + } |
|
47 | 47 | |
48 | - public function boot(IBootContext $context): void { |
|
49 | - } |
|
48 | + public function boot(IBootContext $context): void { |
|
49 | + } |
|
50 | 50 | } |
@@ -30,32 +30,32 @@ |
||
30 | 30 | |
31 | 31 | class Capabilities implements ICapability { |
32 | 32 | |
33 | - /** @var SettingsManager */ |
|
34 | - private $manager; |
|
33 | + /** @var SettingsManager */ |
|
34 | + private $manager; |
|
35 | 35 | |
36 | - public function __construct(SettingsManager $manager) { |
|
37 | - $this->manager = $manager; |
|
38 | - } |
|
36 | + public function __construct(SettingsManager $manager) { |
|
37 | + $this->manager = $manager; |
|
38 | + } |
|
39 | 39 | |
40 | - public function getCapabilities(): array { |
|
41 | - return [ |
|
42 | - 'files_sharing' => |
|
43 | - [ |
|
44 | - 'sharebymail' => |
|
45 | - [ |
|
46 | - 'enabled' => true, |
|
47 | - 'upload_files_drop' => [ |
|
48 | - 'enabled' => true, |
|
49 | - ], |
|
50 | - 'password' => [ |
|
51 | - 'enabled' => true, |
|
52 | - 'enforced' => $this->manager->enforcePasswordProtection(), |
|
53 | - ], |
|
54 | - 'expire_date' => [ |
|
55 | - 'enabled' => true, |
|
56 | - ], |
|
57 | - ] |
|
58 | - ] |
|
59 | - ]; |
|
60 | - } |
|
40 | + public function getCapabilities(): array { |
|
41 | + return [ |
|
42 | + 'files_sharing' => |
|
43 | + [ |
|
44 | + 'sharebymail' => |
|
45 | + [ |
|
46 | + 'enabled' => true, |
|
47 | + 'upload_files_drop' => [ |
|
48 | + 'enabled' => true, |
|
49 | + ], |
|
50 | + 'password' => [ |
|
51 | + 'enabled' => true, |
|
52 | + 'enforced' => $this->manager->enforcePasswordProtection(), |
|
53 | + ], |
|
54 | + 'expire_date' => [ |
|
55 | + 'enabled' => true, |
|
56 | + ], |
|
57 | + ] |
|
58 | + ] |
|
59 | + ]; |
|
60 | + } |
|
61 | 61 | } |