Completed
Pull Request — master (#3233)
by Christoph
95:52 queued 83:56
created
apps/dav/lib/Connector/Sabre/DavAclPlugin.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -43,50 +43,50 @@
 block discarded – undo
43 43
  * @package OCA\DAV\Connector\Sabre
44 44
  */
45 45
 class DavAclPlugin extends \Sabre\DAVACL\Plugin {
46
-	public function __construct() {
47
-		$this->hideNodesFromListings = true;
48
-		$this->allowUnauthenticatedAccess = false;
49
-	}
46
+    public function __construct() {
47
+        $this->hideNodesFromListings = true;
48
+        $this->allowUnauthenticatedAccess = false;
49
+    }
50 50
 
51
-	function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) {
52
-		$access = parent::checkPrivileges($uri, $privileges, $recursion, false);
53
-		if($access === false && $throwExceptions) {
54
-			/** @var INode $node */
55
-			$node = $this->server->tree->getNodeForPath($uri);
51
+    function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) {
52
+        $access = parent::checkPrivileges($uri, $privileges, $recursion, false);
53
+        if($access === false && $throwExceptions) {
54
+            /** @var INode $node */
55
+            $node = $this->server->tree->getNodeForPath($uri);
56 56
 
57
-			switch(get_class($node)) {
58
-				case 'OCA\DAV\CardDAV\AddressBook':
59
-					$type = 'Addressbook';
60
-					break;
61
-				default:
62
-					$type = 'Node';
63
-					break;
64
-			}
65
-			throw new NotFound(
66
-				sprintf(
67
-					"%s with name '%s' could not be found",
68
-					$type,
69
-					$node->getName()
70
-				)
71
-			);
72
-		}
57
+            switch(get_class($node)) {
58
+                case 'OCA\DAV\CardDAV\AddressBook':
59
+                    $type = 'Addressbook';
60
+                    break;
61
+                default:
62
+                    $type = 'Node';
63
+                    break;
64
+            }
65
+            throw new NotFound(
66
+                sprintf(
67
+                    "%s with name '%s' could not be found",
68
+                    $type,
69
+                    $node->getName()
70
+                )
71
+            );
72
+        }
73 73
 
74
-		return $access;
75
-	}
74
+        return $access;
75
+    }
76 76
 
77
-	public function propFind(PropFind $propFind, INode $node) {
78
-		// If the node is neither readable nor writable then fail unless its of
79
-		// the standard user-principal
80
-		if(!($node instanceof User)) {
81
-			$path = $propFind->getPath();
82
-			$readPermissions = $this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, false);
83
-			$writePermissions = $this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, false);
84
-			if ($readPermissions === false && $writePermissions === false) {
85
-				$this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, true);
86
-				$this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, true);
87
-			}
88
-		}
77
+    public function propFind(PropFind $propFind, INode $node) {
78
+        // If the node is neither readable nor writable then fail unless its of
79
+        // the standard user-principal
80
+        if(!($node instanceof User)) {
81
+            $path = $propFind->getPath();
82
+            $readPermissions = $this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, false);
83
+            $writePermissions = $this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, false);
84
+            if ($readPermissions === false && $writePermissions === false) {
85
+                $this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, true);
86
+                $this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, true);
87
+            }
88
+        }
89 89
 
90
-		return parent::propFind($propFind, $node);
91
-	}
90
+        return parent::propFind($propFind, $node);
91
+    }
92 92
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/LegacyDAVACL.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -32,42 +32,42 @@
 block discarded – undo
32 32
 
