Passed
Push — master ( c5c14d...18b673 )
by Morris
10:52 queued 10s
created
lib/private/Encryption/Update.php 1 patch
Indentation   +157 added lines, -157 removed lines patch added patch discarded remove patch
@@ -33,162 +33,162 @@
 block discarded – undo
33 33
  */
34 34
 class Update {
35 35
 
36
-	/** @var \OC\Files\View */
37
-	protected $view;
38
-
39
-	/** @var \OC\Encryption\Util */
40
-	protected $util;
41
-
42
-	 /** @var \OC\Files\Mount\Manager */
43
-	protected $mountManager;
44
-
45
-	/** @var \OC\Encryption\Manager */
46
-	protected $encryptionManager;
47
-
48
-	/** @var string */
49
-	protected $uid;
50
-
51
-	/** @var \OC\Encryption\File */
52
-	protected $file;
53
-
54
-	/**
55
-	 *
56
-	 * @param \OC\Files\View $view
57
-	 * @param \OC\Encryption\Util $util
58
-	 * @param \OC\Files\Mount\Manager $mountManager
59
-	 * @param \OC\Encryption\Manager $encryptionManager
60
-	 * @param \OC\Encryption\File $file
61
-	 * @param string $uid
62
-	 */
63
-	public function __construct(
64
-			View $view,
65
-			Util $util,
66
-			Mount\Manager $mountManager,
67
-			Manager $encryptionManager,
68
-			File $file,
69
-			$uid
70
-		) {
71
-
72
-		$this->view = $view;
73
-		$this->util = $util;
74
-		$this->mountManager = $mountManager;
75
-		$this->encryptionManager = $encryptionManager;
76
-		$this->file = $file;
77
-		$this->uid = $uid;
78
-	}
79
-
80
-	/**
81
-	 * hook after file was shared
82
-	 *
83
-	 * @param array $params
84
-	 */
85
-	public function postShared($params) {
86
-		if ($this->encryptionManager->isEnabled()) {
87
-			if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
88
-				$path = Filesystem::getPath($params['fileSource']);
89
-				list($owner, $ownerPath) = $this->getOwnerPath($path);
90
-				$absPath = '/' . $owner . '/files/' . $ownerPath;
91
-				$this->update($absPath);
92
-			}
93
-		}
94
-	}
95
-
96
-	/**
97
-	 * hook after file was unshared
98
-	 *
99
-	 * @param array $params
100
-	 */
101
-	public function postUnshared($params) {
102
-		if ($this->encryptionManager->isEnabled()) {
103
-			if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
104
-				$path = Filesystem::getPath($params['fileSource']);
105
-				list($owner, $ownerPath) = $this->getOwnerPath($path);
106
-				$absPath = '/' . $owner . '/files/' . $ownerPath;
107
-				$this->update($absPath);
108
-			}
109
-		}
110
-	}
111
-
112
-	/**
113
-	 * inform encryption module that a file was restored from the trash bin,
114
-	 * e.g. to update the encryption keys
115
-	 *
116
-	 * @param array $params
117
-	 */
118
-	public function postRestore($params) {
119
-		if ($this->encryptionManager->isEnabled()) {
120
-			$path = Filesystem::normalizePath('/' . $this->uid . '/files/' . $params['filePath']);
121
-			$this->update($path);
122
-		}
123
-	}
124
-
125
-	/**
126
-	 * inform encryption module that a file was renamed,
127
-	 * e.g. to update the encryption keys
128
-	 *
129
-	 * @param array $params
130
-	 */
131
-	public function postRename($params) {
132
-		$source = $params['oldpath'];
133
-		$target = $params['newpath'];
134
-		if(
135
-			$this->encryptionManager->isEnabled() &&
136
-			dirname($source) !== dirname($target)
137
-		) {
138
-				list($owner, $ownerPath) = $this->getOwnerPath($target);
139
-				$absPath = '/' . $owner . '/files/' . $ownerPath;
140
-				$this->update($absPath);
141
-		}
142
-	}
143
-
144
-	/**
145
-	 * get owner and path relative to data/<owner>/files
146
-	 *
147
-	 * @param string $path path to file for current user
148
-	 * @return array ['owner' => $owner, 'path' => $path]
149
-	 * @throw \InvalidArgumentException
150
-	 */
151
-	protected function getOwnerPath($path) {
152
-		$info = Filesystem::getFileInfo($path);
153
-		$owner = Filesystem::getOwner($path);
154
-		$view = new View('/' . $owner . '/files');
155
-		$path = $view->getPath($info->getId());
156
-		if ($path === null) {
157
-			throw new \InvalidArgumentException('No file found for ' . $info->getId());
158
-		}
159
-
160
-		return array($owner, $path);
161
-	}
162
-
163
-	/**
164
-	 * notify encryption module about added/removed users from a file/folder
165
-	 *
166
-	 * @param string $path relative to data/
167
-	 * @throws Exceptions\ModuleDoesNotExistsException
168
-	 */
169
-	public function update($path) {
170
-
171
-		$encryptionModule = $this->encryptionManager->getEncryptionModule();
172
-
173
-		// if the encryption module doesn't encrypt the files on a per-user basis
174
-		// we have nothing to do here.
175
-		if ($encryptionModule->needDetailedAccessList() === false) {
176
-			return;
177
-		}
178
-
179
-		// if a folder was shared, get a list of all (sub-)folders
180
-		if ($this->view->is_dir($path)) {
181
-			$allFiles = $this->util->getAllFiles($path);
182
-		} else {
183
-			$allFiles = array($path);
184
-		}
185
-
186
-
187
-
188
-		foreach ($allFiles as $file) {
189
-			$usersSharing = $this->file->getAccessList($file);
190
-			$encryptionModule->update($file, $this->uid, $usersSharing);
191
-		}
192
-	}
36
+    /** @var \OC\Files\View */
37
+    protected $view;
38
+
39
+    /** @var \OC\Encryption\Util */
40
+    protected $util;
41
+
42
+        /** @var \OC\Files\Mount\Manager */
43
+    protected $mountManager;
44
+
45
+    /** @var \OC\Encryption\Manager */
46
+    protected $encryptionManager;
47
+
48
+    /** @var string */
49
+    protected $uid;
50
+
51
+    /** @var \OC\Encryption\File */
52
+    protected $file;
53
+
54
+    /**
55
+     *
56
+     * @param \OC\Files\View $view
57
+     * @param \OC\Encryption\Util $util
58
+     * @param \OC\Files\Mount\Manager $mountManager
59
+     * @param \OC\Encryption\Manager $encryptionManager
60
+     * @param \OC\Encryption\File $file
61
+     * @param string $uid
62
+     */
63
+    public function __construct(
64
+            View $view,
65
+            Util $util,
66
+            Mount\Manager $mountManager,
67
+            Manager $encryptionManager,
68
+            File $file,
69
+            $uid
70
+        ) {
71
+
72
+        $this->view = $view;
73
+        $this->util = $util;
74
+        $this->mountManager = $mountManager;
75
+        $this->encryptionManager = $encryptionManager;
76
+        $this->file = $file;
77
+        $this->uid = $uid;
78
+    }
79
+
80
+    /**
81
+     * hook after file was shared
82
+     *
83
+     * @param array $params
84
+     */
85
+    public function postShared($params) {
86
+        if ($this->encryptionManager->isEnabled()) {
87
+            if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
88
+                $path = Filesystem::getPath($params['fileSource']);
89
+                list($owner, $ownerPath) = $this->getOwnerPath($path);
90
+                $absPath = '/' . $owner . '/files/' . $ownerPath;
91
+                $this->update($absPath);
92
+            }
93
+        }
94
+    }
95
+
96
+    /**
97
+     * hook after file was unshared
98
+     *
99
+     * @param array $params
100
+     */
101
+    public function postUnshared($params) {
102
+        if ($this->encryptionManager->isEnabled()) {
103
+            if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
104
+                $path = Filesystem::getPath($params['fileSource']);
105
+                list($owner, $ownerPath) = $this->getOwnerPath($path);
106
+                $absPath = '/' . $owner . '/files/' . $ownerPath;
107
+                $this->update($absPath);
108
+            }
109
+        }
110
+    }
111
+
112
+    /**
113
+     * inform encryption module that a file was restored from the trash bin,
114
+     * e.g. to update the encryption keys
115
+     *
116
+     * @param array $params
117
+     */
118
+    public function postRestore($params) {
119
+        if ($this->encryptionManager->isEnabled()) {
120
+            $path = Filesystem::normalizePath('/' . $this->uid . '/files/' . $params['filePath']);
121
+            $this->update($path);
122
+        }
123
+    }
124
+
125
+    /**
126
+     * inform encryption module that a file was renamed,
127
+     * e.g. to update the encryption keys
128
+     *
129
+     * @param array $params
130
+     */
131
+    public function postRename($params) {
132
+        $source = $params['oldpath'];
133
+        $target = $params['newpath'];
134
+        if(
135
+            $this->encryptionManager->isEnabled() &&
136
+            dirname($source) !== dirname($target)
137
+        ) {
138
+                list($owner, $ownerPath) = $this->getOwnerPath($target);
139
+                $absPath = '/' . $owner . '/files/' . $ownerPath;
140
+                $this->update($absPath);
141
+        }
142
+    }
143
+
144
+    /**
145
+     * get owner and path relative to data/<owner>/files
146
+     *
147
+     * @param string $path path to file for current user
148
+     * @return array ['owner' => $owner, 'path' => $path]
149
+     * @throw \InvalidArgumentException
150
+     */
151
+    protected function getOwnerPath($path) {
152
+        $info = Filesystem::getFileInfo($path);
153
+        $owner = Filesystem::getOwner($path);
154
+        $view = new View('/' . $owner . '/files');
155
+        $path = $view->getPath($info->getId());
156
+        if ($path === null) {
157
+            throw new \InvalidArgumentException('No file found for ' . $info->getId());
158
+        }
159
+
160
+        return array($owner, $path);
161
+    }
162
+
163
+    /**
164
+     * notify encryption module about added/removed users from a file/folder
165
+     *
166
+     * @param string $path relative to data/
167
+     * @throws Exceptions\ModuleDoesNotExistsException
168
+     */
169
+    public function update($path) {
170
+
171
+        $encryptionModule = $this->encryptionManager->getEncryptionModule();
172
+
173
+        // if the encryption module doesn't encrypt the files on a per-user basis
174
+        // we have nothing to do here.
175
+        if ($encryptionModule->needDetailedAccessList() === false) {
176
+            return;
177
+        }
178
+
179
+        // if a folder was shared, get a list of all (sub-)folders
180
+        if ($this->view->is_dir($path)) {
181
+            $allFiles = $this->util->getAllFiles($path);
182
+        } else {
183
+            $allFiles = array($path);
184
+        }
185
+
186
+
187
+
188
+        foreach ($allFiles as $file) {
189
+            $usersSharing = $this->file->getAccessList($file);
190
+            $encryptionModule->update($file, $this->uid, $usersSharing);
191
+        }
192
+    }
193 193
 
