@@ -35,80 +35,80 @@ |
||
35 | 35 | |
36 | 36 | class ActionProviderStore { |
37 | 37 | |
38 | - /** @var IServerContainer */ |
|
39 | - private $serverContainer; |
|
40 | - |
|
41 | - /** @var AppManager */ |
|
42 | - private $appManager; |
|
43 | - |
|
44 | - /** @var ILogger */ |
|
45 | - private $logger; |
|
46 | - |
|
47 | - /** |
|
48 | - * @param IServerContainer $serverContainer |
|
49 | - * @param AppManager $appManager |
|
50 | - * @param ILogger $logger |
|
51 | - */ |
|
52 | - public function __construct(IServerContainer $serverContainer, AppManager $appManager, ILogger $logger) { |
|
53 | - $this->serverContainer = $serverContainer; |
|
54 | - $this->appManager = $appManager; |
|
55 | - $this->logger = $logger; |
|
56 | - } |
|
57 | - |
|
58 | - /** |
|
59 | - * @param IUser $user |
|
60 | - * @return IProvider[] |
|
61 | - * @throws Exception |
|
62 | - */ |
|
63 | - public function getProviders(IUser $user) { |
|
64 | - $appClasses = $this->getAppProviderClasses($user); |
|
65 | - $providerClasses = $this->getServerProviderClasses(); |
|
66 | - $allClasses = array_merge($providerClasses, $appClasses); |
|
67 | - $providers = []; |
|
68 | - |
|
69 | - foreach ($allClasses as $class) { |
|
70 | - try { |
|
71 | - $providers[] = $this->serverContainer->query($class); |
|
72 | - } catch (QueryException $ex) { |
|
73 | - $this->logger->logException($ex, [ |
|
74 | - 'message' => "Could not load contacts menu action provider $class", |
|
75 | - 'app' => 'core', |
|
76 | - ]); |
|
77 | - throw new Exception("Could not load contacts menu action provider"); |
|
78 | - } |
|
79 | - } |
|
80 | - |
|
81 | - return $providers; |
|
82 | - } |
|
83 | - |
|
84 | - /** |
|
85 | - * @return string[] |
|
86 | - */ |
|
87 | - private function getServerProviderClasses() { |
|
88 | - return [ |
|
89 | - EMailProvider::class, |
|
90 | - ]; |
|
91 | - } |
|
92 | - |
|
93 | - /** |
|
94 | - * @param IUser $user |
|
95 | - * @return string[] |
|
96 | - */ |
|
97 | - private function getAppProviderClasses(IUser $user) { |
|
98 | - return array_reduce($this->appManager->getEnabledAppsForUser($user), function($all, $appId) { |
|
99 | - $info = $this->appManager->getAppInfo($appId); |
|
100 | - |
|
101 | - if (!isset($info['contactsmenu']) || !isset($info['contactsmenu'])) { |
|
102 | - // Nothing to add |
|
103 | - return $all; |
|
104 | - } |
|
105 | - |
|
106 | - $providers = array_reduce($info['contactsmenu'], function($all, $provider) { |
|
107 | - return array_merge($all, [$provider]); |
|
108 | - }, []); |
|
109 | - |
|
110 | - return array_merge($all, $providers); |
|
111 | - }, []); |
|
112 | - } |
|
38 | + /** @var IServerContainer */ |
|
39 | + private $serverContainer; |
|
40 | + |
|
41 | + /** @var AppManager */ |
|
42 | + private $appManager; |
|
43 | + |
|
44 | + /** @var ILogger */ |
|
45 | + private $logger; |
|
46 | + |
|
47 | + /** |
|
48 | + * @param IServerContainer $serverContainer |
|
49 | + * @param AppManager $appManager |
|
50 | + * @param ILogger $logger |
|
51 | + */ |
|
52 | + public function __construct(IServerContainer $serverContainer, AppManager $appManager, ILogger $logger) { |
|
53 | + $this->serverContainer = $serverContainer; |
|
54 | + $this->appManager = $appManager; |
|
55 | + $this->logger = $logger; |
|
56 | + } |
|
57 | + |
|
58 | + /** |
|
59 | + * @param IUser $user |
|
60 | + * @return IProvider[] |
|
61 | + * @throws Exception |
|
62 | + */ |
|
63 | + public function getProviders(IUser $user) { |
|
64 | + $appClasses = $this->getAppProviderClasses($user); |
|
65 | + $providerClasses = $this->getServerProviderClasses(); |
|
66 | + $allClasses = array_merge($providerClasses, $appClasses); |
|
67 | + $providers = []; |
|
68 | + |
|
69 | + foreach ($allClasses as $class) { |
|
70 | + try { |
|
71 | + $providers[] = $this->serverContainer->query($class); |
|
72 | + } catch (QueryException $ex) { |
|
73 | + $this->logger->logException($ex, [ |
|
74 | + 'message' => "Could not load contacts menu action provider $class", |
|
75 | + 'app' => 'core', |
|
76 | + ]); |
|
77 | + throw new Exception("Could not load contacts menu action provider"); |
|
78 | + } |
|
79 | + } |
|
80 | + |
|
81 | + return $providers; |
|
82 | + } |
|
83 | + |
|
84 | + /** |
|
85 | + * @return string[] |
|
86 | + */ |
|
87 | + private function getServerProviderClasses() { |
|
88 | + return [ |
|
89 | + EMailProvider::class, |
|
90 | + ]; |
|
91 | + } |
|
92 | + |
|
93 | + /** |
|
94 | + * @param IUser $user |
|
95 | + * @return string[] |
|
96 | + */ |
|
97 | + private function getAppProviderClasses(IUser $user) { |
|
98 | + return array_reduce($this->appManager->getEnabledAppsForUser($user), function($all, $appId) { |
|
99 | + $info = $this->appManager->getAppInfo($appId); |
|
100 | + |
|
101 | + if (!isset($info['contactsmenu']) || !isset($info['contactsmenu'])) { |
|
102 | + // Nothing to add |
|
103 | + return $all; |
|
104 | + } |
|
105 | + |
|
106 | + $providers = array_reduce($info['contactsmenu'], function($all, $provider) { |
|
107 | + return array_merge($all, [$provider]); |
|
108 | + }, []); |
|
109 | + |
|
110 | + return array_merge($all, $providers); |
|
111 | + }, []); |
|
112 | + } |
|
113 | 113 | |
114 | 114 | } |
@@ -24,56 +24,56 @@ |
||
24 | 24 | use OCP\Lockdown\ILockdownManager; |
25 | 25 | |
26 | 26 | class LockdownManager implements ILockdownManager { |
27 | - /** @var ISession */ |
|
28 | - private $sessionCallback; |
|
27 | + /** @var ISession */ |
|
28 | + private $sessionCallback; |
|
29 | 29 | |
30 | - private $enabled = false; |
|
30 | + private $enabled = false; |
|
31 | 31 | |
32 | - /** @var array|null */ |
|
33 | - private $scope; |
|
32 | + /** @var array|null */ |
|
33 | + private $scope; |
|
34 | 34 | |
35 | - /** |
|
36 | - * LockdownManager constructor. |
|
37 | - * |
|
38 | - * @param callable $sessionCallback we need to inject the session lazily to avoid dependency loops |
|
39 | - */ |
|
40 | - public function __construct(callable $sessionCallback) { |
|
41 | - $this->sessionCallback = $sessionCallback; |
|
42 | - } |
|
35 | + /** |
|
36 | + * LockdownManager constructor. |
|
37 | + * |
|
38 | + * @param callable $sessionCallback we need to inject the session lazily to avoid dependency loops |
|
39 | + */ |
|
40 | + public function __construct(callable $sessionCallback) { |
|
41 | + $this->sessionCallback = $sessionCallback; |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | - public function enable() { |
|
46 | - $this->enabled = true; |
|
47 | - } |
|
45 | + public function enable() { |
|
46 | + $this->enabled = true; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @return ISession |
|
51 | - */ |
|
52 | - private function getSession() { |
|
53 | - $callback = $this->sessionCallback; |
|
54 | - return $callback(); |
|
55 | - } |
|
49 | + /** |
|
50 | + * @return ISession |
|
51 | + */ |
|
52 | + private function getSession() { |
|
53 | + $callback = $this->sessionCallback; |
|
54 | + return $callback(); |
|
55 | + } |
|
56 | 56 | |
57 | - private function getScopeAsArray() { |
|
58 | - if (!$this->scope) { |
|
59 | - $session = $this->getSession(); |
|
60 | - $sessionScope = $session->get('token_scope'); |
|
61 | - if ($sessionScope) { |
|
62 | - $this->scope = $sessionScope; |
|
63 | - } |
|
64 | - } |
|
65 | - return $this->scope; |
|
66 | - } |
|
57 | + private function getScopeAsArray() { |
|
58 | + if (!$this->scope) { |
|
59 | + $session = $this->getSession(); |
|
60 | + $sessionScope = $session->get('token_scope'); |
|
61 | + if ($sessionScope) { |
|
62 | + $this->scope = $sessionScope; |
|
63 | + } |
|
64 | + } |
|
65 | + return $this->scope; |
|
66 | + } |
|
67 | 67 | |
68 | - public function setToken(IToken $token) { |
|
69 | - $this->scope = $token->getScopeAsArray(); |
|
70 | - $session = $this->getSession(); |
|
71 | - $session->set('token_scope', $this->scope); |
|
72 | - $this->enable(); |
|
73 | - } |
|
68 | + public function setToken(IToken $token) { |
|
69 | + $this->scope = $token->getScopeAsArray(); |
|
70 | + $session = $this->getSession(); |
|
71 | + $session->set('token_scope', $this->scope); |
|
72 | + $this->enable(); |
|
73 | + } |
|
74 | 74 | |
75 | - public function canAccessFilesystem() { |
|
76 | - $scope = $this->getScopeAsArray(); |
|
77 | - return !$scope || $scope['filesystem']; |
|
78 | - } |
|
75 | + public function canAccessFilesystem() { |
|
76 | + $scope = $this->getScopeAsArray(); |
|
77 | + return !$scope || $scope['filesystem']; |
|
78 | + } |
|
79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return TemplateResponse|RedirectResponse |
86 | 86 | */ |
87 | 87 | public function showRenewPasswordForm($user) { |
88 | - if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
88 | + if ($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
89 | 89 | return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
90 | 90 | } |
91 | 91 | $parameters = []; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @return RedirectResponse |
130 | 130 | */ |
131 | 131 | public function tryRenewPassword($user, $oldPassword, $newPassword) { |
132 | - if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
132 | + if ($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
133 | 133 | return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
134 | 134 | } |
135 | 135 | $args = !is_null($user) ? ['user' => $user] : []; |
@@ -37,144 +37,144 @@ |
||
37 | 37 | use OCP\IUserManager; |
38 | 38 | |
39 | 39 | class RenewPasswordController extends Controller { |
40 | - /** @var IUserManager */ |
|
41 | - private $userManager; |
|
42 | - /** @var IConfig */ |
|
43 | - private $config; |
|
44 | - /** @var IL10N */ |
|
45 | - protected $l10n; |
|
46 | - /** @var ISession */ |
|
47 | - private $session; |
|
48 | - /** @var IURLGenerator */ |
|
49 | - private $urlGenerator; |
|
40 | + /** @var IUserManager */ |
|
41 | + private $userManager; |
|
42 | + /** @var IConfig */ |
|
43 | + private $config; |
|
44 | + /** @var IL10N */ |
|
45 | + protected $l10n; |
|
46 | + /** @var ISession */ |
|
47 | + private $session; |
|
48 | + /** @var IURLGenerator */ |
|
49 | + private $urlGenerator; |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param string $appName |
|
53 | - * @param IRequest $request |
|
54 | - * @param IUserManager $userManager |
|
55 | - * @param IConfig $config |
|
56 | - * @param IURLGenerator $urlGenerator |
|
57 | - */ |
|
58 | - function __construct($appName, IRequest $request, IUserManager $userManager, |
|
59 | - IConfig $config, IL10N $l10n, ISession $session, IURLGenerator $urlGenerator) { |
|
60 | - parent::__construct($appName, $request); |
|
61 | - $this->userManager = $userManager; |
|
62 | - $this->config = $config; |
|
63 | - $this->l10n = $l10n; |
|
64 | - $this->session = $session; |
|
65 | - $this->urlGenerator = $urlGenerator; |
|
66 | - } |
|
51 | + /** |
|
52 | + * @param string $appName |
|
53 | + * @param IRequest $request |
|
54 | + * @param IUserManager $userManager |
|
55 | + * @param IConfig $config |
|
56 | + * @param IURLGenerator $urlGenerator |
|
57 | + */ |
|
58 | + function __construct($appName, IRequest $request, IUserManager $userManager, |
|
59 | + IConfig $config, IL10N $l10n, ISession $session, IURLGenerator $urlGenerator) { |
|
60 | + parent::__construct($appName, $request); |
|
61 | + $this->userManager = $userManager; |
|
62 | + $this->config = $config; |
|
63 | + $this->l10n = $l10n; |
|
64 | + $this->session = $session; |
|
65 | + $this->urlGenerator = $urlGenerator; |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * @PublicPage |
|
70 | - * @NoCSRFRequired |
|
71 | - * |
|
72 | - * @return RedirectResponse |
|
73 | - */ |
|
74 | - public function cancel() { |
|
75 | - return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
|
76 | - } |
|
68 | + /** |
|
69 | + * @PublicPage |
|
70 | + * @NoCSRFRequired |
|
71 | + * |
|
72 | + * @return RedirectResponse |
|
73 | + */ |
|
74 | + public function cancel() { |
|
75 | + return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
|
76 | + } |
|
77 | 77 | |
78 | - /** |
|
79 | - * @PublicPage |
|
80 | - * @NoCSRFRequired |
|
81 | - * @UseSession |
|
82 | - * |
|
83 | - * @param string $user |
|
84 | - * |
|
85 | - * @return TemplateResponse|RedirectResponse |
|
86 | - */ |
|
87 | - public function showRenewPasswordForm($user) { |
|
88 | - if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
89 | - return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
|
90 | - } |
|
91 | - $parameters = []; |
|
92 | - $renewPasswordMessages = $this->session->get('renewPasswordMessages'); |
|
93 | - $errors = []; |
|
94 | - $messages = []; |
|
95 | - if (is_array($renewPasswordMessages)) { |
|
96 | - list($errors, $messages) = $renewPasswordMessages; |
|
97 | - } |
|
98 | - $this->session->remove('renewPasswordMessages'); |
|
99 | - foreach ($errors as $value) { |
|
100 | - $parameters[$value] = true; |
|
101 | - } |
|
78 | + /** |
|
79 | + * @PublicPage |
|
80 | + * @NoCSRFRequired |
|
81 | + * @UseSession |
|
82 | + * |
|
83 | + * @param string $user |
|
84 | + * |
|
85 | + * @return TemplateResponse|RedirectResponse |
|
86 | + */ |
|
87 | + public function showRenewPasswordForm($user) { |
|
88 | + if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
89 | + return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
|
90 | + } |
|
91 | + $parameters = []; |
|
92 | + $renewPasswordMessages = $this->session->get('renewPasswordMessages'); |
|
93 | + $errors = []; |
|
94 | + $messages = []; |
|
95 | + if (is_array($renewPasswordMessages)) { |
|
96 | + list($errors, $messages) = $renewPasswordMessages; |
|
97 | + } |
|
98 | + $this->session->remove('renewPasswordMessages'); |
|
99 | + foreach ($errors as $value) { |
|
100 | + $parameters[$value] = true; |
|
101 | + } |
|
102 | 102 | |
103 | - $parameters['messages'] = $messages; |
|
104 | - $parameters['user'] = $user; |
|
103 | + $parameters['messages'] = $messages; |
|
104 | + $parameters['user'] = $user; |
|
105 | 105 | |
106 | - $parameters['canResetPassword'] = true; |
|
107 | - $parameters['resetPasswordLink'] = $this->config->getSystemValue('lost_password_link', ''); |
|
108 | - if (!$parameters['resetPasswordLink']) { |
|
109 | - $userObj = $this->userManager->get($user); |
|
110 | - if ($userObj instanceof IUser) { |
|
111 | - $parameters['canResetPassword'] = $userObj->canChangePassword(); |
|
112 | - } |
|
113 | - } |
|
114 | - $parameters['cancelLink'] = $this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'); |
|
106 | + $parameters['canResetPassword'] = true; |
|
107 | + $parameters['resetPasswordLink'] = $this->config->getSystemValue('lost_password_link', ''); |
|
108 | + if (!$parameters['resetPasswordLink']) { |
|
109 | + $userObj = $this->userManager->get($user); |
|
110 | + if ($userObj instanceof IUser) { |
|
111 | + $parameters['canResetPassword'] = $userObj->canChangePassword(); |
|
112 | + } |
|
113 | + } |
|
114 | + $parameters['cancelLink'] = $this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'); |
|
115 | 115 | |
116 | - return new TemplateResponse( |
|
117 | - $this->appName, 'renewpassword', $parameters, 'guest' |
|
118 | - ); |
|
119 | - } |
|
116 | + return new TemplateResponse( |
|
117 | + $this->appName, 'renewpassword', $parameters, 'guest' |
|
118 | + ); |
|
119 | + } |
|
120 | 120 | |
121 | - /** |
|
122 | - * @PublicPage |
|
123 | - * @UseSession |
|
124 | - * |
|
125 | - * @param string $user |
|
126 | - * @param string $oldPassword |
|
127 | - * @param string $newPassword |
|
128 | - * |
|
129 | - * @return RedirectResponse |
|
130 | - */ |
|
131 | - public function tryRenewPassword($user, $oldPassword, $newPassword) { |
|
132 | - if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
133 | - return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
|
134 | - } |
|
135 | - $args = !is_null($user) ? ['user' => $user] : []; |
|
136 | - $loginResult = $this->userManager->checkPassword($user, $oldPassword); |
|
137 | - if ($loginResult === false) { |
|
138 | - $this->session->set('renewPasswordMessages', [ |
|
139 | - ['invalidpassword'], [] |
|
140 | - ]); |
|
141 | - return new RedirectResponse($this->urlGenerator->linkToRoute('user_ldap.renewPassword.showRenewPasswordForm', $args)); |
|
142 | - } |
|
121 | + /** |
|
122 | + * @PublicPage |
|
123 | + * @UseSession |
|
124 | + * |
|
125 | + * @param string $user |
|
126 | + * @param string $oldPassword |
|
127 | + * @param string $newPassword |
|
128 | + * |
|
129 | + * @return RedirectResponse |
|
130 | + */ |
|
131 | + public function tryRenewPassword($user, $oldPassword, $newPassword) { |
|
132 | + if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
133 | + return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
|
134 | + } |
|
135 | + $args = !is_null($user) ? ['user' => $user] : []; |
|
136 | + $loginResult = $this->userManager->checkPassword($user, $oldPassword); |
|
137 | + if ($loginResult === false) { |
|
138 | + $this->session->set('renewPasswordMessages', [ |
|
139 | + ['invalidpassword'], [] |
|
140 | + ]); |
|
141 | + return new RedirectResponse($this->urlGenerator->linkToRoute('user_ldap.renewPassword.showRenewPasswordForm', $args)); |
|
142 | + } |
|
143 | 143 | |
144 | - try { |
|
145 | - if (!is_null($newPassword) && \OC_User::setPassword($user, $newPassword)) { |
|
146 | - $this->session->set('loginMessages', [ |
|
147 | - [], [$this->l10n->t("Please login with the new password")] |
|
148 | - ]); |
|
149 | - $this->config->setUserValue($user, 'user_ldap', 'needsPasswordReset', 'false'); |
|
150 | - return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args)); |
|
151 | - } else { |
|
152 | - $this->session->set('renewPasswordMessages', [ |
|
153 | - ['internalexception'], [] |
|
154 | - ]); |
|
155 | - } |
|
156 | - } catch (HintException $e) { |
|
157 | - $this->session->set('renewPasswordMessages', [ |
|
158 | - [], [$e->getHint()] |
|
159 | - ]); |
|
160 | - } |
|
144 | + try { |
|
145 | + if (!is_null($newPassword) && \OC_User::setPassword($user, $newPassword)) { |
|
146 | + $this->session->set('loginMessages', [ |
|
147 | + [], [$this->l10n->t("Please login with the new password")] |
|
148 | + ]); |
|
149 | + $this->config->setUserValue($user, 'user_ldap', 'needsPasswordReset', 'false'); |
|
150 | + return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args)); |
|
151 | + } else { |
|
152 | + $this->session->set('renewPasswordMessages', [ |
|
153 | + ['internalexception'], [] |
|
154 | + ]); |
|
155 | + } |
|
156 | + } catch (HintException $e) { |
|
157 | + $this->session->set('renewPasswordMessages', [ |
|
158 | + [], [$e->getHint()] |
|
159 | + ]); |
|
160 | + } |
|
161 | 161 | |
162 | - return new RedirectResponse($this->urlGenerator->linkToRoute('user_ldap.renewPassword.showRenewPasswordForm', $args)); |
|
163 | - } |
|
162 | + return new RedirectResponse($this->urlGenerator->linkToRoute('user_ldap.renewPassword.showRenewPasswordForm', $args)); |
|
163 | + } |
|
164 | 164 | |
165 | - /** |
|
166 | - * @PublicPage |
|
167 | - * @NoCSRFRequired |
|
168 | - * @UseSession |
|
169 | - * |
|
170 | - * @return RedirectResponse |
|
171 | - */ |
|
172 | - public function showLoginFormInvalidPassword($user) { |
|
173 | - $args = !is_null($user) ? ['user' => $user] : []; |
|
174 | - $this->session->set('loginMessages', [ |
|
175 | - ['invalidpassword'], [] |
|
176 | - ]); |
|
177 | - return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args)); |
|
178 | - } |
|
165 | + /** |
|
166 | + * @PublicPage |
|
167 | + * @NoCSRFRequired |
|
168 | + * @UseSession |
|
169 | + * |
|
170 | + * @return RedirectResponse |
|
171 | + */ |
|
172 | + public function showLoginFormInvalidPassword($user) { |
|
173 | + $args = !is_null($user) ? ['user' => $user] : []; |
|
174 | + $this->session->set('loginMessages', [ |
|
175 | + ['invalidpassword'], [] |
|
176 | + ]); |
|
177 | + return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args)); |
|
178 | + } |
|
179 | 179 | |
180 | 180 | } |
@@ -29,10 +29,10 @@ |
||
29 | 29 | */ |
30 | 30 | interface IProvider { |
31 | 31 | |
32 | - /** |
|
33 | - * @since 12.0 |
|
34 | - * @param IEntry $entry |
|
35 | - * @return void |
|
36 | - */ |
|
37 | - public function process(IEntry $entry); |
|
32 | + /** |
|
33 | + * @since 12.0 |
|
34 | + * @param IEntry $entry |
|
35 | + * @return void |
|
36 | + */ |
|
37 | + public function process(IEntry $entry); |
|
38 | 38 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | */ |
33 | 33 | interface IShareHelper { |
34 | 34 | |
35 | - /** |
|
36 | - * @param Node $node |
|
37 | - * @return array [ users => [Mapping $uid => $pathForUser], remotes => [Mapping $cloudId => $pathToMountRoot]] |
|
38 | - * @since 12 |
|
39 | - */ |
|
40 | - public function getPathsForAccessList(Node $node); |
|
35 | + /** |
|
36 | + * @param Node $node |
|
37 | + * @return array [ users => [Mapping $uid => $pathForUser], remotes => [Mapping $cloudId => $pathToMountRoot]] |
|
38 | + * @since 12 |
|
39 | + */ |
|
40 | + public function getPathsForAccessList(Node $node); |
|
41 | 41 | } |
@@ -27,24 +27,24 @@ |
||
27 | 27 | |
28 | 28 | class Capabilities implements ICapability { |
29 | 29 | |
30 | - /** |
|
31 | - * Function an app uses to return the capabilities |
|
32 | - * |
|
33 | - * @return array Array containing the apps capabilities |
|
34 | - * @since 8.2.0 |
|
35 | - */ |
|
36 | - public function getCapabilities() { |
|
37 | - return [ |
|
38 | - 'files_sharing' => |
|
39 | - [ |
|
40 | - 'sharebymail' => |
|
41 | - [ |
|
42 | - 'enabled' => true, |
|
43 | - 'upload_files_drop' => ['enabled' => true], |
|
44 | - 'password' => ['enabled' => true], |
|
45 | - 'expire_date' => ['enabled' => true] |
|
46 | - ] |
|
47 | - ] |
|
48 | - ]; |
|
49 | - } |
|
30 | + /** |
|
31 | + * Function an app uses to return the capabilities |
|
32 | + * |
|
33 | + * @return array Array containing the apps capabilities |
|
34 | + * @since 8.2.0 |
|
35 | + */ |
|
36 | + public function getCapabilities() { |
|
37 | + return [ |
|
38 | + 'files_sharing' => |
|
39 | + [ |
|
40 | + 'sharebymail' => |
|
41 | + [ |
|
42 | + 'enabled' => true, |
|
43 | + 'upload_files_drop' => ['enabled' => true], |
|
44 | + 'password' => ['enabled' => true], |
|
45 | + 'expire_date' => ['enabled' => true] |
|
46 | + ] |
|
47 | + ] |
|
48 | + ]; |
|
49 | + } |
|
50 | 50 | } |
@@ -31,187 +31,187 @@ |
||
31 | 31 | |
32 | 32 | class ShareHelper implements IShareHelper { |
33 | 33 | |
34 | - /** @var IManager */ |
|
35 | - private $shareManager; |
|
36 | - |
|
37 | - public function __construct(IManager $shareManager) { |
|
38 | - $this->shareManager = $shareManager; |
|
39 | - } |
|
40 | - |
|
41 | - /** |
|
42 | - * @param Node $node |
|
43 | - * @return array [ users => [Mapping $uid => $pathForUser], remotes => [Mapping $cloudId => $pathToMountRoot]] |
|
44 | - */ |
|
45 | - public function getPathsForAccessList(Node $node) { |
|
46 | - $result = [ |
|
47 | - 'users' => [], |
|
48 | - 'remotes' => [], |
|
49 | - ]; |
|
50 | - |
|
51 | - $accessList = $this->shareManager->getAccessList($node, true, true); |
|
52 | - if (!empty($accessList['users'])) { |
|
53 | - $result['users'] = $this->getPathsForUsers($node, $accessList['users']); |
|
54 | - } |
|
55 | - if (!empty($accessList['remote'])) { |
|
56 | - $result['remotes'] = $this->getPathsForRemotes($node, $accessList['remote']); |
|
57 | - } |
|
58 | - |
|
59 | - return $result; |
|
60 | - } |
|
61 | - |
|
62 | - /** |
|
63 | - * Sample: |
|
64 | - * $users = [ |
|
65 | - * 'test1' => ['node_id' => 16, 'node_path' => '/foo'], |
|
66 | - * 'test2' => ['node_id' => 23, 'node_path' => '/bar'], |
|
67 | - * 'test3' => ['node_id' => 42, 'node_path' => '/cat'], |
|
68 | - * 'test4' => ['node_id' => 48, 'node_path' => '/dog'], |
|
69 | - * ]; |
|
70 | - * |
|
71 | - * Node tree: |
|
72 | - * - SixTeen is the parent of TwentyThree |
|
73 | - * - TwentyThree is the parent of FortyTwo |
|
74 | - * - FortyEight does not exist |
|
75 | - * |
|
76 | - * $return = [ |
|
77 | - * 'test1' => '/foo/TwentyThree/FortyTwo', |
|
78 | - * 'test2' => '/bar/FortyTwo', |
|
79 | - * 'test3' => '/cat', |
|
80 | - * ], |
|
81 | - * |
|
82 | - * @param Node $node |
|
83 | - * @param array[] $users |
|
84 | - * @return array |
|
85 | - */ |
|
86 | - protected function getPathsForUsers(Node $node, array $users) { |
|
87 | - /** @var array[] $byId */ |
|
88 | - $byId = []; |
|
89 | - /** @var array[] $results */ |
|
90 | - $results = []; |
|
91 | - |
|
92 | - foreach ($users as $uid => $info) { |
|
93 | - if (!isset($byId[$info['node_id']])) { |
|
94 | - $byId[$info['node_id']] = []; |
|
95 | - } |
|
96 | - $byId[$info['node_id']][$uid] = $info['node_path']; |
|
97 | - } |
|
98 | - |
|
99 | - try { |
|
100 | - if (isset($byId[$node->getId()])) { |
|
101 | - foreach ($byId[$node->getId()] as $uid => $path) { |
|
102 | - $results[$uid] = $path; |
|
103 | - } |
|
104 | - unset($byId[$node->getId()]); |
|
105 | - } |
|
106 | - } catch (NotFoundException $e) { |
|
107 | - return $results; |
|
108 | - } catch (InvalidPathException $e) { |
|
109 | - return $results; |
|
110 | - } |
|
111 | - |
|
112 | - if (empty($byId)) { |
|
113 | - return $results; |
|
114 | - } |
|
115 | - |
|
116 | - $item = $node; |
|
117 | - $appendix = '/' . $node->getName(); |
|
118 | - while (!empty($byId)) { |
|
119 | - try { |
|
120 | - /** @var Node $item */ |
|
121 | - $item = $item->getParent(); |
|
122 | - |
|
123 | - if (!empty($byId[$item->getId()])) { |
|
124 | - foreach ($byId[$item->getId()] as $uid => $path) { |
|
125 | - $results[$uid] = $path . $appendix; |
|
126 | - } |
|
127 | - unset($byId[$item->getId()]); |
|
128 | - } |
|
129 | - |
|
130 | - $appendix = '/' . $item->getName() . $appendix; |
|
131 | - } catch (NotFoundException $e) { |
|
132 | - return $results; |
|
133 | - } catch (InvalidPathException $e) { |
|
134 | - return $results; |
|
135 | - } catch (NotPermittedException $e) { |
|
136 | - return $results; |
|
137 | - } |
|
138 | - } |
|
139 | - |
|
140 | - return $results; |
|
141 | - } |
|
142 | - |
|
143 | - /** |
|
144 | - * Sample: |
|
145 | - * $remotes = [ |
|
146 | - * 'test1' => ['node_id' => 16, 'token' => 't1'], |
|
147 | - * 'test2' => ['node_id' => 23, 'token' => 't2'], |
|
148 | - * 'test3' => ['node_id' => 42, 'token' => 't3'], |
|
149 | - * 'test4' => ['node_id' => 48, 'token' => 't4'], |
|
150 | - * ]; |
|
151 | - * |
|
152 | - * Node tree: |
|
153 | - * - SixTeen is the parent of TwentyThree |
|
154 | - * - TwentyThree is the parent of FortyTwo |
|
155 | - * - FortyEight does not exist |
|
156 | - * |
|
157 | - * $return = [ |
|
158 | - * 'test1' => ['token' => 't1', 'node_path' => '/SixTeen'], |
|
159 | - * 'test2' => ['token' => 't2', 'node_path' => '/SixTeen/TwentyThree'], |
|
160 | - * 'test3' => ['token' => 't3', 'node_path' => '/SixTeen/TwentyThree/FortyTwo'], |
|
161 | - * ], |
|
162 | - * |
|
163 | - * @param Node $node |
|
164 | - * @param array[] $remotes |
|
165 | - * @return array |
|
166 | - */ |
|
167 | - protected function getPathsForRemotes(Node $node, array $remotes) { |
|
168 | - /** @var array[] $byId */ |
|
169 | - $byId = []; |
|
170 | - /** @var array[] $results */ |
|
171 | - $results = []; |
|
172 | - |
|
173 | - foreach ($remotes as $cloudId => $info) { |
|
174 | - if (!isset($byId[$info['node_id']])) { |
|
175 | - $byId[$info['node_id']] = []; |
|
176 | - } |
|
177 | - $byId[$info['node_id']][$cloudId] = $info['token']; |
|
178 | - } |
|
179 | - |
|
180 | - $item = $node; |
|
181 | - while (!empty($byId)) { |
|
182 | - try { |
|
183 | - if (!empty($byId[$item->getId()])) { |
|
184 | - $path = $this->getMountedPath($item); |
|
185 | - foreach ($byId[$item->getId()] as $uid => $token) { |
|
186 | - $results[$uid] = [ |
|
187 | - 'node_path' => $path, |
|
188 | - 'token' => $token, |
|
189 | - ]; |
|
190 | - } |
|
191 | - unset($byId[$item->getId()]); |
|
192 | - } |
|
193 | - |
|
194 | - /** @var Node $item */ |
|
195 | - $item = $item->getParent(); |
|
196 | - } catch (NotFoundException $e) { |
|
197 | - return $results; |
|
198 | - } catch (InvalidPathException $e) { |
|
199 | - return $results; |
|
200 | - } catch (NotPermittedException $e) { |
|
201 | - return $results; |
|
202 | - } |
|
203 | - } |
|
204 | - |
|
205 | - return $results; |
|
206 | - } |
|
207 | - |
|
208 | - /** |
|
209 | - * @param Node $node |
|
210 | - * @return string |
|
211 | - */ |
|
212 | - protected function getMountedPath(Node $node) { |
|
213 | - $path = $node->getPath(); |
|
214 | - $sections = explode('/', $path, 4); |
|
215 | - return '/' . $sections[3]; |
|
216 | - } |
|
34 | + /** @var IManager */ |
|
35 | + private $shareManager; |
|
36 | + |
|
37 | + public function __construct(IManager $shareManager) { |
|
38 | + $this->shareManager = $shareManager; |
|
39 | + } |
|
40 | + |
|
41 | + /** |
|
42 | + * @param Node $node |
|
43 | + * @return array [ users => [Mapping $uid => $pathForUser], remotes => [Mapping $cloudId => $pathToMountRoot]] |
|
44 | + */ |
|
45 | + public function getPathsForAccessList(Node $node) { |
|
46 | + $result = [ |
|
47 | + 'users' => [], |
|
48 | + 'remotes' => [], |
|
49 | + ]; |
|
50 | + |
|
51 | + $accessList = $this->shareManager->getAccessList($node, true, true); |
|
52 | + if (!empty($accessList['users'])) { |
|
53 | + $result['users'] = $this->getPathsForUsers($node, $accessList['users']); |
|
54 | + } |
|
55 | + if (!empty($accessList['remote'])) { |
|
56 | + $result['remotes'] = $this->getPathsForRemotes($node, $accessList['remote']); |
|
57 | + } |
|
58 | + |
|
59 | + return $result; |
|
60 | + } |
|
61 | + |
|
62 | + /** |
|
63 | + * Sample: |
|
64 | + * $users = [ |
|
65 | + * 'test1' => ['node_id' => 16, 'node_path' => '/foo'], |
|
66 | + * 'test2' => ['node_id' => 23, 'node_path' => '/bar'], |
|
67 | + * 'test3' => ['node_id' => 42, 'node_path' => '/cat'], |
|
68 | + * 'test4' => ['node_id' => 48, 'node_path' => '/dog'], |
|
69 | + * ]; |
|
70 | + * |
|
71 | + * Node tree: |
|
72 | + * - SixTeen is the parent of TwentyThree |
|
73 | + * - TwentyThree is the parent of FortyTwo |
|
74 | + * - FortyEight does not exist |
|
75 | + * |
|
76 | + * $return = [ |
|
77 | + * 'test1' => '/foo/TwentyThree/FortyTwo', |
|
78 | + * 'test2' => '/bar/FortyTwo', |
|
79 | + * 'test3' => '/cat', |
|
80 | + * ], |
|
81 | + * |
|
82 | + * @param Node $node |
|
83 | + * @param array[] $users |
|
84 | + * @return array |
|
85 | + */ |
|
86 | + protected function getPathsForUsers(Node $node, array $users) { |
|
87 | + /** @var array[] $byId */ |
|
88 | + $byId = []; |
|
89 | + /** @var array[] $results */ |
|
90 | + $results = []; |
|
91 | + |
|
92 | + foreach ($users as $uid => $info) { |
|
93 | + if (!isset($byId[$info['node_id']])) { |
|
94 | + $byId[$info['node_id']] = []; |
|
95 | + } |
|
96 | + $byId[$info['node_id']][$uid] = $info['node_path']; |
|
97 | + } |
|
98 | + |
|
99 | + try { |
|
100 | + if (isset($byId[$node->getId()])) { |
|
101 | + foreach ($byId[$node->getId()] as $uid => $path) { |
|
102 | + $results[$uid] = $path; |
|
103 | + } |
|
104 | + unset($byId[$node->getId()]); |
|
105 | + } |
|
106 | + } catch (NotFoundException $e) { |
|
107 | + return $results; |
|
108 | + } catch (InvalidPathException $e) { |
|
109 | + return $results; |
|
110 | + } |
|
111 | + |
|
112 | + if (empty($byId)) { |
|
113 | + return $results; |
|
114 | + } |
|
115 | + |
|
116 | + $item = $node; |
|
117 | + $appendix = '/' . $node->getName(); |
|
118 | + while (!empty($byId)) { |
|
119 | + try { |
|
120 | + /** @var Node $item */ |
|
121 | + $item = $item->getParent(); |
|
122 | + |
|
123 | + if (!empty($byId[$item->getId()])) { |
|
124 | + foreach ($byId[$item->getId()] as $uid => $path) { |
|
125 | + $results[$uid] = $path . $appendix; |
|
126 | + } |
|
127 | + unset($byId[$item->getId()]); |
|
128 | + } |
|
129 | + |
|
130 | + $appendix = '/' . $item->getName() . $appendix; |
|
131 | + } catch (NotFoundException $e) { |
|
132 | + return $results; |
|
133 | + } catch (InvalidPathException $e) { |
|
134 | + return $results; |
|
135 | + } catch (NotPermittedException $e) { |
|
136 | + return $results; |
|
137 | + } |
|
138 | + } |
|
139 | + |
|
140 | + return $results; |
|
141 | + } |
|
142 | + |
|
143 | + /** |
|
144 | + * Sample: |
|
145 | + * $remotes = [ |
|
146 | + * 'test1' => ['node_id' => 16, 'token' => 't1'], |
|
147 | + * 'test2' => ['node_id' => 23, 'token' => 't2'], |
|
148 | + * 'test3' => ['node_id' => 42, 'token' => 't3'], |
|
149 | + * 'test4' => ['node_id' => 48, 'token' => 't4'], |
|
150 | + * ]; |
|
151 | + * |
|
152 | + * Node tree: |
|
153 | + * - SixTeen is the parent of TwentyThree |
|
154 | + * - TwentyThree is the parent of FortyTwo |
|
155 | + * - FortyEight does not exist |
|
156 | + * |
|
157 | + * $return = [ |
|
158 | + * 'test1' => ['token' => 't1', 'node_path' => '/SixTeen'], |
|
159 | + * 'test2' => ['token' => 't2', 'node_path' => '/SixTeen/TwentyThree'], |
|
160 | + * 'test3' => ['token' => 't3', 'node_path' => '/SixTeen/TwentyThree/FortyTwo'], |
|
161 | + * ], |
|
162 | + * |
|
163 | + * @param Node $node |
|
164 | + * @param array[] $remotes |
|
165 | + * @return array |
|
166 | + */ |
|
167 | + protected function getPathsForRemotes(Node $node, array $remotes) { |
|
168 | + /** @var array[] $byId */ |
|
169 | + $byId = []; |
|
170 | + /** @var array[] $results */ |
|
171 | + $results = []; |
|
172 | + |
|
173 | + foreach ($remotes as $cloudId => $info) { |
|
174 | + if (!isset($byId[$info['node_id']])) { |
|
175 | + $byId[$info['node_id']] = []; |
|
176 | + } |
|
177 | + $byId[$info['node_id']][$cloudId] = $info['token']; |
|
178 | + } |
|
179 | + |
|
180 | + $item = $node; |
|
181 | + while (!empty($byId)) { |
|
182 | + try { |
|
183 | + if (!empty($byId[$item->getId()])) { |
|
184 | + $path = $this->getMountedPath($item); |
|
185 | + foreach ($byId[$item->getId()] as $uid => $token) { |
|
186 | + $results[$uid] = [ |
|
187 | + 'node_path' => $path, |
|
188 | + 'token' => $token, |
|
189 | + ]; |
|
190 | + } |
|
191 | + unset($byId[$item->getId()]); |
|
192 | + } |
|
193 | + |
|
194 | + /** @var Node $item */ |
|
195 | + $item = $item->getParent(); |
|
196 | + } catch (NotFoundException $e) { |
|
197 | + return $results; |
|
198 | + } catch (InvalidPathException $e) { |
|
199 | + return $results; |
|
200 | + } catch (NotPermittedException $e) { |
|
201 | + return $results; |
|
202 | + } |
|
203 | + } |
|
204 | + |
|
205 | + return $results; |
|
206 | + } |
|
207 | + |
|
208 | + /** |
|
209 | + * @param Node $node |
|
210 | + * @return string |
|
211 | + */ |
|
212 | + protected function getMountedPath(Node $node) { |
|
213 | + $path = $node->getPath(); |
|
214 | + $sections = explode('/', $path, 4); |
|
215 | + return '/' . $sections[3]; |
|
216 | + } |
|
217 | 217 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | $item = $node; |
117 | - $appendix = '/' . $node->getName(); |
|
117 | + $appendix = '/'.$node->getName(); |
|
118 | 118 | while (!empty($byId)) { |
119 | 119 | try { |
120 | 120 | /** @var Node $item */ |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | |
123 | 123 | if (!empty($byId[$item->getId()])) { |
124 | 124 | foreach ($byId[$item->getId()] as $uid => $path) { |
125 | - $results[$uid] = $path . $appendix; |
|
125 | + $results[$uid] = $path.$appendix; |
|
126 | 126 | } |
127 | 127 | unset($byId[$item->getId()]); |
128 | 128 | } |
129 | 129 | |
130 | - $appendix = '/' . $item->getName() . $appendix; |
|
130 | + $appendix = '/'.$item->getName().$appendix; |
|
131 | 131 | } catch (NotFoundException $e) { |
132 | 132 | return $results; |
133 | 133 | } catch (InvalidPathException $e) { |
@@ -212,6 +212,6 @@ discard block |
||
212 | 212 | protected function getMountedPath(Node $node) { |
213 | 213 | $path = $node->getPath(); |
214 | 214 | $sections = explode('/', $path, 4); |
215 | - return '/' . $sections[3]; |
|
215 | + return '/'.$sections[3]; |
|
216 | 216 | } |
217 | 217 | } |
@@ -27,35 +27,35 @@ |
||
27 | 27 | |
28 | 28 | class SettingsManager { |
29 | 29 | |
30 | - /** @var IConfig */ |
|
31 | - private $config; |
|
32 | - |
|
33 | - private $sendPasswordByMailDefault = 'yes'; |
|
34 | - |
|
35 | - private $enforcePasswordProtectionDefault = 'no'; |
|
36 | - |
|
37 | - public function __construct(IConfig $config) { |
|
38 | - $this->config = $config; |
|
39 | - } |
|
40 | - |
|
41 | - /** |
|
42 | - * should the password for a mail share be send to the recipient |
|
43 | - * |
|
44 | - * @return bool |
|
45 | - */ |
|
46 | - public function sendPasswordByMail() { |
|
47 | - $sendPasswordByMail = $this->config->getAppValue('sharebymail', 'sendpasswordmail', $this->sendPasswordByMailDefault); |
|
48 | - return $sendPasswordByMail === 'yes'; |
|
49 | - } |
|
50 | - |
|
51 | - /** |
|
52 | - * do we require a share by mail to be password protected |
|
53 | - * |
|
54 | - * @return bool |
|
55 | - */ |
|
56 | - public function enforcePasswordProtection() { |
|
57 | - $enforcePassword = $this->config->getAppValue('sharebymail', 'enforcePasswordProtection', $this->enforcePasswordProtectionDefault); |
|
58 | - return $enforcePassword === 'yes'; |
|
59 | - } |
|
30 | + /** @var IConfig */ |
|
31 | + private $config; |
|
32 | + |
|
33 | + private $sendPasswordByMailDefault = 'yes'; |
|
34 | + |
|
35 | + private $enforcePasswordProtectionDefault = 'no'; |
|
36 | + |
|
37 | + public function __construct(IConfig $config) { |
|
38 | + $this->config = $config; |
|
39 | + } |
|
40 | + |
|
41 | + /** |
|
42 | + * should the password for a mail share be send to the recipient |
|
43 | + * |
|
44 | + * @return bool |
|
45 | + */ |
|
46 | + public function sendPasswordByMail() { |
|
47 | + $sendPasswordByMail = $this->config->getAppValue('sharebymail', 'sendpasswordmail', $this->sendPasswordByMailDefault); |
|
48 | + return $sendPasswordByMail === 'yes'; |
|
49 | + } |
|
50 | + |
|
51 | + /** |
|
52 | + * do we require a share by mail to be password protected |
|
53 | + * |
|
54 | + * @return bool |
|
55 | + */ |
|
56 | + public function enforcePasswordProtection() { |
|
57 | + $enforcePassword = $this->config->getAppValue('sharebymail', 'enforcePasswordProtection', $this->enforcePasswordProtectionDefault); |
|
58 | + return $enforcePassword === 'yes'; |
|
59 | + } |
|
60 | 60 | |
61 | 61 | } |
@@ -27,42 +27,42 @@ |
||
27 | 27 | |
28 | 28 | class Admin implements ISettings { |
29 | 29 | |
30 | - /** @var SettingsManager */ |
|
31 | - private $settingsManager; |
|
30 | + /** @var SettingsManager */ |
|
31 | + private $settingsManager; |
|
32 | 32 | |
33 | - public function __construct(SettingsManager $settingsManager) { |
|
34 | - $this->settingsManager = $settingsManager; |
|
35 | - } |
|
33 | + public function __construct(SettingsManager $settingsManager) { |
|
34 | + $this->settingsManager = $settingsManager; |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * @return TemplateResponse |
|
39 | - */ |
|
40 | - public function getForm() { |
|
37 | + /** |
|
38 | + * @return TemplateResponse |
|
39 | + */ |
|
40 | + public function getForm() { |
|
41 | 41 | |
42 | - $parameters = [ |
|
43 | - 'sendPasswordMail' => $this->settingsManager->sendPasswordByMail(), |
|
44 | - 'enforcePasswordProtection' => $this->settingsManager->enforcePasswordProtection() |
|
45 | - ]; |
|
42 | + $parameters = [ |
|
43 | + 'sendPasswordMail' => $this->settingsManager->sendPasswordByMail(), |
|
44 | + 'enforcePasswordProtection' => $this->settingsManager->enforcePasswordProtection() |
|
45 | + ]; |
|
46 | 46 | |
47 | - return new TemplateResponse('sharebymail', 'settings-admin', $parameters, ''); |
|
48 | - } |
|
47 | + return new TemplateResponse('sharebymail', 'settings-admin', $parameters, ''); |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * @return string the section ID, e.g. 'sharing' |
|
52 | - */ |
|
53 | - public function getSection() { |
|
54 | - return 'sharing'; |
|
55 | - } |
|
50 | + /** |
|
51 | + * @return string the section ID, e.g. 'sharing' |
|
52 | + */ |
|
53 | + public function getSection() { |
|
54 | + return 'sharing'; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @return int whether the form should be rather on the top or bottom of |
|
59 | - * the admin section. The forms are arranged in ascending order of the |
|
60 | - * priority values. It is required to return a value between 0 and 100. |
|
61 | - * |
|
62 | - * E.g.: 70 |
|
63 | - */ |
|
64 | - public function getPriority() { |
|
65 | - return 40; |
|
66 | - } |
|
57 | + /** |
|
58 | + * @return int whether the form should be rather on the top or bottom of |
|
59 | + * the admin section. The forms are arranged in ascending order of the |
|
60 | + * priority values. It is required to return a value between 0 and 100. |
|
61 | + * |
|
62 | + * E.g.: 70 |
|
63 | + */ |
|
64 | + public function getPriority() { |
|
65 | + return 40; |
|
66 | + } |
|
67 | 67 | |
68 | 68 | } |