33 33
 class LegacyDAVACL extends DavAclPlugin {
34 34
 
35
-	/**
36
-	 * @inheritdoc
37
-	 */
38
-	public function getCurrentUserPrincipals() {
39
-		$principalV2 = $this->getCurrentUserPrincipal();
35
+    /**
36
+     * @inheritdoc
37
+     */
38
+    public function getCurrentUserPrincipals() {
39
+        $principalV2 = $this->getCurrentUserPrincipal();
40 40
 
41
-		if (is_null($principalV2)) return [];
41
+        if (is_null($principalV2)) return [];
42 42
 
43
-		$principalV1 = $this->convertPrincipal($principalV2, false);
44
-		return array_merge(
45
-			[
46
-				$principalV2,
47
-				$principalV1
48
-			],
49
-			$this->getPrincipalMembership($principalV1)
50
-		);
51
-	}
43
+        $principalV1 = $this->convertPrincipal($principalV2, false);
44
+        return array_merge(
45
+            [
46
+                $principalV2,
47
+                $principalV1
48
+            ],
49
+            $this->getPrincipalMembership($principalV1)
50
+        );
51
+    }
52 52
 
53
-	private function convertPrincipal($principal, $toV2) {
54
-		list(, $name) = URLUtil::splitPath($principal);
55
-		if ($toV2) {
56
-			return "principals/users/$name";
57
-		}
58
-		return "principals/$name";
59
-	}
53
+    private function convertPrincipal($principal, $toV2) {
54
+        list(, $name) = URLUtil::splitPath($principal);
55
+        if ($toV2) {
56
+            return "principals/users/$name";
57
+        }
58
+        return "principals/$name";
59
+    }
60 60
 
61
-	public function propFind(PropFind $propFind, INode $node) {
62
-		/* Overload current-user-principal */
63
-		$propFind->handle('{DAV:}current-user-principal', function () {
64
-			if ($url = parent::getCurrentUserPrincipal()) {
65
-				return new Principal(Principal::HREF, $url . '/');
66
-			} else {
67
-				return new Principal(Principal::UNAUTHENTICATED);
68
-			}
69
-		});
61
+    public function propFind(PropFind $propFind, INode $node) {
62
+        /* Overload current-user-principal */
63
+        $propFind->handle('{DAV:}current-user-principal', function () {
64
+            if ($url = parent::getCurrentUserPrincipal()) {
65
+                return new Principal(Principal::HREF, $url . '/');
66
+            } else {
67
+                return new Principal(Principal::UNAUTHENTICATED);
68
+            }
69
+        });
70 70
 
71
-		return parent::propFind($propFind, $node);
72
-	}
71
+        return parent::propFind($propFind, $node);
72
+    }
73 73
 }
Please login to merge, or discard this patch.
apps/dav/lib/AppInfo/Application.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -39,134 +39,134 @@
 block discarded – undo
39 39
 