194 194
 }
Please login to merge, or discard this patch.
apps/encryption/lib/Migration/SetMasterKeyStatus.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -35,43 +35,43 @@
 block discarded – undo
35 35
 class SetMasterKeyStatus implements IRepairStep {
36 36
 
37 37
 
38
-	/** @var  IConfig */
39
-	private $config;
38
+    /** @var  IConfig */
39
+    private $config;
40 40
 
41 41
 
42
-	public function __construct(IConfig $config) {
43
-		$this->config = $config;
44
-	}
42
+    public function __construct(IConfig $config) {
43
+        $this->config = $config;
44
+    }
45 45
 
46
-	/**
47
-	 * Returns the step's name
48
-	 *
49
-	 * @return string
50
-	 * @since 9.1.0
51
-	 */
52
-	public function getName() {
53
-		return 'Write default encryption module configuration to the database';
54
-	}
46
+    /**
47
+     * Returns the step's name
48
+     *
49
+     * @return string
50
+     * @since 9.1.0
51
+     */
52
+    public function getName() {
53
+        return 'Write default encryption module configuration to the database';
54
+    }
55 55
 
56
-	/**
57
-	 * @param IOutput $output
58
-	 */
59
-	public function run(IOutput $output) {
60
-		if (!$this->shouldRun()) {
61
-			return;
62
-		}
56
+    /**
57
+     * @param IOutput $output
58
+     */
59
+    public function run(IOutput $output) {
60
+        if (!$this->shouldRun()) {
61
+            return;
62
+        }
63 63
 
64
-		// if no config for the master key is set we set it explicitly to '0' in
65
-		// order not to break old installations because the default changed to '1'.
66
-		$configAlreadySet = $this->config->getAppValue('encryption', 'useMasterKey', false);
67
-		if ($configAlreadySet === false) {
68
-			$this->config->setAppValue('encryption', 'useMasterKey', '0');
69
-		}
70
-	}
64
+        // if no config for the master key is set we set it explicitly to '0' in
65
+        // order not to break old installations because the default changed to '1'.
66
+        $configAlreadySet = $this->config->getAppValue('encryption', 'useMasterKey', false);
67
+        if ($configAlreadySet === false) {
68
+            $this->config->setAppValue('encryption', 'useMasterKey', '0');
69
+        }
70
+    }
71 71
 
72
-	protected function shouldRun() {
73
-		$appVersion = $this->config->getAppValue('encryption', 'installed_version', '0.0.0');
74
-		return version_compare($appVersion, '2.0.0', '<');
75
-	}
72
+    protected function shouldRun() {
73
+        $appVersion = $this->config->getAppValue('encryption', 'installed_version', '0.0.0');
74
+        return version_compare($appVersion, '2.0.0', '<');
75
+    }
76 76
 
77 77
 }
