Passed
Push — master ( 8593ed...6e3b9e )
by Roeland
12:18
created
apps/files/lib/Activity/FavoriteProvider.php 1 patch
Indentation   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -31,147 +31,147 @@
 block discarded – undo
31 31
 
32 32
 class FavoriteProvider implements IProvider {
33 33
 
34
-	const SUBJECT_ADDED = 'added_favorite';
35
-	const SUBJECT_REMOVED = 'removed_favorite';
36
-
37
-	/** @var IFactory */
38
-	protected $languageFactory;
39
-
40
-	/** @var IL10N */
41
-	protected $l;
42
-
43
-	/** @var IURLGenerator */
44
-	protected $url;
45
-
46
-	/** @var IManager */
47
-	protected $activityManager;
48
-
49
-	/** @var IEventMerger */
50
-	protected $eventMerger;
51
-
52
-	/**
53
-	 * @param IFactory $languageFactory
54
-	 * @param IURLGenerator $url
55
-	 * @param IManager $activityManager
56
-	 * @param IEventMerger $eventMerger
57
-	 */
58
-	public function __construct(IFactory $languageFactory, IURLGenerator $url, IManager $activityManager, IEventMerger $eventMerger) {
59
-		$this->languageFactory = $languageFactory;
60
-		$this->url = $url;
61
-		$this->activityManager = $activityManager;
62
-		$this->eventMerger = $eventMerger;
63
-	}
64
-
65
-	/**
66
-	 * @param string $language
67
-	 * @param IEvent $event
68
-	 * @param IEvent|null $previousEvent
69
-	 * @return IEvent
70
-	 * @throws \InvalidArgumentException
71
-	 * @since 11.0.0
72
-	 */
73
-	public function parse($language, IEvent $event, IEvent $previousEvent = null) {
74
-		if ($event->getApp() !== 'files' || $event->getType() !== 'favorite') {
75
-			throw new \InvalidArgumentException();
76
-		}
77
-
78
-		$this->l = $this->languageFactory->get('files', $language);
79
-
80
-		if ($this->activityManager->isFormattingFilteredObject()) {
81
-			try {
82
-				return $this->parseShortVersion($event);
83
-			} catch (\InvalidArgumentException $e) {
84
-				// Ignore and simply use the long version...
85
-			}
86
-		}
87
-
88
-		return $this->parseLongVersion($event, $previousEvent);
89
-	}
90
-
91
-	/**
92
-	 * @param IEvent $event
93
-	 * @return IEvent
94
-	 * @throws \InvalidArgumentException
95
-	 * @since 11.0.0
96
-	 */
97
-	public function parseShortVersion(IEvent $event) {
98
-
99
-		if ($event->getSubject() === self::SUBJECT_ADDED) {
100
-			$event->setParsedSubject($this->l->t('Added to favorites'));
101
-			if ($this->activityManager->getRequirePNG()) {
102
-				$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png')));
103
-			} else {
104
-				$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
105
-			}
106
-		} else if ($event->getSubject() === self::SUBJECT_REMOVED) {
107
-			$event->setParsedSubject($this->l->t('Removed from favorites'));
108
-			if ($this->activityManager->getRequirePNG()) {
109
-				$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png')));
110
-			} else {
111
-				$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg')));
112
-			}
113
-		} else {
114
-			throw new \InvalidArgumentException();
115
-		}
116
-
117
-		return $event;
118
-	}
119
-
120
-	/**
121
-	 * @param IEvent $event
122
-	 * @param IEvent|null $previousEvent
123
-	 * @return IEvent
124
-	 * @throws \InvalidArgumentException
125
-	 * @since 11.0.0
126
-	 */
127
-	public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) {
128
-
129
-		if ($event->getSubject() === self::SUBJECT_ADDED) {
130
-			$subject = $this->l->t('You added {file} to your favorites');
131
-			if ($this->activityManager->getRequirePNG()) {
132
-				$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png')));
133
-			} else {
134
-				$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
135
-			}
136
-		} else if ($event->getSubject() === self::SUBJECT_REMOVED) {
137
-			$subject = $this->l->t('You removed {file} from your favorites');
138
-			if ($this->activityManager->getRequirePNG()) {
139
-				$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png')));
140
-			} else {
141
-				$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg')));
142
-			}
143
-		} else {
144
-			throw new \InvalidArgumentException();
145
-		}
146
-
147
-		$this->setSubjects($event, $subject);
148
-		$event = $this->eventMerger->mergeEvents('file', $event, $previousEvent);
149
-		return $event;
150
-	}
151
-
152
-	/**
153
-	 * @param IEvent $event
154
-	 * @param string $subject
155
-	 */
156
-	protected function setSubjects(IEvent $event, $subject) {
157
-		$subjectParams = $event->getSubjectParameters();
158
-		if (empty($subjectParams)) {
159
-			// Try to fall back to the old way, but this does not work for emails.
160
-			// But at least old activities still work.
161
-			$subjectParams = [
162
-				'id' => $event->getObjectId(),
163
-				'path' => $event->getObjectName(),
164
-			];
165
-		}
166
-		$parameter = [
167
-			'type' => 'file',
168
-			'id' => $subjectParams['id'],
169
-			'name' => basename($subjectParams['path']),
170
-			'path' => trim($subjectParams['path'], '/'),
171
-			'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $subjectParams['id']]),
172
-		];
173
-
174
-		$event->setParsedSubject(str_replace('{file}', $parameter['path'], $subject))
175
-			->setRichSubject($subject, ['file' => $parameter]);
176
-	}
34
+    const SUBJECT_ADDED = 'added_favorite';
35
+    const SUBJECT_REMOVED = 'removed_favorite';
36
+
37
+    /** @var IFactory */
38
+    protected $languageFactory;
39
+
40
+    /** @var IL10N */
41
+    protected $l;
42
+
43
+    /** @var IURLGenerator */
44
+    protected $url;
45
+
46
+    /** @var IManager */
47
+    protected $activityManager;
48
+
49
+    /** @var IEventMerger */
50
+    protected $eventMerger;
51
+
52
+    /**
53
+     * @param IFactory $languageFactory
54
+     * @param IURLGenerator $url
55
+     * @param IManager $activityManager
56
+     * @param IEventMerger $eventMerger
57
+     */
58
+    public function __construct(IFactory $languageFactory, IURLGenerator $url, IManager $activityManager, IEventMerger $eventMerger) {
59
+        $this->languageFactory = $languageFactory;
60
+        $this->url = $url;
61
+        $this->activityManager = $activityManager;
62
+        $this->eventMerger = $eventMerger;
63
+    }
64
+
65
+    /**
66
+     * @param string $language
67
+     * @param IEvent $event
68
+     * @param IEvent|null $previousEvent
69
+     * @return IEvent
70
+     * @throws \InvalidArgumentException
71
+     * @since 11.0.0
72
+     */
73
+    public function parse($language, IEvent $event, IEvent $previousEvent = null) {
74
+        if ($event->getApp() !== 'files' || $event->getType() !== 'favorite') {
75
+            throw new \InvalidArgumentException();
76
+        }
77
+
78
+        $this->l = $this->languageFactory->get('files', $language);
79
+
80
+        if ($this->activityManager->isFormattingFilteredObject()) {
81
+            try {
82
+                return $this->parseShortVersion($event);
83
+            } catch (\InvalidArgumentException $e) {
84
+                // Ignore and simply use the long version...
85
+            }
86
+        }
87
+
88
+        return $this->parseLongVersion($event, $previousEvent);
89
+    }
90
+
91
+    /**
92
+     * @param IEvent $event
93
+     * @return IEvent
94
+     * @throws \InvalidArgumentException
95
+     * @since 11.0.0
96
+     */
97
+    public function parseShortVersion(IEvent $event) {
98
+
99
+        if ($event->getSubject() === self::SUBJECT_ADDED) {
100
+            $event->setParsedSubject($this->l->t('Added to favorites'));
101
+            if ($this->activityManager->getRequirePNG()) {
102
+                $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png')));
103
+            } else {
104
+                $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
105
+            }
106
+        } else if ($event->getSubject() === self::SUBJECT_REMOVED) {
107
+            $event->setParsedSubject($this->l->t('Removed from favorites'));
108
+            if ($this->activityManager->getRequirePNG()) {
109
+                $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png')));
110
+            } else {
111
+                $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg')));
112
+            }
113
+        } else {
114
+            throw new \InvalidArgumentException();
115
+        }
116
+
117
+        return $event;
118
+    }
119
+
120
+    /**
121
+     * @param IEvent $event
122
+     * @param IEvent|null $previousEvent
123
+     * @return IEvent
124
+     * @throws \InvalidArgumentException
125
+     * @since 11.0.0
126
+     */
127
+    public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) {
128
+
129
+        if ($event->getSubject() === self::SUBJECT_ADDED) {
130
+            $subject = $this->l->t('You added {file} to your favorites');
131
+            if ($this->activityManager->getRequirePNG()) {
132
+                $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png')));
133
+            } else {
134
+                $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
135
+            }
136
+        } else if ($event->getSubject() === self::SUBJECT_REMOVED) {
137
+            $subject = $this->l->t('You removed {file} from your favorites');
138
+            if ($this->activityManager->getRequirePNG()) {
139
+                $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png')));
140
+            } else {
141
+                $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg')));
142
+            }
143
+        } else {
144
+            throw new \InvalidArgumentException();
145
+        }
146
+
147
+        $this->setSubjects($event, $subject);
148
+        $event = $this->eventMerger->mergeEvents('file', $event, $previousEvent);
149
+        return $event;
150
+    }
151
+
152
+    /**
153
+     * @param IEvent $event
154
+     * @param string $subject
155
+     */
156
+    protected function setSubjects(IEvent $event, $subject) {
157
+        $subjectParams = $event->getSubjectParameters();
158
+        if (empty($subjectParams)) {
159
+            // Try to fall back to the old way, but this does not work for emails.
160
+            // But at least old activities still work.
161
+            $subjectParams = [
162
+                'id' => $event->getObjectId(),
163
+                'path' => $event->getObjectName(),
164
+            ];
165
+        }
166
+        $parameter = [
167
+            'type' => 'file',
168
+            'id' => $subjectParams['id'],
169
+            'name' => basename($subjectParams['path']),
170
+            'path' => trim($subjectParams['path'], '/'),
171
+            'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $subjectParams['id']]),
172
+        ];
173
+
174
+        $event->setParsedSubject(str_replace('{file}', $parameter['path'], $subject))
175
+            ->setRichSubject($subject, ['file' => $parameter]);
176
+    }
177 177
 }
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/Settings/Personal.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 	 */
65 65
 	public function getForm() {
66 66
 		$cloudID = $this->userSession->getUser()->getCloudId();
67
-		$url = 'https://nextcloud.com/federation#' . $cloudID;
67
+		$url = 'https://nextcloud.com/federation#'.$cloudID;
68 68
 
69 69
 		$parameters = [
70 70
 			'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(),
Please login to merge, or discard this patch.
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -33,65 +33,65 @@
 block discarded – undo
33 33
 
34 34
 class Personal implements ISettings {
35 35
 
36
-	/** @var FederatedShareProvider */
37
-	private $federatedShareProvider;
38
-	/** @var IUserSession */
39
-	private $userSession;
40
-	/** @var IL10N */
41
-	private $l;
42
-	/** @var \OC_Defaults */
43
-	private $defaults;
36
+    /** @var FederatedShareProvider */
37
+    private $federatedShareProvider;
38
+    /** @var IUserSession */
39
+    private $userSession;
40
+    /** @var IL10N */
41
+    private $l;
42
+    /** @var \OC_Defaults */
43
+    private $defaults;
44 44
 
45
-	public function __construct(
46
-		FederatedShareProvider $federatedShareProvider, #
47
-		IUserSession $userSession,
48
-		IL10N $l,
49
-		\OC_Defaults $defaults
50
-	) {
51
-		$this->federatedShareProvider = $federatedShareProvider;
52
-		$this->userSession = $userSession;
53
-		$this->l = $l;
54
-		$this->defaults = $defaults;
55
-	}
45
+    public function __construct(
46
+        FederatedShareProvider $federatedShareProvider, #
47
+        IUserSession $userSession,
48
+        IL10N $l,
49
+        \OC_Defaults $defaults
50
+    ) {
51
+        $this->federatedShareProvider = $federatedShareProvider;
52
+        $this->userSession = $userSession;
53
+        $this->l = $l;
54
+        $this->defaults = $defaults;
55
+    }
56 56
 
57
-	/**
58
-	 * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
59
-	 * @since 9.1
60
-	 */
61
-	public function getForm() {
62
-		$cloudID = $this->userSession->getUser()->getCloudId();
63
-		$url = 'https://nextcloud.com/federation#' . $cloudID;
57
+    /**
58
+     * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
59
+     * @since 9.1
60
+     */
61
+    public function getForm() {
62
+        $cloudID = $this->userSession->getUser()->getCloudId();
63
+        $url = 'https://nextcloud.com/federation#' . $cloudID;
64 64
 
65
-		$parameters = [
66
-			'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(),
67
-			'message_with_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID, see %s', [$url]),
68
-			'message_without_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID', [$cloudID]),
69
-			'logoPath' => $this->defaults->getLogo(),
70
-			'reference' => $url,
71
-			'cloudId' => $cloudID,
72
-			'color' => $this->defaults->getColorPrimary(),
73
-			'textColor' => "#ffffff",
74
-		];
75
-		return new TemplateResponse('federatedfilesharing', 'settings-personal', $parameters, '');
76
-	}
65
+        $parameters = [
66
+            'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(),
67
+            'message_with_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID, see %s', [$url]),
68
+            'message_without_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID', [$cloudID]),
69
+            'logoPath' => $this->defaults->getLogo(),
70
+            'reference' => $url,
71
+            'cloudId' => $cloudID,
72
+            'color' => $this->defaults->getColorPrimary(),
73
+            'textColor' => "#ffffff",
74
+        ];
75
+        return new TemplateResponse('federatedfilesharing', 'settings-personal', $parameters, '');
76
+    }
77 77
 