40 40
 class Application extends App {
41 41
 
42
-	/**
43
-	 * Application constructor.
44
-	 */
45
-	public function __construct() {
46
-		parent::__construct('dav');
42
+    /**
43
+     * Application constructor.
44
+     */
45
+    public function __construct() {
46
+        parent::__construct('dav');
47 47
 
48
-		/*
48
+        /*
49 49
 		 * Register capabilities
50 50
 		 */
51
-		$this->getContainer()->registerCapability(Capabilities::class);
52
-	}
53
-
54
-	/**
55
-	 * @param IManager $contactsManager
56
-	 * @param string $userID
57
-	 */
58
-	public function setupContactsProvider(IManager $contactsManager, $userID) {
59
-		/** @var ContactsManager $cm */
60
-		$cm = $this->getContainer()->query(ContactsManager::class);
61
-		$urlGenerator = $this->getContainer()->getServer()->getURLGenerator();
62
-		$cm->setupContactsProvider($contactsManager, $userID, $urlGenerator);
63
-	}
64
-
65
-	public function registerHooks() {
66
-		/** @var HookManager $hm */
67
-		$hm = $this->getContainer()->query(HookManager::class);
68
-		$hm->setup();
69
-
70
-		$dispatcher = $this->getContainer()->getServer()->getEventDispatcher();
71
-
72
-		// first time login event setup
73
-		$dispatcher->addListener(IUser::class . '::firstLogin', function ($event) use ($hm) {
74
-			if ($event instanceof GenericEvent) {
75
-				$hm->firstLogin($event->getSubject());
76
-			}
77
-		});
78
-
79
-		// carddav/caldav sync event setup
80
-		$listener = function($event) {
81
-			if ($event instanceof GenericEvent) {
82
-				/** @var BirthdayService $b */
83
-				$b = $this->getContainer()->query(BirthdayService::class);
84
-				$b->onCardChanged(
85
-					$event->getArgument('addressBookId'),
86
-					$event->getArgument('cardUri'),
87
-					$event->getArgument('cardData')
88
-				);
89
-			}
90
-		};
91
-
92
-		$dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::createCard', $listener);
93
-		$dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::updateCard', $listener);
94
-		$dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::deleteCard', function($event) {
95
-			if ($event instanceof GenericEvent) {
96
-				/** @var BirthdayService $b */
97
-				$b = $this->getContainer()->query(BirthdayService::class);
98
-				$b->onCardDeleted(
99
-					$event->getArgument('addressBookId'),
100
-					$event->getArgument('cardUri')
101
-				);
102
-			}
103
-		});
104
-
105
-		$dispatcher->addListener('OC\AccountManager::userUpdated', function(GenericEvent $event) {
106
-			$user = $event->getSubject();
107
-			$syncService = $this->getContainer()->query(SyncService::class);
108
-			$syncService->updateUser($user);
109
-		});
110
-
111
-		$dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createCalendar', function(GenericEvent $event) {
112
-			/** @var Backend $backend */
113
-			$backend = $this->getContainer()->query(Backend::class);
114
-			$backend->onCalendarAdd(
115
-				$event->getArgument('calendarData')
116
-			);
117
-		});
118
-		$dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateCalendar', function(GenericEvent $event) {
119
-			/** @var Backend $backend */
120
-			$backend = $this->getContainer()->query(Backend::class);
121
-			$backend->onCalendarUpdate(
122
-				$event->getArgument('calendarData'),
123
-				$event->getArgument('shares'),
124
-				$event->getArgument('propertyMutations')
125
-			);
126
-		});
127
-		$dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar', function(GenericEvent $event) {
128
-			/** @var Backend $backend */
129
-			$backend = $this->getContainer()->query(Backend::class);
130
-			$backend->onCalendarDelete(
131
-				$event->getArgument('calendarData'),
132
-				$event->getArgument('shares')
133
-			);
134
-		});
135
-		$dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateShares', function(GenericEvent $event) {
136
-			/** @var Backend $backend */
137
-			$backend = $this->getContainer()->query(Backend::class);
138
-			$backend->onCalendarUpdateShares(
139
-				$event->getArgument('calendarData'),
140
-				$event->getArgument('shares'),
141
-				$event->getArgument('add'),
142
-				$event->getArgument('remove')
143
-			);
144
-		});
145
-
146
-		$listener = function(GenericEvent $event, $eventName) {
147
-			/** @var Backend $backend */
148
-			$backend = $this->getContainer()->query(Backend::class);
149
-
150
-			$subject = Event::SUBJECT_OBJECT_ADD;
151
-			if ($eventName === '\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject') {
152
-				$subject = Event::SUBJECT_OBJECT_UPDATE;
153
-			} else if ($eventName === '\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject') {
154
-				$subject = Event::SUBJECT_OBJECT_DELETE;
155
-			}
156
-			$backend->onTouchCalendarObject(
157
-				$subject,
158
-				$event->getArgument('calendarData'),
159
-				$event->getArgument('shares'),
160
-				$event->getArgument('objectData')
161
-			);
162
-		};
163
-		$dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject', $listener);
164
-		$dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject', $listener);
165
-		$dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject', $listener);
166
-	}
167
-
168
-	public function getSyncService() {
169
-		return $this->getContainer()->query(SyncService::class);
170
-	}
51
+        $this->getContainer()->registerCapability(Capabilities::class);
52
+    }
53
+
54
+    /**
55
+     * @param IManager $contactsManager
56
+     * @param string $userID
57
+     */
58
+    public function setupContactsProvider(IManager $contactsManager, $userID) {
59
+        /** @var ContactsManager $cm */
60
+        $cm = $this->getContainer()->query(ContactsManager::class);
61
+        $urlGenerator = $this->getContainer()->getServer()->getURLGenerator();
62
+        $cm->setupContactsProvider($contactsManager, $userID, $urlGenerator);
63
+    }
64
+
65
+    public function registerHooks() {
66
+        /** @var HookManager $hm */
67
+        $hm = $this->getContainer()->query(HookManager::class);
68
+        $hm->setup();
69
+
70
+        $dispatcher = $this->getContainer()->getServer()->getEventDispatcher();
71
+
72
+        // first time login event setup
73
+        $dispatcher->addListener(IUser::class . '::firstLogin', function ($event) use ($hm) {
74
+            if ($event instanceof GenericEvent) {
75
+                $hm->firstLogin($event->getSubject());
76
+            }
77
+        });
78
+
79
+        // carddav/caldav sync event setup
80
+        $listener = function($event) {
81
+            if ($event instanceof GenericEvent) {
82
+                /** @var BirthdayService $b */
83
+                $b = $this->getContainer()->query(BirthdayService::class);
84
+                $b->onCardChanged(
85
+                    $event->getArgument('addressBookId'),
86
+                    $event->getArgument('cardUri'),
87
+                    $event->getArgument('cardData')
88
+                );
89
+            }
90
+        };
91
+
92
+        $dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::createCard', $listener);
93
+        $dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::updateCard', $listener);
94
+        $dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::deleteCard', function($event) {
95
+            if ($event instanceof GenericEvent) {
96
+                /** @var BirthdayService $b */
97
+                $b = $this->getContainer()->query(BirthdayService::class);
98
+                $b->onCardDeleted(
99
+                    $event->getArgument('addressBookId'),
100
+                    $event->getArgument('cardUri')
101
+                );
102
+            }
103
+        });
104
+
105
+        $dispatcher->addListener('OC\AccountManager::userUpdated', function(GenericEvent $event) {
106
+            $user = $event->getSubject();
107
+            $syncService = $this->getContainer()->query(SyncService::class);
108
+            $syncService->updateUser($user);
109
+        });
110
+
111
+        $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createCalendar', function(GenericEvent $event) {
112
+            /** @var Backend $backend */
113
+            $backend = $this->getContainer()->query(Backend::class);
114
+            $backend->onCalendarAdd(
115
+                $event->getArgument('calendarData')
116
+            );
117
+        });
118
+        $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateCalendar', function(GenericEvent $event) {
119
+            /** @var Backend $backend */
120
+            $backend = $this->getContainer()->query(Backend::class);
121
+            $backend->onCalendarUpdate(
122
+                $event->getArgument('calendarData'),
123
+                $event->getArgument('shares'),
124
+                $event->getArgument('propertyMutations')
125
+            );
126
+        });
127
+        $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar', function(GenericEvent $event) {
128
+            /** @var Backend $backend */
129
+            $backend = $this->getContainer()->query(Backend::class);
130
+            $backend->onCalendarDelete(
131
+                $event->getArgument('calendarData'),
132
+                $event->getArgument('shares')
133
+            );
134
+        });
135
+        $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateShares', function(GenericEvent $event) {
136
+            /** @var Backend $backend */
137
+            $backend = $this->getContainer()->query(Backend::class);
138
+            $backend->onCalendarUpdateShares(
139
+                $event->getArgument('calendarData'),
140
+                $event->getArgument('shares'),
141
+                $event->getArgument('add'),
142
+                $event->getArgument('remove')
143
+            );
144
+        });
145
+
146
+        $listener = function(GenericEvent $event, $eventName) {
147
+            /** @var Backend $backend */
148
+            $backend = $this->getContainer()->query(Backend::class);
149
+
150
+            $subject = Event::SUBJECT_OBJECT_ADD;
151
+            if ($eventName === '\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject') {
152
+                $subject = Event::SUBJECT_OBJECT_UPDATE;
153
+            } else if ($eventName === '\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject') {
154
+                $subject = Event::SUBJECT_OBJECT_DELETE;
155
+            }
156
+            $backend->onTouchCalendarObject(
157
+                $subject,
158
+                $event->getArgument('calendarData'),
159
+                $event->getArgument('shares'),
160
+                $event->getArgument('objectData')
161
+            );
162
+        };
163
+        $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject', $listener);
164
+        $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject', $listener);
165
+        $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject', $listener);
166
+    }
167
+
168
+    public function getSyncService() {
169
+        return $this->getContainer()->query(SyncService::class);
170
+    }
171 171
 