Please login to merge, or discard this patch.
apps/encryption/lib/Command/DisableMasterKey.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -33,57 +33,57 @@
 block discarded – undo
33 33
 
34 34
 class DisableMasterKey extends Command {
35 35
 
36
-	/** @var Util */
37
-	protected $util;
38
-
39
-	/** @var IConfig */
40
-	protected $config;
41
-
42
-	/** @var  QuestionHelper */
43
-	protected $questionHelper;
44
-
45
-	/**
46
-	 * @param Util $util
47
-	 * @param IConfig $config
48
-	 * @param QuestionHelper $questionHelper
49
-	 */
50
-	public function __construct(Util $util,
51
-								IConfig $config,
52
-								QuestionHelper $questionHelper) {
53
-
54
-		$this->util = $util;
55
-		$this->config = $config;
56
-		$this->questionHelper = $questionHelper;
57
-		parent::__construct();
58
-	}
59
-
60
-	protected function configure() {
61
-		$this
62
-			->setName('encryption:disable-master-key')
63
-			->setDescription('Disable the master key and use per-user keys instead. Only available for fresh installations with no existing encrypted data! There is no way to enable it again.');
64
-	}
65
-
66
-	protected function execute(InputInterface $input, OutputInterface $output) {
67
-
68
-		$isMasterKeyEnabled = $this->util->isMasterKeyEnabled();
69
-
70
-		if(!$isMasterKeyEnabled) {
71
-			$output->writeln('Master key already disabled');
72
-		} else {
73
-			$question = new ConfirmationQuestion(
74
-				'Warning: Only perform this operation for a fresh installations with no existing encrypted data! '
75
-				. 'There is no way to enable the master key again. '
76
-				. 'We strongly recommend to keep the master key, it provides significant performance improvements '
77
-				. 'and is easier to handle for both, users and administrators. '
78
-				. 'Do you really want to switch to per-user keys? (y/n) ', false);
79
-			if ($this->questionHelper->ask($input, $output, $question)) {
80
-				$this->config->setAppValue('encryption', 'useMasterKey', '0');
81
-				$output->writeln('Master key successfully disabled.');
82
-			} else {
83
-				$output->writeln('aborted.');
84
-			}
85
-		}
86
-
87
-	}
36
+    /** @var Util */
37
+    protected $util;
38
+
39
+    /** @var IConfig */
40
+    protected $config;
41
+
42
+    /** @var  QuestionHelper */
43
+    protected $questionHelper;
44
+
45
+    /**
46
+     * @param Util $util
47
+     * @param IConfig $config
48
+     * @param QuestionHelper $questionHelper
49
+     */
50
+    public function __construct(Util $util,
51
+                                IConfig $config,
52
+                                QuestionHelper $questionHelper) {
53
+
54
+        $this->util = $util;
55
+        $this->config = $config;
56
+        $this->questionHelper = $questionHelper;
57
+        parent::__construct();
58
+    }
59
+
60
+    protected function configure() {
61
+        $this
62
+            ->setName('encryption:disable-master-key')
63
+            ->setDescription('Disable the master key and use per-user keys instead. Only available for fresh installations with no existing encrypted data! There is no way to enable it again.');
64
+    }
65
+
66
+    protected function execute(InputInterface $input, OutputInterface $output) {
67
+
68
+        $isMasterKeyEnabled = $this->util->isMasterKeyEnabled();
69
+
70
+        if(!$isMasterKeyEnabled) {
71
+            $output->writeln('Master key already disabled');
72
+        } else {
73
+            $question = new ConfirmationQuestion(
74
+                'Warning: Only perform this operation for a fresh installations with no existing encrypted data! '
75
+                . 'There is no way to enable the master key again. '
76
+                . 'We strongly recommend to keep the master key, it provides significant performance improvements '
77
+                . 'and is easier to handle for both, users and administrators. '
78
+                . 'Do you really want to switch to per-user keys? (y/n) ', false);
79
+            if ($this->questionHelper->ask($input, $output, $question)) {
80
+                $this->config->setAppValue('encryption', 'useMasterKey', '0');
81
+                $output->writeln('Master key successfully disabled.');
82
+            } else {
83
+                $output->writeln('aborted.');
84
+            }
85
+        }
86
+
87
+    }
88 88
 
89 89
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Settings/Personal.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -32,72 +32,72 @@
 block discarded – undo
32 32
 
33 33
 class Personal implements ISettings {
34 34
 
35
-	/** @var IManager */
36
-	private $encryptionManager;
35
+    /** @var IManager */
36
+    private $encryptionManager;
37 37
 
38
-	/** @var UserGlobalStoragesService */
39
-	private $userGlobalStoragesService;
38
+    /** @var UserGlobalStoragesService */
39
+    private $userGlobalStoragesService;
40 40
 
41
-	/** @var BackendService */
42
-	private $backendService;
41
+    /** @var BackendService */
42
+    private $backendService;
43 43
 
44
-	/** @var GlobalAuth	 */
45
-	private $globalAuth;
44
+    /** @var GlobalAuth	 */
45
+    private $globalAuth;
46 46
 
47
-	/** @var IUserSession */
48
-	private $userSession;
47
+    /** @var IUserSession */
48
+    private $userSession;
49 49
 
50
-	public function __construct(
51
-		IManager $encryptionManager,
52
-		UserGlobalStoragesService $userGlobalStoragesService,
53
-		BackendService $backendService,
54
-		GlobalAuth $globalAuth,
55
-		IUserSession $userSession
56
-	) {
57
-		$this->encryptionManager = $encryptionManager;
58
-		$this->userGlobalStoragesService = $userGlobalStoragesService;
59
-		$this->backendService = $backendService;
60
-		$this->globalAuth = $globalAuth;
61
-		$this->userSession = $userSession;
62
-	}
50
+    public function __construct(
51
+        IManager $encryptionManager,
52
+        UserGlobalStoragesService $userGlobalStoragesService,
53
+        BackendService $backendService,
54
+        GlobalAuth $globalAuth,
55
+        IUserSession $userSession
56
+    ) {
57
+        $this->encryptionManager = $encryptionManager;
58
+        $this->userGlobalStoragesService = $userGlobalStoragesService;
59
+        $this->backendService = $backendService;
60
+        $this->globalAuth = $globalAuth;
61
+        $this->userSession = $userSession;
62
+    }
63 63
 
64
-	/**
65
-	 * @return TemplateResponse
66
-	 */
67
-	public function getForm() {
68
-		$uid = $this->userSession->getUser()->getUID();
64
+    /**
65
+     * @return TemplateResponse
66
+     */
67
+    public function getForm() {
68
+        $uid = $this->userSession->getUser()->getUID();
69 69
 
70
-		$parameters = [
71
-			'encryptionEnabled'    => $this->encryptionManager->isEnabled(),
72
-			'visibilityType'       => BackendService::VISIBILITY_PERSONAL,
73
-			'storages'             => $this->userGlobalStoragesService->getStorages(),
74
-			'backends'             => $this->backendService->getAvailableBackends(),
75
-			'authMechanisms'       => $this->backendService->getAuthMechanisms(),
76
-			'dependencies'         => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
77
-			'allowUserMounting'    => $this->backendService->isUserMountingAllowed(),
78
-			'globalCredentials'    => $this->globalAuth->getAuth($uid),
79
-			'globalCredentialsUid' => $uid,
80
-		];
70
+        $parameters = [
71
+            'encryptionEnabled'    => $this->encryptionManager->isEnabled(),
72
+            'visibilityType'       => BackendService::VISIBILITY_PERSONAL,
73
+            'storages'             => $this->userGlobalStoragesService->getStorages(),
74
+            'backends'             => $this->backendService->getAvailableBackends(),
75
+            'authMechanisms'       => $this->backendService->getAuthMechanisms(),
76
+            'dependencies'         => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
77
+            'allowUserMounting'    => $this->backendService->isUserMountingAllowed(),
78
+            'globalCredentials'    => $this->globalAuth->getAuth($uid),
79
+            'globalCredentialsUid' => $uid,
80
+        ];
81 81
 
82
-		return new TemplateResponse('files_external', 'settings', $parameters, '');
83
-	}
82
+        return new TemplateResponse('files_external', 'settings', $parameters, '');
83
+    }
84 84
 
85
-	/**
86
-	 * @return string the section ID, e.g. 'sharing'
87
-	 */
88
-	public function getSection() {
89
-		return 'externalstorages';
90
-	}
85
+    /**
86
+     * @return string the section ID, e.g. 'sharing'
87
+     */
88
+    public function getSection() {
89
+        return 'externalstorages';
90
+    }
91 91
 
92
-	/**
93
-	 * @return int whether the form should be rather on the top or bottom of
94
-	 * the admin section. The forms are arranged in ascending order of the
95
-	 * priority values. It is required to return a value between 0 and 100.
96
-	 *
97
-	 * E.g.: 70
98
-	 */
99
-	public function getPriority() {
100
-		return 40;
101
-	}
92
+    /**
93
+     * @return int whether the form should be rather on the top or bottom of
94
+     * the admin section. The forms are arranged in ascending order of the
95
+     * priority values. It is required to return a value between 0 and 100.
96
+     *
97
+     * E.g.: 70
98
+     */
99
+    public function getPriority() {
100
+        return 40;
101
+    }
102 102
 
103 103
 }
Please login to merge, or discard this patch.
lib/private/DB/OracleConnection.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -26,80 +26,80 @@
 block discarded – undo
26 26
 namespace OC\DB;
27 27
 
28 28
 class OracleConnection extends Connection {
29
-	/**
30
-	 * Quote the keys of the array
31
-	 */
32
-	private function quoteKeys(array $data) {
33
-		$return = [];
34
-		$c = $this->getDatabasePlatform()->getIdentifierQuoteCharacter();
35
-		foreach($data as $key => $value) {
36
-			if ($key[0] !== $c) {
37
-				$return[$this->quoteIdentifier($key)] = $value;
38
-			} else {
39
-				$return[$key] = $value;
40
-			}
41
-		}
42
-		return $return;
43
-	}
29
+    /**
30
+     * Quote the keys of the array
31
+     */
32
+    private function quoteKeys(array $data) {
33
+        $return = [];
34
+        $c = $this->getDatabasePlatform()->getIdentifierQuoteCharacter();
35
+        foreach($data as $key => $value) {
36
+            if ($key[0] !== $c) {
37
+                $return[$this->quoteIdentifier($key)] = $value;
38
+            } else {
39
+                $return[$key] = $value;
40
+            }
41
+        }
42
+        return $return;
43
+    }
44 44
 
45
-	/**
46
-	 * {@inheritDoc}
47
-	 */
48
-	public function insert($tableName, array $data, array $types = array()) {
49
-		if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
50
-			$tableName = $this->quoteIdentifier($tableName);
51
-		}
52
-		$data = $this->quoteKeys($data);
53
-		return parent::insert($tableName, $data, $types);
54
-	}
45
+    /**
46
+     * {@inheritDoc}
47
+     */
48
+    public function insert($tableName, array $data, array $types = array()) {
49
+        if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
50
+            $tableName = $this->quoteIdentifier($tableName);
51
+        }
52
+        $data = $this->quoteKeys($data);
53
+        return parent::insert($tableName, $data, $types);
54
+    }
55 55
 