78
-	/**
79
-	 * @return string the section ID, e.g. 'sharing'
80
-	 * @since 9.1
81
-	 */
82
-	public function getSection() {
83
-		return 'sharing';
84
-	}
78
+    /**
79
+     * @return string the section ID, e.g. 'sharing'
80
+     * @since 9.1
81
+     */
82
+    public function getSection() {
83
+        return 'sharing';
84
+    }
85 85
 
86
-	/**
87
-	 * @return int whether the form should be rather on the top or bottom of
88
-	 * the admin section. The forms are arranged in ascending order of the
89
-	 * priority values. It is required to return a value between 0 and 100.
90
-	 *
91
-	 * E.g.: 70
92
-	 * @since 9.1
93
-	 */
94
-	public function getPriority() {
95
-		return 40;
96
-	}
86
+    /**
87
+     * @return int whether the form should be rather on the top or bottom of
88
+     * the admin section. The forms are arranged in ascending order of the
89
+     * priority values. It is required to return a value between 0 and 100.
90
+     *
91
+     * E.g.: 70
92
+     * @since 9.1
93
+     */
94
+    public function getPriority() {
95
+        return 40;
96
+    }
97 97
 }
Please login to merge, or discard this patch.
settings/templates/settings/empty.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,5 +21,5 @@
 block discarded – undo