172 172
 }
Please login to merge, or discard this patch.
apps/dav/lib/Migration/FixBirthdayCalendarComponent.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -28,35 +28,35 @@
 block discarded – undo
28 28
 
29 29
 class FixBirthdayCalendarComponent implements IRepairStep {
30 30
 
31
-	/** @var IDBConnection */
32
-	private $connection;
33
-
34
-	/**
35
-	 * FixBirthdayCalendarComponent constructor.
36
-	 *
37
-	 * @param IDBConnection $connection
38
-	 */
39
-	public function __construct(IDBConnection $connection) {
40
-		$this->connection = $connection;
41
-	}
42
-
43
-	/**
44
-	 * @inheritdoc
45
-	 */
46
-	public function getName() {
47
-		return 'Fix component of birthday calendars';
48
-	}
49
-
50
-	/**
51
-	 * @inheritdoc
52
-	 */
53
-	public function run(IOutput $output) {
54
-		$query = $this->connection->getQueryBuilder();
55
-		$updated = $query->update('calendars')
56
-			->set('components', $query->createNamedParameter('VEVENT'))
57
-			->where($query->expr()->eq('uri', $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI)))
58
-			->execute();
59
-
60
-		$output->info("$updated birthday calendars updated.");
61
-	}
31
+    /** @var IDBConnection */
32
+    private $connection;
33
+
34
+    /**
35
+     * FixBirthdayCalendarComponent constructor.
36
+     *
37
+     * @param IDBConnection $connection
38
+     */
39
+    public function __construct(IDBConnection $connection) {
40
+        $this->connection = $connection;
41
+    }
42
+
43
+    /**
44
+     * @inheritdoc
45
+     */
46
+    public function getName() {
47
+        return 'Fix component of birthday calendars';
48
+    }
49
+
50
+    /**
51
+     * @inheritdoc
52
+     */
53
+    public function run(IOutput $output) {
54
+        $query = $this->connection->getQueryBuilder();
55
+        $updated = $query->update('calendars')
56
+            ->set('components', $query->createNamedParameter('VEVENT'))
57
+            ->where($query->expr()->eq('uri', $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI)))
58
+            ->execute();
59
+
60
+        $output->info("$updated birthday calendars updated.");
61
+    }
62 62
 }