56
-	/**
57
-	 * {@inheritDoc}
58
-	 */
59
-	public function update($tableName, array $data, array $identifier, array $types = array()) {
60
-		if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
61
-			$tableName = $this->quoteIdentifier($tableName);
62
-		}
63
-		$data = $this->quoteKeys($data);
64
-		$identifier = $this->quoteKeys($identifier);
65
-		return parent::update($tableName, $data, $identifier, $types);
66
-	}
56
+    /**
57
+     * {@inheritDoc}
58
+     */
59
+    public function update($tableName, array $data, array $identifier, array $types = array()) {
60
+        if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
61
+            $tableName = $this->quoteIdentifier($tableName);
62
+        }
63
+        $data = $this->quoteKeys($data);
64
+        $identifier = $this->quoteKeys($identifier);
65
+        return parent::update($tableName, $data, $identifier, $types);
66
+    }
67 67
 
68
-	/**
69
-	 * {@inheritDoc}
70
-	 */
71
-	public function delete($tableExpression, array $identifier, array $types = array()) {
72
-		if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
73
-			$tableExpression = $this->quoteIdentifier($tableExpression);
74
-		}
75
-		$identifier = $this->quoteKeys($identifier);
76
-		return parent::delete($tableExpression, $identifier);
77
-	}
68
+    /**
69
+     * {@inheritDoc}
70
+     */
71
+    public function delete($tableExpression, array $identifier, array $types = array()) {
72
+        if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
73
+            $tableExpression = $this->quoteIdentifier($tableExpression);
74
+        }
75
+        $identifier = $this->quoteKeys($identifier);
76
+        return parent::delete($tableExpression, $identifier);
77
+    }
78 78
 