21 21
  *
22 22
  */
23 23
 
24
-	# used for Personal/Additional settings as fallback for legacy settings
24
+    # used for Personal/Additional settings as fallback for legacy settings
25 25
 ?>
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/Settings/PersonalSection.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -29,58 +29,58 @@
 block discarded – undo
29 29
 use OCP\Settings\IIconSection;
30 30
 
31 31
 class PersonalSection implements IIconSection {
32
-	/** @var IURLGenerator */
33
-	private $urlGenerator;
34
-	/** @var IL10N */
35
-	private $l;
32
+    /** @var IURLGenerator */
33
+    private $urlGenerator;
34
+    /** @var IL10N */
35
+    private $l;
36 36
 
37
-	public function __construct(IURLGenerator $urlGenerator, IL10N $l) {
38
-		$this->urlGenerator = $urlGenerator;
39
-		$this->l = $l;
40
-	}
37
+    public function __construct(IURLGenerator $urlGenerator, IL10N $l) {
38
+        $this->urlGenerator = $urlGenerator;
39
+        $this->l = $l;
40
+    }
41 41
 
42
-	/**
43
-	 * returns the relative path to an 16*16 icon describing the section.
44
-	 * e.g. '/core/img/places/files.svg'
45
-	 *
46
-	 * @returns string
47
-	 * @since 13.0.0
48
-	 */
49
-	public function getIcon() {
50
-		return $this->urlGenerator->imagePath('core', 'actions/share.svg');
51
-	}
42
+    /**
43
+     * returns the relative path to an 16*16 icon describing the section.
44
+     * e.g. '/core/img/places/files.svg'
45
+     *
46
+     * @returns string
47
+     * @since 13.0.0
48
+     */
49
+    public function getIcon() {
50
+        return $this->urlGenerator->imagePath('core', 'actions/share.svg');
51
+    }
52 52
 
53
-	/**
54
-	 * returns the ID of the section. It is supposed to be a lower case string,
55
-	 * e.g. 'ldap'
56
-	 *
57
-	 * @returns string
58
-	 * @since 9.1
59
-	 */
60
-	public function getID() {
61
-		return 'sharing';
62
-	}
53
+    /**
54
+     * returns the ID of the section. It is supposed to be a lower case string,
55
+     * e.g. 'ldap'
56
+     *
57
+     * @returns string
58
+     * @since 9.1
59
+     */
60
+    public function getID() {
61
+        return 'sharing';
62
+    }
63 63
 
64
-	/**
65
-	 * returns the translated name as it should be displayed, e.g. 'LDAP / AD
66
-	 * integration'. Use the L10N service to translate it.
67
-	 *
68
-	 * @return string
69
-	 * @since 9.1
70
-	 */
71
-	public function getName() {
72
-		return $this->l->t('Sharing');
73
-	}
64
+    /**
65
+     * returns the translated name as it should be displayed, e.g. 'LDAP / AD
66
+     * integration'. Use the L10N service to translate it.
67
+     *
68
+     * @return string
69
+     * @since 9.1
70
+     */
71
+    public function getName() {
72
+        return $this->l->t('Sharing');
73
+    }
74 74
 
75
-	/**
76
-	 * @return int whether the form should be rather on the top or bottom of
77
-	 * the settings navigation. The sections are arranged in ascending order of
78
-	 * the priority values. It is required to return a value between 0 and 99.
79
-	 *
80
-	 * E.g.: 70
81
-	 * @since 9.1
82
-	 */
83
-	public function getPriority() {
84
-		return 15;
85
-	}
75
+    /**
76
+     * @return int whether the form should be rather on the top or bottom of
77
+     * the settings navigation. The sections are arranged in ascending order of
78
+     * the priority values. It is required to return a value between 0 and 99.
79
+     *
80
+     * E.g.: 70
81
+     * @since 9.1
82
+     */
83
+    public function getPriority() {
84
+        return 15;
85
+    }
86 86
 }