Please login to merge, or discard this patch.
apps/dav/lib/Command/SyncBirthdayCalendar.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -33,55 +33,55 @@
 block discarded – undo
33 33
 
34 34
 class SyncBirthdayCalendar extends Command {
35 35
 
36
-	/** @var BirthdayService */
37
-	private $birthdayService;
36
+    /** @var BirthdayService */
37
+    private $birthdayService;
38 38
 
39
-	/** @var IUserManager */
40
-	private $userManager;
39
+    /** @var IUserManager */
40
+    private $userManager;
41 41
 
42
-	/**
43
-	 * @param IUserManager $userManager
44
-	 * @param BirthdayService $birthdayService
45
-	 */
46
-	function __construct(IUserManager $userManager, BirthdayService $birthdayService) {
47
-		parent::__construct();
48
-		$this->birthdayService = $birthdayService;
49
-		$this->userManager = $userManager;
50
-	}
42
+    /**
43
+     * @param IUserManager $userManager
44
+     * @param BirthdayService $birthdayService
45
+     */
46
+    function __construct(IUserManager $userManager, BirthdayService $birthdayService) {
47
+        parent::__construct();
48
+        $this->birthdayService = $birthdayService;
49
+        $this->userManager = $userManager;
50
+    }
51 51
 
52
-	protected function configure() {
53
-		$this
54
-			->setName('dav:sync-birthday-calendar')
55
-			->setDescription('Synchronizes the birthday calendar')
56
-			->addArgument('user',
57
-				InputArgument::OPTIONAL,
58
-				'User for whom the birthday calendar will be synchronized');
59
-	}
52
+    protected function configure() {
53
+        $this
54
+            ->setName('dav:sync-birthday-calendar')
55
+            ->setDescription('Synchronizes the birthday calendar')
56
+            ->addArgument('user',
57
+                InputArgument::OPTIONAL,
58
+                'User for whom the birthday calendar will be synchronized');
59
+    }
60 60
 
61
-	/**
62
-	 * @param InputInterface $input
63
-	 * @param OutputInterface $output
64
-	 */
65
-	protected function execute(InputInterface $input, OutputInterface $output) {
66
-		$user = $input->getArgument('user');
67
-		if (!is_null($user)) {
68
-			if (!$this->userManager->userExists($user)) {
69
-				throw new \InvalidArgumentException("User <$user> in unknown.");
70
-			}
71
-			$output->writeln("Start birthday calendar sync for $user");
72
-			$this->birthdayService->syncUser($user);
73
-			return;
74
-		}
75
-		$output->writeln("Start birthday calendar sync for all users ...");
76
-		$p = new ProgressBar($output);
77
-		$p->start();
78
-		$this->userManager->callForAllUsers(function($user) use ($p)  {
79
-			$p->advance();
80
-			/** @var IUser $user */
81
-			$this->birthdayService->syncUser($user->getUID());
82
-		});
61
+    /**
62
+     * @param InputInterface $input
63
+     * @param OutputInterface $output
64
+     */
65
+    protected function execute(InputInterface $input, OutputInterface $output) {
66
+        $user = $input->getArgument('user');
67
+        if (!is_null($user)) {
68
+            if (!$this->userManager->userExists($user)) {
69
+                throw new \InvalidArgumentException("User <$user> in unknown.");
70
+            }
71
+            $output->writeln("Start birthday calendar sync for $user");
72
+            $this->birthdayService->syncUser($user);
73
+            return;
74
+        }
75
+        $output->writeln("Start birthday calendar sync for all users ...");
76
+        $p = new ProgressBar($output);
77
+        $p->start();
78
+        $this->userManager->callForAllUsers(function($user) use ($p)  {
79
+            $p->advance();
80
+            /** @var IUser $user */
81
+            $this->birthdayService->syncUser($user->getUID());
82
+        });
83 83
 
84
-		$p->finish();
85
-		$output->writeln('');
86
-	}
84
+        $p->finish();
85
+        $output->writeln('');
86
+    }
87 87
 }