79
-	/**
80
-	 * Drop a table from the database if it exists
81
-	 *
82
-	 * @param string $table table name without the prefix
83
-	 */
84
-	public function dropTable($table) {
85
-		$table = $this->tablePrefix . trim($table);
86
-		$table = $this->quoteIdentifier($table);
87
-		$schema = $this->getSchemaManager();
88
-		if($schema->tablesExist(array($table))) {
89
-			$schema->dropTable($table);
90
-		}
91
-	}
79
+    /**
80
+     * Drop a table from the database if it exists
81
+     *
82
+     * @param string $table table name without the prefix
83
+     */
84
+    public function dropTable($table) {
85
+        $table = $this->tablePrefix . trim($table);
86
+        $table = $this->quoteIdentifier($table);
87
+        $schema = $this->getSchemaManager();
88
+        if($schema->tablesExist(array($table))) {
89
+            $schema->dropTable($table);
90
+        }
91
+    }
92 92
 
93
-	/**
94
-	 * Check if a table exists
95
-	 *
96
-	 * @param string $table table name without the prefix
97
-	 * @return bool
98
-	 */
99
-	public function tableExists($table){
100
-		$table = $this->tablePrefix . trim($table);
101
-		$table = $this->quoteIdentifier($table);
102
-		$schema = $this->getSchemaManager();
103
-		return $schema->tablesExist(array($table));
104
-	}
93
+    /**
94
+     * Check if a table exists
95
+     *
96
+     * @param string $table table name without the prefix
97
+     * @return bool
98
+     */
99
+    public function tableExists($table){
100
+        $table = $this->tablePrefix . trim($table);
101
+        $table = $this->quoteIdentifier($table);
102
+        $schema = $this->getSchemaManager();
103
+        return $schema->tablesExist(array($table));
104
+    }
105 105
 }