Please login to merge, or discard this patch.
apps/encryption/lib/Settings/Personal.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -33,63 +33,63 @@
 block discarded – undo
33 33
 
34 34
 class Personal implements  ISettings {
35 35
 
36
-	/** @var IConfig */
37
-	private $config;
38
-	/** @var Session */
39
-	private $session;
40
-	/** @var Util */
41
-	private $util;
42
-	/** @var IUserSession */
43
-	private $userSession;
36
+    /** @var IConfig */
37
+    private $config;
38
+    /** @var Session */
39
+    private $session;
40
+    /** @var Util */
41
+    private $util;
42
+    /** @var IUserSession */
43
+    private $userSession;
44 44
 
45
-	public function __construct(IConfig $config, Session $session, Util $util, IUserSession $userSession) {
46
-		$this->config = $config;
47
-		$this->session = $session;
48
-		$this->util = $util;
49
-		$this->userSession = $userSession;
50
-	}
45
+    public function __construct(IConfig $config, Session $session, Util $util, IUserSession $userSession) {
46
+        $this->config = $config;
47
+        $this->session = $session;
48
+        $this->util = $util;
49
+        $this->userSession = $userSession;
50
+    }
51 51
 
52
-	/**
53
-	 * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
54
-	 * @since 9.1
55
-	 */
56
-	public function getForm() {
57
-		$recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled');
58
-		$privateKeySet = $this->session->isPrivateKeySet();
52
+    /**
53
+     * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
54
+     * @since 9.1
55
+     */
56
+    public function getForm() {
57
+        $recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled');
58
+        $privateKeySet = $this->session->isPrivateKeySet();
59 59
 
60
-		if (!$recoveryAdminEnabled && $privateKeySet) {
61
-			return new TemplateResponse('settings', 'settings/empty', [], '');
62
-		}
60
+        if (!$recoveryAdminEnabled && $privateKeySet) {
61
+            return new TemplateResponse('settings', 'settings/empty', [], '');
62
+        }
63 63
 
64
-		$userId = $this->userSession->getUser()->getUID();
65
-		$recoveryEnabledForUser = $this->util->isRecoveryEnabledForUser($userId);
64
+        $userId = $this->userSession->getUser()->getUID();
65
+        $recoveryEnabledForUser = $this->util->isRecoveryEnabledForUser($userId);
66 66
 
67
-		$parameters = [
68
-			'recoveryEnabled' => $recoveryAdminEnabled,
69
-			'recoveryEnabledForUser' => $recoveryEnabledForUser,
70
-			'privateKeySet' => $privateKeySet,
71
-			'initialized' => $this->session->getStatus(),
72
-		];
73
-		return new TemplateResponse('encryption', 'settings-personal', $parameters, '');
74
-	}
67
+        $parameters = [
68
+            'recoveryEnabled' => $recoveryAdminEnabled,
69
+            'recoveryEnabledForUser' => $recoveryEnabledForUser,
70
+            'privateKeySet' => $privateKeySet,
71
+            'initialized' => $this->session->getStatus(),
72
+        ];
73
+        return new TemplateResponse('encryption', 'settings-personal', $parameters, '');
74
+    }
75 75
 
76
-	/**
77
-	 * @return string the section ID, e.g. 'sharing'
78
-	 * @since 9.1
79
-	 */
80
-	public function getSection() {
81
-		return 'security';
82
-	}
76
+    /**
77
+     * @return string the section ID, e.g. 'sharing'
78
+     * @since 9.1
79
+     */
80
+    public function getSection() {
81
+        return 'security';
82
+    }
83 83
 
84
-	/**
85
-	 * @return int whether the form should be rather on the top or bottom of
86
-	 * the admin section. The forms are arranged in ascending order of the
87
-	 * priority values. It is required to return a value between 0 and 100.
88
-	 *
89
-	 * E.g.: 70
90
-	 * @since 9.1
91
-	 */
92
-	public function getPriority() {
93
-		return 80;
94
-	}
84
+    /**
85
+     * @return int whether the form should be rather on the top or bottom of
86
+     * the admin section. The forms are arranged in ascending order of the
87
+     * priority values. It is required to return a value between 0 and 100.
88
+     *
89
+     * E.g.: 70
90
+     * @since 9.1
91
+     */
92
+    public function getPriority() {
93
+        return 80;
94
+    }
95 95
 }