Please login to merge, or discard this patch.
apps/dav/lib/Command/SyncSystemAddressBook.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -31,36 +31,36 @@
 block discarded – undo
31 31
 
32 32
 class SyncSystemAddressBook extends Command {
33 33
 
34
-	/** @var SyncService */
35
-	private $syncService;
34
+    /** @var SyncService */
35
+    private $syncService;
36 36
 
37
-	/**
38
-	 * @param SyncService $syncService
39
-	 */
40
-	function __construct(SyncService $syncService) {
41
-		parent::__construct();
42
-		$this->syncService = $syncService;
43
-	}
37
+    /**
38
+     * @param SyncService $syncService
39
+     */
40
+    function __construct(SyncService $syncService) {
41
+        parent::__construct();
42
+        $this->syncService = $syncService;
43
+    }
44 44
 
45
-	protected function configure() {
46
-		$this
47
-			->setName('dav:sync-system-addressbook')
48
-			->setDescription('Synchronizes users to the system addressbook');
49
-	}
45
+    protected function configure() {
46
+        $this
47
+            ->setName('dav:sync-system-addressbook')
48
+            ->setDescription('Synchronizes users to the system addressbook');
49
+    }
50 50
 
51
-	/**
52
-	 * @param InputInterface $input
53
-	 * @param OutputInterface $output
54
-	 */
55
-	protected function execute(InputInterface $input, OutputInterface $output) {
56
-		$output->writeln('Syncing users ...');
57
-		$progress = new ProgressBar($output);
58
-		$progress->start();
59
-		$this->syncService->syncInstance(function() use ($progress) {
60
-			$progress->advance();
61
-		});
51
+    /**
52
+     * @param InputInterface $input
53
+     * @param OutputInterface $output
54
+     */
55
+    protected function execute(InputInterface $input, OutputInterface $output) {
56
+        $output->writeln('Syncing users ...');
57
+        $progress = new ProgressBar($output);
58
+        $progress->start();
59
+        $this->syncService->syncInstance(function() use ($progress) {
60
+            $progress->advance();
61
+        });
62 62
 
63
-		$progress->finish();
64
-		$output->writeln('');
65
-	}
63
+        $progress->finish();
64
+        $output->writeln('');
65
+    }
66 66
 }