Please login to merge, or discard this patch.
lib/private/Migration/SimpleOutput.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -36,49 +36,49 @@
 block discarded – undo
36 36
  */
37 37
 class SimpleOutput implements IOutput {
38 38
 
39
-	/** @var ILogger */
40
-	private $logger;
41
-	private $appName;
39
+    /** @var ILogger */
40
+    private $logger;
41
+    private $appName;
42 42
 
43
-	public function __construct(ILogger $logger, $appName) {
44
-		$this->logger = $logger;
45
-		$this->appName = $appName;
46
-	}
43
+    public function __construct(ILogger $logger, $appName) {
44
+        $this->logger = $logger;
45
+        $this->appName = $appName;
46
+    }
47 47
 
48
-	/**
49
-	 * @param string $message
50
-	 * @since 9.1.0
51
-	 */
52
-	public function info($message) {
53
-		$this->logger->info($message, ['app' => $this->appName]);
54
-	}
48
+    /**
49
+     * @param string $message
50
+     * @since 9.1.0
51
+     */
52
+    public function info($message) {
53
+        $this->logger->info($message, ['app' => $this->appName]);
54
+    }
55 55
 
56
-	/**
57
-	 * @param string $message
58
-	 * @since 9.1.0
59
-	 */
60
-	public function warning($message) {
61
-		$this->logger->warning($message, ['app' => $this->appName]);
62
-	}
56
+    /**
57
+     * @param string $message
58
+     * @since 9.1.0
59
+     */
60
+    public function warning($message) {
61
+        $this->logger->warning($message, ['app' => $this->appName]);
62
+    }
63 63
 
64
-	/**
65
-	 * @param int $max
66
-	 * @since 9.1.0
67
-	 */
68
-	public function startProgress($max = 0) {
69
-	}
64
+    /**
65
+     * @param int $max
66
+     * @since 9.1.0
67
+     */
68
+    public function startProgress($max = 0) {
69
+    }
70 70
 
71
-	/**
72
-	 * @param int $step
73
-	 * @param string $description
74
-	 * @since 9.1.0
75
-	 */
76
-	public function advance($step = 1, $description = '') {
77
-	}
71
+    /**
72
+     * @param int $step
73
+     * @param string $description
74
+     * @since 9.1.0
75
+     */
76
+    public function advance($step = 1, $description = '') {
77
+    }
78 78
 
79
-	/**
80
-	 * @since 9.1.0
81
-	 */
82
-	public function finishProgress() {
83
-	}
79
+    /**
80
+     * @since 9.1.0
81
+     */
82
+    public function finishProgress() {
83
+    }
84 84
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/BearerAuth.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -29,66 +29,66 @@
 block discarded – undo
29 29
 use Sabre\HTTP\ResponseInterface;
30 30
 
31 31
 class BearerAuth extends AbstractBearer {
32
-	/** @var IUserSession */
33
-	private $userSession;
34
-	/** @var ISession */
35
-	private $session;
36
-	/** @var IRequest */
37
-	private $request;
38
-	/** @var string */
39
-	private $principalPrefix;
32
+    /** @var IUserSession */
33
+    private $userSession;
34
+    /** @var ISession */
35
+    private $session;
36
+    /** @var IRequest */
37
+    private $request;
38
+    /** @var string */
39
+    private $principalPrefix;
40 40
 
41
-	/**
42
-	 * @param IUserSession $userSession
43
-	 * @param ISession $session
44
-	 * @param string $principalPrefix
45
-	 * @param IRequest $request
46
-	 */
47
-	public function __construct(IUserSession $userSession,
48
-								ISession $session,
49
-								IRequest $request,
50
-								$principalPrefix = 'principals/users/') {
51
-		$this->userSession = $userSession;
52
-		$this->session = $session;
53
-		$this->request = $request;
54
-		$this->principalPrefix = $principalPrefix;
41
+    /**
42
+     * @param IUserSession $userSession
43
+     * @param ISession $session
44
+     * @param string $principalPrefix
45
+     * @param IRequest $request
46
+     */
47
+    public function __construct(IUserSession $userSession,
48
+                                ISession $session,
49
+                                IRequest $request,
50
+                                $principalPrefix = 'principals/users/') {
51
+        $this->userSession = $userSession;
52
+        $this->session = $session;
53
+        $this->request = $request;
54
+        $this->principalPrefix = $principalPrefix;
55 55
 
56
-		// setup realm
57
-		$defaults = new \OCP\Defaults();
58
-		$this->realm = $defaults->getName();
59
-	}
56
+        // setup realm
57
+        $defaults = new \OCP\Defaults();
58
+        $this->realm = $defaults->getName();
59
+    }
60 60
 
61
-	private function setupUserFs($userId) {
62
-		\OC_Util::setupFS($userId);
63
-		$this->session->close();
64
-		return $this->principalPrefix . $userId;
65
-	}
61
+    private function setupUserFs($userId) {
62
+        \OC_Util::setupFS($userId);
63
+        $this->session->close();
64
+        return $this->principalPrefix . $userId;
65
+    }
66 66
 
67
-	/**
68
-	 * {@inheritdoc}
69
-	 */
70
-	public function validateBearerToken($bearerToken) {
71
-		\OC_Util::setupFS();
67
+    /**
68
+     * {@inheritdoc}
69
+     */
70
+    public function validateBearerToken($bearerToken) {
71
+        \OC_Util::setupFS();
72 72
 
73
-		if(!$this->userSession->isLoggedIn()) {
74
-			$this->userSession->tryTokenLogin($this->request);
75
-		}
76
-		if($this->userSession->isLoggedIn()) {
77
-			return $this->setupUserFs($this->userSession->getUser()->getUID());
78
-		}
73
+        if(!$this->userSession->isLoggedIn()) {
74
+            $this->userSession->tryTokenLogin($this->request);
75
+        }
76
+        if($this->userSession->isLoggedIn()) {
77
+            return $this->setupUserFs($this->userSession->getUser()->getUID());
78
+        }
79 79
 
80
-		return false;
81
-	}
80
+        return false;
81
+    }
82 82
 
83
-	/**
84
-	 * \Sabre\DAV\Auth\Backend\AbstractBearer::challenge sets an WWW-Authenticate
85
-	 * header which some DAV clients can't handle. Thus we override this function
86
-	 * and make it simply return a 401.
87
-	 *
88
-	 * @param RequestInterface $request
89
-	 * @param ResponseInterface $response
90
-	 */
91
-	public function challenge(RequestInterface $request, ResponseInterface $response) {
92
-		$response->setStatus(401);
93
-	}
83
+    /**
84
+     * \Sabre\DAV\Auth\Backend\AbstractBearer::challenge sets an WWW-Authenticate
85
+     * header which some DAV clients can't handle. Thus we override this function
86
+     * and make it simply return a 401.
87
+     *
88
+     * @param RequestInterface $request
89
+     * @param ResponseInterface $response
90
+     */
91
+    public function challenge(RequestInterface $request, ResponseInterface $response) {
92
+        $response->setStatus(401);
93
+    }
94 94
 }
Please login to merge, or discard this patch.
lib/private/Comments/ManagerFactory.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -30,33 +30,33 @@
 block discarded – undo
30 30
 
31 31
 class ManagerFactory implements ICommentsManagerFactory {
32 32
 
33
-	/**
34
-	 * Server container
35
-	 *
36
-	 * @var IServerContainer
37
-	 */
38
-	private $serverContainer;
33
+    /**
34
+     * Server container
35
+     *
36
+     * @var IServerContainer
37
+     */
38
+    private $serverContainer;
39 39
 
40
-	/**
41
-	 * Constructor for the comments manager factory
42
-	 *
43
-	 * @param IServerContainer $serverContainer server container
44
-	 */
45
-	public function __construct(IServerContainer $serverContainer) {
46
-		$this->serverContainer = $serverContainer;
47
-	}
40
+    /**
41
+     * Constructor for the comments manager factory
42
+     *
43
+     * @param IServerContainer $serverContainer server container
44
+     */
45
+    public function __construct(IServerContainer $serverContainer) {
46
+        $this->serverContainer = $serverContainer;
47
+    }
48 48
 
49
-	/**
50
-	 * creates and returns an instance of the ICommentsManager
51
-	 *
52
-	 * @return ICommentsManager
53
-	 * @since 9.0.0
54
-	 */
55
-	public function getManager() {
56
-		return new Manager(
57
-			$this->serverContainer->getDatabaseConnection(),
58
-			$this->serverContainer->getLogger(),
59
-			$this->serverContainer->getConfig()
60
-		);
61
-	}
49
+    /**
50
+     * creates and returns an instance of the ICommentsManager
51
+     *
52
+     * @return ICommentsManager
53
+     * @since 9.0.0
54
+     */
55
+    public function getManager() {
56
+        return new Manager(
57
+            $this->serverContainer->getDatabaseConnection(),
58
+            $this->serverContainer->getLogger(),
59
+            $this->serverContainer->getConfig()
60
+        );
61
+    }
62 62
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/CachingTree.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -24,16 +24,16 @@
 block discarded – undo
24 24
 use Sabre\DAV\Tree;
25 25
 
26 26
 class CachingTree extends Tree {
27
-	/**
28
-	 * Store a node in the cache
29
-	 *
30
-	 * @param Node $node
31
-	 * @param null|string $path
32
-	 */
33
-	public function cacheNode(Node $node, $path = null) {
34
-		if (is_null($path)) {
35
-			$path = $node->getPath();
36
-		}
37
-		$this->cache[trim($path, '/')] = $node;
38
-	}
27
+    /**
28
+     * Store a node in the cache
29
+     *
30
+     * @param Node $node
31
+     * @param null|string $path
32
+     */
33
+    public function cacheNode(Node $node, $path = null) {
34
+        if (is_null($path)) {
35
+            $path = $node->getPath();
36
+        }
37
+        $this->cache[trim($path, '/')] = $node;
38
+    }
39 39
 }
Please login to merge, or discard this patch.