@@ -31,33 +31,33 @@ |
||
31 | 31 | |
32 | 32 | class EMailProvider implements IProvider { |
33 | 33 | |
34 | - /** @var IActionFactory */ |
|
35 | - private $actionFactory; |
|
36 | - |
|
37 | - /** @var IURLGenerator */ |
|
38 | - private $urlGenerator; |
|
39 | - |
|
40 | - /** |
|
41 | - * @param IActionFactory $actionFactory |
|
42 | - * @param IURLGenerator $urlGenerator |
|
43 | - */ |
|
44 | - public function __construct(IActionFactory $actionFactory, IURLGenerator $urlGenerator) { |
|
45 | - $this->actionFactory = $actionFactory; |
|
46 | - $this->urlGenerator = $urlGenerator; |
|
47 | - } |
|
48 | - |
|
49 | - /** |
|
50 | - * @param IEntry $entry |
|
51 | - */ |
|
52 | - public function process(IEntry $entry) { |
|
53 | - $iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/mail.svg')); |
|
54 | - foreach ($entry->getEMailAddresses() as $address) { |
|
55 | - if (empty($address)) { |
|
56 | - // Skip |
|
57 | - continue; |
|
58 | - } |
|
59 | - $action = $this->actionFactory->newEMailAction($iconUrl, $address, $address); |
|
60 | - $entry->addAction($action); |
|
61 | - } |
|
62 | - } |
|
34 | + /** @var IActionFactory */ |
|
35 | + private $actionFactory; |
|
36 | + |
|
37 | + /** @var IURLGenerator */ |
|
38 | + private $urlGenerator; |
|
39 | + |
|
40 | + /** |
|
41 | + * @param IActionFactory $actionFactory |
|
42 | + * @param IURLGenerator $urlGenerator |
|
43 | + */ |
|
44 | + public function __construct(IActionFactory $actionFactory, IURLGenerator $urlGenerator) { |
|
45 | + $this->actionFactory = $actionFactory; |
|
46 | + $this->urlGenerator = $urlGenerator; |
|
47 | + } |
|
48 | + |
|
49 | + /** |
|
50 | + * @param IEntry $entry |
|
51 | + */ |
|
52 | + public function process(IEntry $entry) { |
|
53 | + $iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/mail.svg')); |
|
54 | + foreach ($entry->getEMailAddresses() as $address) { |
|
55 | + if (empty($address)) { |
|
56 | + // Skip |
|
57 | + continue; |
|
58 | + } |
|
59 | + $action = $this->actionFactory->newEMailAction($iconUrl, $address, $address); |
|
60 | + $entry->addAction($action); |
|
61 | + } |
|
62 | + } |
|
63 | 63 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | * @package OC\AppFramework\Middleware\Security\Exceptions |
33 | 33 | */ |
34 | 34 | class StrictCookieMissingException extends SecurityException { |
35 | - public function __construct() { |
|
36 | - parent::__construct('Strict Cookie has not been found in request.', Http::STATUS_PRECONDITION_FAILED); |
|
37 | - } |
|
35 | + public function __construct() { |
|
36 | + parent::__construct('Strict Cookie has not been found in request.', Http::STATUS_PRECONDITION_FAILED); |
|
37 | + } |
|
38 | 38 | } |
@@ -23,11 +23,11 @@ |
||
23 | 23 | |
24 | 24 | class PublicCalendarObject extends CalendarObject { |
25 | 25 | |
26 | - /** |
|
27 | - * public calendars are always shared |
|
28 | - * @return bool |
|
29 | - */ |
|
30 | - protected function isShared() { |
|
31 | - return true; |
|
32 | - } |
|
26 | + /** |
|
27 | + * public calendars are always shared |
|
28 | + * @return bool |
|
29 | + */ |
|
30 | + protected function isShared() { |
|
31 | + return true; |
|
32 | + } |
|
33 | 33 | } |
@@ -25,63 +25,63 @@ |
||
25 | 25 | |
26 | 26 | class PublicCalendar extends Calendar { |
27 | 27 | |
28 | - /** |
|
29 | - * @param string $name |
|
30 | - * @throws NotFound |
|
31 | - * @return PublicCalendarObject |
|
32 | - */ |
|
33 | - public function getChild($name) { |
|
34 | - $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name); |
|
28 | + /** |
|
29 | + * @param string $name |
|
30 | + * @throws NotFound |
|
31 | + * @return PublicCalendarObject |
|
32 | + */ |
|
33 | + public function getChild($name) { |
|
34 | + $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name); |
|
35 | 35 | |
36 | - if (!$obj) { |
|
37 | - throw new NotFound('Calendar object not found'); |
|
38 | - } |
|
39 | - if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { |
|
40 | - throw new NotFound('Calendar object not found'); |
|
41 | - } |
|
42 | - $obj['acl'] = $this->getChildACL(); |
|
36 | + if (!$obj) { |
|
37 | + throw new NotFound('Calendar object not found'); |
|
38 | + } |
|
39 | + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { |
|
40 | + throw new NotFound('Calendar object not found'); |
|
41 | + } |
|
42 | + $obj['acl'] = $this->getChildACL(); |
|
43 | 43 | |
44 | - return new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj); |
|
45 | - } |
|
44 | + return new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj); |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @return PublicCalendarObject[] |
|
49 | - */ |
|
50 | - public function getChildren() { |
|
51 | - $objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']); |
|
52 | - $children = []; |
|
53 | - foreach ($objs as $obj) { |
|
54 | - if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { |
|
55 | - continue; |
|
56 | - } |
|
57 | - $obj['acl'] = $this->getChildACL(); |
|
58 | - $children[] = new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj); |
|
59 | - } |
|
60 | - return $children; |
|
61 | - } |
|
47 | + /** |
|
48 | + * @return PublicCalendarObject[] |
|
49 | + */ |
|
50 | + public function getChildren() { |
|
51 | + $objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']); |
|
52 | + $children = []; |
|
53 | + foreach ($objs as $obj) { |
|
54 | + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { |
|
55 | + continue; |
|
56 | + } |
|
57 | + $obj['acl'] = $this->getChildACL(); |
|
58 | + $children[] = new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj); |
|
59 | + } |
|
60 | + return $children; |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @param string[] $paths |
|
65 | - * @return PublicCalendarObject[] |
|
66 | - */ |
|
67 | - public function getMultipleChildren(array $paths) { |
|
68 | - $objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths); |
|
69 | - $children = []; |
|
70 | - foreach ($objs as $obj) { |
|
71 | - if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { |
|
72 | - continue; |
|
73 | - } |
|
74 | - $obj['acl'] = $this->getChildACL(); |
|
75 | - $children[] = new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj); |
|
76 | - } |
|
77 | - return $children; |
|
78 | - } |
|
63 | + /** |
|
64 | + * @param string[] $paths |
|
65 | + * @return PublicCalendarObject[] |
|
66 | + */ |
|
67 | + public function getMultipleChildren(array $paths) { |
|
68 | + $objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths); |
|
69 | + $children = []; |
|
70 | + foreach ($objs as $obj) { |
|
71 | + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { |
|
72 | + continue; |
|
73 | + } |
|
74 | + $obj['acl'] = $this->getChildACL(); |
|
75 | + $children[] = new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj); |
|
76 | + } |
|
77 | + return $children; |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * public calendars are always shared |
|
82 | - * @return bool |
|
83 | - */ |
|
84 | - protected function isShared() { |
|
85 | - return true; |
|
86 | - } |
|
80 | + /** |
|
81 | + * public calendars are always shared |
|
82 | + * @return bool |
|
83 | + */ |
|
84 | + protected function isShared() { |
|
85 | + return true; |
|
86 | + } |
|
87 | 87 | } |
@@ -29,40 +29,40 @@ |
||
29 | 29 | |
30 | 30 | class FedAuth extends AbstractBasic { |
31 | 31 | |
32 | - /** @var DbHandler */ |
|
33 | - private $db; |
|
32 | + /** @var DbHandler */ |
|
33 | + private $db; |
|
34 | 34 | |
35 | - /** |
|
36 | - * FedAuth constructor. |
|
37 | - * |
|
38 | - * @param DbHandler $db |
|
39 | - */ |
|
40 | - public function __construct(DbHandler $db) { |
|
41 | - $this->db = $db; |
|
42 | - $this->principalPrefix = 'principals/system/'; |
|
35 | + /** |
|
36 | + * FedAuth constructor. |
|
37 | + * |
|
38 | + * @param DbHandler $db |
|
39 | + */ |
|
40 | + public function __construct(DbHandler $db) { |
|
41 | + $this->db = $db; |
|
42 | + $this->principalPrefix = 'principals/system/'; |
|
43 | 43 | |
44 | - // setup realm |
|
45 | - $defaults = new \OCP\Defaults(); |
|
46 | - $this->realm = $defaults->getName(); |
|
47 | - } |
|
44 | + // setup realm |
|
45 | + $defaults = new \OCP\Defaults(); |
|
46 | + $this->realm = $defaults->getName(); |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Validates a username and password |
|
51 | - * |
|
52 | - * This method should return true or false depending on if login |
|
53 | - * succeeded. |
|
54 | - * |
|
55 | - * @param string $username |
|
56 | - * @param string $password |
|
57 | - * @return bool |
|
58 | - */ |
|
59 | - protected function validateUserPass($username, $password) { |
|
60 | - return $this->db->auth($username, $password); |
|
61 | - } |
|
49 | + /** |
|
50 | + * Validates a username and password |
|
51 | + * |
|
52 | + * This method should return true or false depending on if login |
|
53 | + * succeeded. |
|
54 | + * |
|
55 | + * @param string $username |
|
56 | + * @param string $password |
|
57 | + * @return bool |
|
58 | + */ |
|
59 | + protected function validateUserPass($username, $password) { |
|
60 | + return $this->db->auth($username, $password); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @inheritdoc |
|
65 | - */ |
|
66 | - public function challenge(RequestInterface $request, ResponseInterface $response) { |
|
67 | - } |
|
63 | + /** |
|
64 | + * @inheritdoc |
|
65 | + */ |
|
66 | + public function challenge(RequestInterface $request, ResponseInterface $response) { |
|
67 | + } |
|
68 | 68 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use OCP\AppFramework\Http; |
6 | 6 | |
7 | 7 | class NotSubAdminException extends \Exception { |
8 | - public function __construct() { |
|
9 | - parent::__construct('Logged in user must be at least a sub admin', Http::STATUS_FORBIDDEN); |
|
10 | - } |
|
8 | + public function __construct() { |
|
9 | + parent::__construct('Logged in user must be at least a sub admin', Http::STATUS_FORBIDDEN); |
|
10 | + } |
|
11 | 11 | } |
@@ -29,59 +29,59 @@ |
||
29 | 29 | namespace OC\L10N; |
30 | 30 | |
31 | 31 | class L10NString implements \JsonSerializable { |
32 | - /** @var \OC\L10N\L10N */ |
|
33 | - protected $l10n; |
|
32 | + /** @var \OC\L10N\L10N */ |
|
33 | + protected $l10n; |
|
34 | 34 | |
35 | - /** @var string */ |
|
36 | - protected $text; |
|
35 | + /** @var string */ |
|
36 | + protected $text; |
|
37 | 37 | |
38 | - /** @var array */ |
|
39 | - protected $parameters; |
|
38 | + /** @var array */ |
|
39 | + protected $parameters; |
|
40 | 40 | |
41 | - /** @var integer */ |
|
42 | - protected $count; |
|
41 | + /** @var integer */ |
|
42 | + protected $count; |
|
43 | 43 | |
44 | - /** |
|
45 | - * @param \OC\L10N\L10N $l10n |
|
46 | - * @param string|string[] $text |
|
47 | - * @param array $parameters |
|
48 | - * @param int $count |
|
49 | - */ |
|
50 | - public function __construct(\OC\L10N\L10N $l10n, $text, $parameters, $count = 1) { |
|
51 | - $this->l10n = $l10n; |
|
52 | - $this->text = $text; |
|
53 | - $this->parameters = $parameters; |
|
54 | - $this->count = $count; |
|
55 | - } |
|
44 | + /** |
|
45 | + * @param \OC\L10N\L10N $l10n |
|
46 | + * @param string|string[] $text |
|
47 | + * @param array $parameters |
|
48 | + * @param int $count |
|
49 | + */ |
|
50 | + public function __construct(\OC\L10N\L10N $l10n, $text, $parameters, $count = 1) { |
|
51 | + $this->l10n = $l10n; |
|
52 | + $this->text = $text; |
|
53 | + $this->parameters = $parameters; |
|
54 | + $this->count = $count; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @return string |
|
59 | - */ |
|
60 | - public function __toString() { |
|
61 | - $translations = $this->l10n->getTranslations(); |
|
57 | + /** |
|
58 | + * @return string |
|
59 | + */ |
|
60 | + public function __toString() { |
|
61 | + $translations = $this->l10n->getTranslations(); |
|
62 | 62 | |
63 | - $text = $this->text; |
|
64 | - if(array_key_exists($this->text, $translations)) { |
|
65 | - if(is_array($translations[$this->text])) { |
|
66 | - $fn = $this->l10n->getPluralFormFunction(); |
|
67 | - $id = $fn($this->count); |
|
68 | - $text = $translations[$this->text][$id]; |
|
69 | - } |
|
70 | - else{ |
|
71 | - $text = $translations[$this->text]; |
|
72 | - } |
|
73 | - } |
|
63 | + $text = $this->text; |
|
64 | + if(array_key_exists($this->text, $translations)) { |
|
65 | + if(is_array($translations[$this->text])) { |
|
66 | + $fn = $this->l10n->getPluralFormFunction(); |
|
67 | + $id = $fn($this->count); |
|
68 | + $text = $translations[$this->text][$id]; |
|
69 | + } |
|
70 | + else{ |
|
71 | + $text = $translations[$this->text]; |
|
72 | + } |
|
73 | + } |
|
74 | 74 | |
75 | - // Replace %n first (won't interfere with vsprintf) |
|
76 | - $text = str_replace('%n', (string)$this->count, $text); |
|
77 | - return vsprintf($text, $this->parameters); |
|
78 | - } |
|
75 | + // Replace %n first (won't interfere with vsprintf) |
|
76 | + $text = str_replace('%n', (string)$this->count, $text); |
|
77 | + return vsprintf($text, $this->parameters); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | |
81 | - /** |
|
82 | - * @return string |
|
83 | - */ |
|
84 | - public function jsonSerialize() { |
|
85 | - return $this->__toString(); |
|
86 | - } |
|
81 | + /** |
|
82 | + * @return string |
|
83 | + */ |
|
84 | + public function jsonSerialize() { |
|
85 | + return $this->__toString(); |
|
86 | + } |
|
87 | 87 | } |
@@ -23,28 +23,28 @@ |
||
23 | 23 | |
24 | 24 | class EducationBundle extends Bundle { |
25 | 25 | |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getName() { |
|
30 | - return (string)$this->l10n->t('Education Edition'); |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getName() { |
|
30 | + return (string)$this->l10n->t('Education Edition'); |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * {@inheritDoc} |
|
35 | - */ |
|
36 | - public function getAppIdentifiers() { |
|
37 | - return [ |
|
38 | - 'zenodo', |
|
39 | - 'dashboard', |
|
40 | - 'circles', |
|
41 | - 'groupfolders', |
|
42 | - 'announcementcenter', |
|
43 | - 'admin_notifications', |
|
44 | - 'quota_warning', |
|
45 | - 'orcid', |
|
46 | - 'user_saml', |
|
47 | - ]; |
|
48 | - } |
|
33 | + /** |
|
34 | + * {@inheritDoc} |
|
35 | + */ |
|
36 | + public function getAppIdentifiers() { |
|
37 | + return [ |
|
38 | + 'zenodo', |
|
39 | + 'dashboard', |
|
40 | + 'circles', |
|
41 | + 'groupfolders', |
|
42 | + 'announcementcenter', |
|
43 | + 'admin_notifications', |
|
44 | + 'quota_warning', |
|
45 | + 'orcid', |
|
46 | + 'user_saml', |
|
47 | + ]; |
|
48 | + } |
|
49 | 49 | |
50 | 50 | } |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | // @codeCoverageIgnoreStart |
3 | 3 | if(!isset($_)) {//standalone page is not supported anymore - redirect to / |
4 | - require_once '../../lib/base.php'; |
|
4 | + require_once '../../lib/base.php'; |
|
5 | 5 | |
6 | - $urlGenerator = \OC::$server->getURLGenerator(); |
|
7 | - header('Location: ' . $urlGenerator->getAbsoluteURL('/')); |
|
8 | - exit; |
|
6 | + $urlGenerator = \OC::$server->getURLGenerator(); |
|
7 | + header('Location: ' . $urlGenerator->getAbsoluteURL('/')); |
|
8 | + exit; |
|
9 | 9 | } |
10 | 10 | // @codeCoverageIgnoreEnd |
11 | 11 | ?> |