Please login to merge, or discard this patch.
apps/dav/lib/Command/CreateCalendar.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -33,53 +33,53 @@
 block discarded – undo
33 33
 
34 34
 class CreateCalendar extends Command {
35 35
 
36
-	/** @var IUserManager */
37
-	protected $userManager;
36
+    /** @var IUserManager */
37
+    protected $userManager;
38 38
 
39
-	/** @var IGroupManager $groupManager */
40
-	private $groupManager;
39
+    /** @var IGroupManager $groupManager */
40
+    private $groupManager;
41 41
 
42
-	/** @var \OCP\IDBConnection */
43
-	protected $dbConnection;
42
+    /** @var \OCP\IDBConnection */
43
+    protected $dbConnection;
44 44
 
45
-	/**
46
-	 * @param IUserManager $userManager
47
-	 * @param IGroupManager $groupManager
48
-	 * @param IDBConnection $dbConnection
49
-	 */
50
-	function __construct(IUserManager $userManager, IGroupManager $groupManager, IDBConnection $dbConnection) {
51
-		parent::__construct();
52
-		$this->userManager = $userManager;
53
-		$this->groupManager = $groupManager;
54
-		$this->dbConnection = $dbConnection;
55
-	}
45
+    /**
46
+     * @param IUserManager $userManager
47
+     * @param IGroupManager $groupManager
48
+     * @param IDBConnection $dbConnection
49
+     */
50
+    function __construct(IUserManager $userManager, IGroupManager $groupManager, IDBConnection $dbConnection) {
51
+        parent::__construct();
52
+        $this->userManager = $userManager;
53
+        $this->groupManager = $groupManager;
54
+        $this->dbConnection = $dbConnection;
55
+    }
56 56
 
57
-	protected function configure() {
58
-		$this
59
-			->setName('dav:create-calendar')
60
-			->setDescription('Create a dav calendar')
61
-			->addArgument('user',
62
-				InputArgument::REQUIRED,
63
-				'User for whom the calendar will be created')
64
-			->addArgument('name',
65
-				InputArgument::REQUIRED,
66
-				'Name of the calendar');
67
-	}
57
+    protected function configure() {
58
+        $this
59
+            ->setName('dav:create-calendar')
60
+            ->setDescription('Create a dav calendar')
61
+            ->addArgument('user',
62
+                InputArgument::REQUIRED,
63
+                'User for whom the calendar will be created')
64
+            ->addArgument('name',
65
+                InputArgument::REQUIRED,
66
+                'Name of the calendar');
67
+    }
68 68
 
69
-	protected function execute(InputInterface $input, OutputInterface $output) {
70
-		$user = $input->getArgument('user');
71
-		if (!$this->userManager->userExists($user)) {
72
-			throw new \InvalidArgumentException("User <$user> in unknown.");
73
-		}
74
-		$principalBackend = new Principal(
75
-			$this->userManager,
76
-			$this->groupManager
77
-		);
78
-		$random = \OC::$server->getSecureRandom();
79
-		$dispatcher = \OC::$server->getEventDispatcher();
69
+    protected function execute(InputInterface $input, OutputInterface $output) {
70
+        $user = $input->getArgument('user');
71
+        if (!$this->userManager->userExists($user)) {
72
+            throw new \InvalidArgumentException("User <$user> in unknown.");
73
+        }
74
+        $principalBackend = new Principal(
75
+            $this->userManager,
76
+            $this->groupManager
77
+        );
78
+        $random = \OC::$server->getSecureRandom();
79
+        $dispatcher = \OC::$server->getEventDispatcher();
80 80
 
81
-		$name = $input->getArgument('name');
82
-		$caldav = new CalDavBackend($this->dbConnection, $principalBackend, $this->userManager, $random, $dispatcher);
83
-		$caldav->createCalendar("principals/users/$user", $name, []);
84
-	}
81
+        $name = $input->getArgument('name');
82
+        $caldav = new CalDavBackend($this->dbConnection, $principalBackend, $this->userManager, $random, $dispatcher);
83
+        $caldav->createCalendar("principals/users/$user", $name, []);
84
+    }
85 85
 }