Please login to merge, or discard this patch.
core/Controller/OCSController.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			'edition' => '',
96 96
 		);
97 97
 
98
-		if($this->userSession->isLoggedIn()) {
98
+		if ($this->userSession->isLoggedIn()) {
99 99
 			$result['capabilities'] = $this->capabilitiesManager->getCapabilities();
100 100
 		} else {
101 101
 			$result['capabilities'] = $this->capabilitiesManager->getCapabilities(true);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	public function getIdentityProof($cloudId) {
139 139
 		$userObject = $this->userManager->get($cloudId);
140 140
 
141
-		if($userObject !== null) {
141
+		if ($userObject !== null) {
142 142
 			$key = $this->keyManager->getKey($userObject);
143 143
 			$data = [
144 144
 				'public' => $key->getPublic(),
Please login to merge, or discard this patch.
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -30,122 +30,122 @@
 block discarded – undo
30 30
 
31 31
 class OCSController extends \OCP\AppFramework\OCSController {
32 32
 
33
-	/** @var CapabilitiesManager */
34
-	private $capabilitiesManager;
35
-	/** @var IUserSession */
36
-	private $userSession;
37
-	/** @var IUserManager */
38
-	private $userManager;
39
-	/** @var Manager */
40
-	private $keyManager;
33
+    /** @var CapabilitiesManager */
34
+    private $capabilitiesManager;
35
+    /** @var IUserSession */
36
+    private $userSession;
37
+    /** @var IUserManager */
38
+    private $userManager;
39
+    /** @var Manager */
40
+    private $keyManager;
41 41
 
42
-	/**
43
-	 * OCSController constructor.
44
-	 *
45
-	 * @param string $appName
46
-	 * @param IRequest $request
47
-	 * @param CapabilitiesManager $capabilitiesManager
48
-	 * @param IUserSession $userSession
49
-	 * @param IUserManager $userManager
50
-	 * @param Manager $keyManager
51
-	 */
52
-	public function __construct($appName,
53
-								IRequest $request,
54
-								CapabilitiesManager $capabilitiesManager,
55
-								IUserSession $userSession,
56
-								IUserManager $userManager,
57
-								Manager $keyManager) {
58
-		parent::__construct($appName, $request);
59
-		$this->capabilitiesManager = $capabilitiesManager;
60
-		$this->userSession = $userSession;
61
-		$this->userManager = $userManager;
62
-		$this->keyManager = $keyManager;
63
-	}
42
+    /**
43
+     * OCSController constructor.
44
+     *
45
+     * @param string $appName
46
+     * @param IRequest $request
47
+     * @param CapabilitiesManager $capabilitiesManager
48
+     * @param IUserSession $userSession
49
+     * @param IUserManager $userManager
50
+     * @param Manager $keyManager
51
+     */
52
+    public function __construct($appName,
53
+                                IRequest $request,
54
+                                CapabilitiesManager $capabilitiesManager,
55
+                                IUserSession $userSession,
56
+                                IUserManager $userManager,
57
+                                Manager $keyManager) {
58
+        parent::__construct($appName, $request);
59
+        $this->capabilitiesManager = $capabilitiesManager;
60
+        $this->userSession = $userSession;
61
+        $this->userManager = $userManager;
62
+        $this->keyManager = $keyManager;
63
+    }
64 64
 
65
-	/**
66
-	 * @PublicPage
67
-	 *
68
-	 * @return DataResponse
69
-	 */
70
-	public function getConfig() {
71
-		$data = [
72
-			'version' => '1.7',
73
-			'website' => 'Nextcloud',
74
-			'host' => $this->request->getServerHost(),
75
-			'contact' => '',
76
-			'ssl' => 'false',
77
-		];
65
+    /**
66
+     * @PublicPage
67
+     *
68
+     * @return DataResponse
69
+     */
70
+    public function getConfig() {
71
+        $data = [
72
+            'version' => '1.7',
73
+            'website' => 'Nextcloud',
74
+            'host' => $this->request->getServerHost(),
75
+            'contact' => '',
76
+            'ssl' => 'false',
77
+        ];
78 78
 
79
-		return new DataResponse($data);
80
-	}
79
+        return new DataResponse($data);
80
+    }
81 81
 
82
-	/**
83
-	 * @PublicPage
84
-	 *
85
-	 * @return DataResponse
86
-	 */
87
-	public function getCapabilities() {
88
-		$result = [];
89
-		list($major, $minor, $micro) = \OCP\Util::getVersion();
90
-		$result['version'] = array(
91
-			'major' => $major,
92
-			'minor' => $minor,
93
-			'micro' => $micro,
94
-			'string' => \OC_Util::getVersionString(),
95
-			'edition' => '',
96
-		);
82
+    /**
83
+     * @PublicPage
84
+     *
85
+     * @return DataResponse
86
+     */
87
+    public function getCapabilities() {
88
+        $result = [];
89
+        list($major, $minor, $micro) = \OCP\Util::getVersion();
90
+        $result['version'] = array(
91
+            'major' => $major,
92
+            'minor' => $minor,
93
+            'micro' => $micro,
94
+            'string' => \OC_Util::getVersionString(),
95
+            'edition' => '',
96
+        );
97 97
 
98
-		if($this->userSession->isLoggedIn()) {
99
-			$result['capabilities'] = $this->capabilitiesManager->getCapabilities();
100
-		} else {
101
-			$result['capabilities'] = $this->capabilitiesManager->getCapabilities(true);
102
-		}
98
+        if($this->userSession->isLoggedIn()) {
99
+            $result['capabilities'] = $this->capabilitiesManager->getCapabilities();
100
+        } else {
101
+            $result['capabilities'] = $this->capabilitiesManager->getCapabilities(true);
102
+        }
103 103
 
104
-		return new DataResponse($result);
105
-	}
104
+        return new DataResponse($result);
105
+    }
106 106
 
107
-	/**
108
-	 * @PublicPage
109
-	 * @BruteForceProtection(action=login)
110
-	 *
111
-	 * @param string $login
112
-	 * @param string $password
113
-	 * @return DataResponse
114
-	 */
115
-	public function personCheck($login = '', $password = '') {
116
-		if ($login !== '' && $password !== '') {
117
-			if ($this->userManager->checkPassword($login, $password)) {
118
-				return new DataResponse([
119
-					'person' => [
120
-						'personid' => $login
121
-					]
122
-				]);
123
-			}
107
+    /**
108
+     * @PublicPage
109
+     * @BruteForceProtection(action=login)
110
+     *
111
+     * @param string $login
112
+     * @param string $password
113
+     * @return DataResponse
114
+     */
115
+    public function personCheck($login = '', $password = '') {
116
+        if ($login !== '' && $password !== '') {
117
+            if ($this->userManager->checkPassword($login, $password)) {
118
+                return new DataResponse([
119
+                    'person' => [
120
+                        'personid' => $login
121
+                    ]
122
+                ]);
123
+            }
124 124
 
125
-			$response = new DataResponse([], 102);
126
-			$response->throttle();
127
-			return $response;
128
-		}
129
-		return new DataResponse([], 101);
130
-	}
125
+            $response = new DataResponse([], 102);
126
+            $response->throttle();
127
+            return $response;
128
+        }
129
+        return new DataResponse([], 101);
130
+    }
131 131
 
132
-	/**
133
-	 * @PublicPage
134
-	 *
135
-	 * @param string $cloudId
136
-	 * @return DataResponse
137
-	 */
138
-	public function getIdentityProof($cloudId) {
139
-		$userObject = $this->userManager->get($cloudId);
132
+    /**
133
+     * @PublicPage
134
+     *
135
+     * @param string $cloudId
136
+     * @return DataResponse
137
+     */
138
+    public function getIdentityProof($cloudId) {
139
+        $userObject = $this->userManager->get($cloudId);
140 140
 
141
-		if($userObject !== null) {
142
-			$key = $this->keyManager->getKey($userObject);
143
-			$data = [
144
-				'public' => $key->getPublic(),
145
-			];
146
-			return new DataResponse($data);
147
-		}
141
+        if($userObject !== null) {
142
+            $key = $this->keyManager->getKey($userObject);
143
+            $data = [
144
+                'public' => $key->getPublic(),
145
+            ];
146
+            return new DataResponse($data);
147
+        }
148 148
 
149
-		return new DataResponse(['User not found'], 404);
150
-	}
149
+        return new DataResponse(['User not found'], 404);
150
+    }
151 151
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/Actions/GroupManagement.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -38,71 +38,71 @@
 block discarded – undo
38 38
  */
39 39
 class GroupManagement extends Action {
40 40
 
41
-	/**
42
-	 * log add user to group event
43
-	 *
44
-	 * @param IGroup $group
45
-	 * @param IUser $user
46
-	 */
47
-	public function addUser(IGroup $group, IUser $user) {
48
-		$this->log('User "%s" added to group "%s"',
49
-			[
50
-				'group' => $group->getGID(),
51
-				'user' => $user->getUID()
52
-			],
53
-			[
54
-				'user', 'group'
55
-			]
56
-		);
57
-	}
41
+    /**
42
+     * log add user to group event
43
+     *
44
+     * @param IGroup $group
45
+     * @param IUser $user
46
+     */
47
+    public function addUser(IGroup $group, IUser $user) {
48
+        $this->log('User "%s" added to group "%s"',
49
+            [
50
+                'group' => $group->getGID(),
51
+                'user' => $user->getUID()
52
+            ],
53
+            [
54
+                'user', 'group'
55
+            ]
56
+        );
57
+    }
58 58
 
59
-	/**
60
-	 * log remove user from group event
61
-	 *
62
-	 * @param IGroup $group
63
-	 * @param IUser $user
64
-	 */
65
-	public function removeUser(IGroup $group, IUser $user) {
66
-		$this->log('User "%s" removed from group "%s"',
67
-			[
68
-				'group' => $group->getGID(),
69
-				'user' => $user->getUID()
70
-			],
71
-			[
72
-				'user', 'group'
73
-			]
74
-		);
75
-	}
59
+    /**
60
+     * log remove user from group event
61
+     *
62
+     * @param IGroup $group
63
+     * @param IUser $user
64
+     */
65
+    public function removeUser(IGroup $group, IUser $user) {
66
+        $this->log('User "%s" removed from group "%s"',
67
+            [
68
+                'group' => $group->getGID(),
69
+                'user' => $user->getUID()
70
+            ],
71
+            [
72
+                'user', 'group'
73
+            ]
74
+        );
75
+    }
76 76
 	
77
-	/**
78
-	 * log create group to group event
79
-	 *
80
-	 * @param IGroup $group
81
-	 */
82
-	public function createGroup(IGroup $group) {
83
-		$this->log('Group created: "%s"',
84
-			[
85
-				'group' => $group->getGID()
86
-			],
87
-			[
88
-				'group'
89
-			]
90
-		);
91
-	}
77
+    /**
78
+     * log create group to group event
79
+     *
80
+     * @param IGroup $group
81
+     */
82
+    public function createGroup(IGroup $group) {
83
+        $this->log('Group created: "%s"',
84
+            [
85
+                'group' => $group->getGID()
86
+            ],
87
+            [
88
+                'group'
89
+            ]
90
+        );
91
+    }
92 92
 
93
-	/**
94
-	 * log delete group to group event
95
-	 *
96
-	 * @param IGroup $group
97
-	 */
98
-	public function deleteGroup(IGroup $group) {
99
-		$this->log('Group deleted: "%s"',
100
-			[
101
-				'group' => $group->getGID()
102
-			],
103
-			[
104
-				'group'
105
-			]
106
-		);
107
-	}
93
+    /**
94
+     * log delete group to group event
95
+     *
96
+     * @param IGroup $group
97
+     */
98
+    public function deleteGroup(IGroup $group) {
99
+        $this->log('Group deleted: "%s"',
100
+            [
101
+                'group' => $group->getGID()
102
+            ],
103
+            [
104
+                'group'
105
+            ]
106
+        );
107
+    }
108 108
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/Actions/Files.php 1 patch
Indentation   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -29,137 +29,137 @@
 block discarded – undo
29 29
  * @package OCA\AdminAudit\Actions
30 30
  */
31 31
 class Files extends Action {
32
-	/**
33
-	 * Logs file read actions
34
-	 *
35
-	 * @param array $params
36
-	 */
37
-	public function read(array $params) {
38
-		$this->log(
39
-			'File accessed: "%s"',
40
-			$params,
41
-			[
42
-				'path',
43
-			]
44
-		);
45
-	}
32
+    /**
33
+     * Logs file read actions
34
+     *
35
+     * @param array $params
36
+     */
37
+    public function read(array $params) {
38
+        $this->log(
39
+            'File accessed: "%s"',
40
+            $params,
41
+            [
42
+                'path',
43
+            ]
44
+        );
45
+    }
46 46
 
47
-	/**
48
-	 * Logs rename actions of files
49
-	 *
50
-	 * @param array $params
51
-	 */
52
-	public function rename(array $params) {
53
-		$this->log(
54
-			'File renamed: "%s" to "%s"',
55
-			$params,
56
-			[
57
-				'oldpath',
58
-				'newpath',
59
-			]
60
-		);
61
-	}
47
+    /**
48
+     * Logs rename actions of files
49
+     *
50
+     * @param array $params
51
+     */
52
+    public function rename(array $params) {
53
+        $this->log(
54
+            'File renamed: "%s" to "%s"',
55
+            $params,
56
+            [
57
+                'oldpath',
58
+                'newpath',
59
+            ]
60
+        );
61
+    }
62 62
 
63
-	/**
64
-	 * Logs creation of files
65
-	 *
66
-	 * @param array $params
67
-	 */
68
-	public function create(array $params) {
69
-		if ($params['path'] === '/' || $params['path'] === '' || $params['path'] === null) {
70
-			return;
71
-		}
63
+    /**
64
+     * Logs creation of files
65
+     *
66
+     * @param array $params
67
+     */
68
+    public function create(array $params) {
69
+        if ($params['path'] === '/' || $params['path'] === '' || $params['path'] === null) {
70
+            return;
71
+        }
72 72
 
73
-		$this->log(
74
-			'File created: "%s"',
75
-			$params,
76
-			[
77
-				'path',
78
-			]
79
-		);
80
-	}
73
+        $this->log(
74
+            'File created: "%s"',
75
+            $params,
76
+            [
77
+                'path',
78
+            ]
79
+        );
80
+    }
81 81
 
82
-	/**
83
-	 * Logs copying of files
84
-	 *
85
-	 * @param array $params
86
-	 */
87
-	public function copy(array $params) {
88
-		$this->log(
89
-			'File copied: "%s" to "%s"',
90
-			$params,
91
-			[
92
-				'oldpath',
93
-				'newpath',
94
-			]
95
-		);
96
-	}
82
+    /**
83
+     * Logs copying of files
84
+     *
85
+     * @param array $params
86
+     */
87
+    public function copy(array $params) {
88
+        $this->log(
89
+            'File copied: "%s" to "%s"',
90
+            $params,
91
+            [
92
+                'oldpath',
93
+                'newpath',
94
+            ]
95
+        );
96
+    }
97 97
 
98
-	/**
99
-	 * Logs writing of files
100
-	 *
101
-	 * @param array $params
102
-	 */
103
-	public function write(array $params) {
104
-		if ($params['path'] === '/' || $params['path'] === '' || $params['path'] === null) {
105
-			return;
106
-		}
98
+    /**
99
+     * Logs writing of files
100
+     *
101
+     * @param array $params
102
+     */
103
+    public function write(array $params) {
104
+        if ($params['path'] === '/' || $params['path'] === '' || $params['path'] === null) {
105
+            return;
106
+        }
107 107
 
108
-		$this->log(
109
-			'File written to: "%s"',
110
-			$params,
111
-			[
112
-				'path',
113
-			]
114
-		);
115
-	}
108
+        $this->log(
109
+            'File written to: "%s"',
110
+            $params,
111
+            [
112
+                'path',
113
+            ]
114
+        );
115
+    }
116 116
 
117
-	/**
118
-	 * Logs update of files
119
-	 *
120
-	 * @param array $params
121
-	 */
122
-	public function update(array $params) {
123
-		$this->log(
124
-			'File updated: "%s"',
125
-			$params,
126
-			[
127
-				'path',
128
-			]
129
-		);
130
-	}
117
+    /**
118
+     * Logs update of files
119
+     *
120
+     * @param array $params
121
+     */
122
+    public function update(array $params) {
123
+        $this->log(
124
+            'File updated: "%s"',
125
+            $params,
126
+            [
127
+                'path',
128
+            ]
129
+        );
130
+    }
131 131
 
132
-	/**
133
-	 * Logs deletions of files
134
-	 *
135
-	 * @param array $params
136
-	 */
137
-	public function delete(array $params) {
138
-		$this->log(
139
-			'File deleted: "%s"',
140
-			$params,
141
-			[
142
-				'path',
143
-			]
144
-		);
145
-	}
132
+    /**
133
+     * Logs deletions of files
134
+     *
135
+     * @param array $params
136
+     */
137
+    public function delete(array $params) {
138
+        $this->log(
139
+            'File deleted: "%s"',
140
+            $params,
141
+            [
142
+                'path',
143
+            ]
144
+        );
145
+    }
146 146
 
147
-	/**
148
-	 * Logs preview access to a file
149
-	 *
150
-	 * @param array $params
151
-	 */
152
-	public function preview(array $params) {
153
-		$this->log(
154
-			'Preview accessed: "%s" (width: "%s", height: "%s" crop: "%s", mode: "%s")',
155
-			$params,
156
-			[
157
-				'path',
158
-				'width',
159
-				'height',
160
-				'crop',
161
-				'mode'
162
-			]
163
-		);
164
-	}
147
+    /**
148
+     * Logs preview access to a file
149
+     *
150
+     * @param array $params
151
+     */
152
+    public function preview(array $params) {
153
+        $this->log(
154
+            'Preview accessed: "%s" (width: "%s", height: "%s" crop: "%s", mode: "%s")',
155
+            $params,
156
+            [
157
+                'path',
158
+                'width',
159
+                'height',
160
+                'crop',
161
+                'mode'
162
+            ]
163
+        );
164
+    }
165 165
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/Actions/Auth.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -29,33 +29,33 @@
 block discarded – undo
29 29
  * @package OCA\AdminAudit\Actions
30 30
  */
31 31
 class Auth extends Action {
32
-	public function loginAttempt(array $params) {
33
-		$this->log(
34
-			'Login attempt: "%s"',
35
-			$params,
36
-			[
37
-				'uid',
38
-			],
39
-			true
40
-		);
41
-	}
32
+    public function loginAttempt(array $params) {
33
+        $this->log(
34
+            'Login attempt: "%s"',
35
+            $params,
36
+            [
37
+                'uid',
38
+            ],
39
+            true
40
+        );
41
+    }
42 42
 
43
-	public function loginSuccessful(array $params) {
44
-		$this->log(
45
-			'Login successful: "%s"',
46
-			$params,
47
-			[
48
-				'uid',
49
-			],
50
-			true
51
-		);
52
-	}
43
+    public function loginSuccessful(array $params) {
44
+        $this->log(
45
+            'Login successful: "%s"',
46
+            $params,
47
+            [
48
+                'uid',
49
+            ],
50
+            true
51
+        );
52
+    }
53 53
 
54
-	public function logout(array $params) {
55
-		$this->log(
56
-			'Logout occurred',
57
-			[],
58
-			[]
59
-		);
60
-	}
54
+    public function logout(array $params) {
55
+        $this->log(
56
+            'Logout occurred',
57
+            [],
58
+            []
59
+        );
60
+    }
61 61
 }
Please login to merge, or discard this patch.