Please login to merge, or discard this patch.
apps/dav/lib/Command/CreateAddressBook.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -36,43 +36,43 @@
 block discarded – undo
36 36
 
37 37
 class CreateAddressBook extends Command {
38 38
 
39
-	/** @var IUserManager */
40
-	private $userManager;
39
+    /** @var IUserManager */
40
+    private $userManager;
41 41
 
42
-	/** @var CardDavBackend */
43
-	private $cardDavBackend;
42
+    /** @var CardDavBackend */
43
+    private $cardDavBackend;
44 44
 
45
-	/**
46
-	 * @param IUserManager $userManager
47
-	 * @param CardDavBackend $cardDavBackend
48
-	 */
49
-	function __construct(IUserManager $userManager,
50
-						 CardDavBackend $cardDavBackend
51
-	) {
52
-		parent::__construct();
53
-		$this->userManager = $userManager;
54
-		$this->cardDavBackend = $cardDavBackend;
55
-	}
45
+    /**
46
+     * @param IUserManager $userManager
47
+     * @param CardDavBackend $cardDavBackend
48
+     */
49
+    function __construct(IUserManager $userManager,
50
+                            CardDavBackend $cardDavBackend
51
+    ) {
52
+        parent::__construct();
53
+        $this->userManager = $userManager;
54
+        $this->cardDavBackend = $cardDavBackend;
55
+    }
56 56
 
57
-	protected function configure() {
58
-		$this
59
-				->setName('dav:create-addressbook')
60
-				->setDescription('Create a dav addressbook')
61
-				->addArgument('user',
62
-						InputArgument::REQUIRED,
63
-						'User for whom the addressbook will be created')
64
-				->addArgument('name',
65
-						InputArgument::REQUIRED,
66
-						'Name of the addressbook');
67
-	}
57
+    protected function configure() {
58
+        $this
59
+                ->setName('dav:create-addressbook')
60
+                ->setDescription('Create a dav addressbook')
61
+                ->addArgument('user',
62
+                        InputArgument::REQUIRED,
63
+                        'User for whom the addressbook will be created')
64
+                ->addArgument('name',
65
+                        InputArgument::REQUIRED,
66
+                        'Name of the addressbook');
67
+    }
68 68
 
69
-	protected function execute(InputInterface $input, OutputInterface $output) {
70
-		$user = $input->getArgument('user');
71
-		if (!$this->userManager->userExists($user)) {
72
-			throw new \InvalidArgumentException("User <$user> in unknown.");
73
-		}
69
+    protected function execute(InputInterface $input, OutputInterface $output) {
70
+        $user = $input->getArgument('user');
71
+        if (!$this->userManager->userExists($user)) {
72
+            throw new \InvalidArgumentException("User <$user> in unknown.");
73
+        }
74 74
 
75
-		$name = $input->getArgument('name');
76
-		$this->cardDavBackend->createAddressBook("principals/users/$user", $name, []);
77
-	}
75
+        $name = $input->getArgument('name');
76
+        $this->cardDavBackend->createAddressBook("principals/users/$user", $name, []);
77
+    }
78 78
 }
Please login to merge, or discard this patch.
apps/dav/lib/Capabilities.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
26 26
 
27 27
 class Capabilities implements ICapability {
28 28
 
29
-	public function getCapabilities() {
30
-		return [
31
-			'dav' => [
32
-				'chunking' => '1.0',
33
-			]
34
-		];
35
-	}
29
+    public function getCapabilities() {
30
+        return [
31
+            'dav' => [
32
+                'chunking' => '1.0',
33
+            ]
34
+        ];
35
+    }
36 36
 }
Please login to merge, or discard this patch.