Completed
Pull Request — master (#5305)
by Lukas
17:36
created
apps/files/templates/appnavigation.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <div id="app-navigation">
2 2
 	<ul class="with-icon">
3 3
 		<li id="quota" class="section <?php
4
-		if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
5
-			?>has-tooltip" title="<?php p($_['usage_relative'] . '%');
6
-		} ?>">
4
+        if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
5
+            ?>has-tooltip" title="<?php p($_['usage_relative'] . '%');
6
+        } ?>">
7 7
 			<a href="#" class="nav-icon-quota svg">
8 8
 				<p id="quotatext"><?php
9
-					if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
10
-						p($l->t('%s of %s used', [$_['usage'], $_['total_space']]));
11
-					} else {
12
-						p($l->t('%s used', [$_['usage']]));
13
-					} ?></p>
9
+                    if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
10
+                        p($l->t('%s of %s used', [$_['usage'], $_['total_space']]));
11
+                    } else {
12
+                        p($l->t('%s used', [$_['usage']]));
13
+                    } ?></p>
14 14
 				<div class="quota-container">
15 15
 					<div style="width:<?php p($_['usage_relative']);?>%"
16 16
 						 <?php if($_['usage_relative'] > 80): ?>class="quota-warning"<?php endif; ?>>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 	<ul class="with-icon">
3 3
 		<li id="quota" class="section <?php
4 4
 		if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
5
-			?>has-tooltip" title="<?php p($_['usage_relative'] . '%');
5
+			?>has-tooltip" title="<?php p($_['usage_relative'].'%');
6 6
 		} ?>">
7 7
 			<a href="#" class="nav-icon-quota svg">
8 8
 				<p id="quotatext"><?php
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 						p($l->t('%s used', [$_['usage']]));
13 13
 					} ?></p>
14 14
 				<div class="quota-container">
15
-					<div style="width:<?php p($_['usage_relative']);?>%"
16
-						 <?php if($_['usage_relative'] > 80): ?>class="quota-warning"<?php endif; ?>>
15
+					<div style="width:<?php p($_['usage_relative']); ?>%"
16
+						 <?php if ($_['usage_relative'] > 80): ?>class="quota-warning"<?php endif; ?>>
17 17
 					</div>
18 18
 				</div>
19 19
 			</a>
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>">
23 23
 			<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
24 24
 				class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg">
25
-				<?php p($item['name']);?>
25
+				<?php p($item['name']); ?>
26 26
 			</a>
27 27
 		</li>
28 28
 		<?php } ?>
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	<div id="app-settings">
31 31
 		<div id="app-settings-header">
32 32
 			<button class="settings-button" data-apps-slide-toggle="#app-settings-content">
33
-				<?php p($l->t('Settings'));?>
33
+				<?php p($l->t('Settings')); ?>
34 34
 			</button>
35 35
 		</div>
36 36
 		<div id="app-settings-content">
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 				<input class="checkbox" id="showhiddenfilesToggle" checked="checked" type="checkbox">
39 39
 				<label for="showhiddenfilesToggle"><?php p($l->t('Show hidden files')); ?></label>
40 40
 			</div>
41
-			<label for="webdavurl"><?php p($l->t('WebDAV'));?></label>
41
+			<label for="webdavurl"><?php p($l->t('WebDAV')); ?></label>
42 42
 			<input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" />
43
-			<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
43
+			<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer">access your Files via WebDAV</a>', array(link_to_docs('user-webdav')))); ?></em>
44 44
 		</div>
45 45
 	</div>
46 46
 </div>
Please login to merge, or discard this patch.
apps/files/lib/Controller/ViewController.php 2 patches
Indentation   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -49,220 +49,220 @@
 block discarded – undo
49 49
  * @package OCA\Files\Controller
50 50
  */
51 51
 class ViewController extends Controller {
52
-	/** @var string */
53
-	protected $appName;
54
-	/** @var IRequest */
55
-	protected $request;
56
-	/** @var IURLGenerator */
57
-	protected $urlGenerator;
58
-	/** @var IL10N */
59
-	protected $l10n;
60
-	/** @var IConfig */
61
-	protected $config;
62
-	/** @var EventDispatcherInterface */
63
-	protected $eventDispatcher;
64
-	/** @var IUserSession */
65
-	protected $userSession;
66
-	/** @var IAppManager */
67
-	protected $appManager;
68
-	/** @var IRootFolder */
69
-	protected $rootFolder;
52
+    /** @var string */
53
+    protected $appName;
54
+    /** @var IRequest */
55
+    protected $request;
56
+    /** @var IURLGenerator */
57
+    protected $urlGenerator;
58
+    /** @var IL10N */
59
+    protected $l10n;
60
+    /** @var IConfig */
61
+    protected $config;
62
+    /** @var EventDispatcherInterface */
63
+    protected $eventDispatcher;
64
+    /** @var IUserSession */
65
+    protected $userSession;
66
+    /** @var IAppManager */
67
+    protected $appManager;
68
+    /** @var IRootFolder */
69
+    protected $rootFolder;
70 70
 
71
-	/**
72
-	 * @param string $appName
73
-	 * @param IRequest $request
74
-	 * @param IURLGenerator $urlGenerator
75
-	 * @param IL10N $l10n
76
-	 * @param IConfig $config
77
-	 * @param EventDispatcherInterface $eventDispatcherInterface
78
-	 * @param IUserSession $userSession
79
-	 * @param IAppManager $appManager
80
-	 * @param IRootFolder $rootFolder
81
-	 */
82
-	public function __construct($appName,
83
-								IRequest $request,
84
-								IURLGenerator $urlGenerator,
85
-								IL10N $l10n,
86
-								IConfig $config,
87
-								EventDispatcherInterface $eventDispatcherInterface,
88
-								IUserSession $userSession,
89
-								IAppManager $appManager,
90
-								IRootFolder $rootFolder
91
-	) {
92
-		parent::__construct($appName, $request);
93
-		$this->appName = $appName;
94
-		$this->request = $request;
95
-		$this->urlGenerator = $urlGenerator;
96
-		$this->l10n = $l10n;
97
-		$this->config = $config;
98
-		$this->eventDispatcher = $eventDispatcherInterface;
99
-		$this->userSession = $userSession;
100
-		$this->appManager = $appManager;
101
-		$this->rootFolder = $rootFolder;
102
-	}
71
+    /**
72
+     * @param string $appName
73
+     * @param IRequest $request
74
+     * @param IURLGenerator $urlGenerator
75
+     * @param IL10N $l10n
76
+     * @param IConfig $config
77
+     * @param EventDispatcherInterface $eventDispatcherInterface
78
+     * @param IUserSession $userSession
79
+     * @param IAppManager $appManager
80
+     * @param IRootFolder $rootFolder
81
+     */
82
+    public function __construct($appName,
83
+                                IRequest $request,
84
+                                IURLGenerator $urlGenerator,
85
+                                IL10N $l10n,
86
+                                IConfig $config,
87
+                                EventDispatcherInterface $eventDispatcherInterface,
88
+                                IUserSession $userSession,
89
+                                IAppManager $appManager,
90
+                                IRootFolder $rootFolder
91
+    ) {
92
+        parent::__construct($appName, $request);
93
+        $this->appName = $appName;
94
+        $this->request = $request;
95
+        $this->urlGenerator = $urlGenerator;
96
+        $this->l10n = $l10n;
97
+        $this->config = $config;
98
+        $this->eventDispatcher = $eventDispatcherInterface;
99
+        $this->userSession = $userSession;
100
+        $this->appManager = $appManager;
101
+        $this->rootFolder = $rootFolder;
102
+    }
103 103
 
104
-	/**
105
-	 * @param string $appName
106
-	 * @param string $scriptName
107
-	 * @return string
108
-	 */
109
-	protected function renderScript($appName, $scriptName) {
110
-		$content = '';
111
-		$appPath = \OC_App::getAppPath($appName);
112
-		$scriptPath = $appPath . '/' . $scriptName;
113
-		if (file_exists($scriptPath)) {
114
-			// TODO: sanitize path / script name ?
115
-			ob_start();
116
-			include $scriptPath;
117
-			$content = ob_get_contents();
118
-			@ob_end_clean();
119
-		}
120
-		return $content;
121
-	}
104
+    /**
105
+     * @param string $appName
106
+     * @param string $scriptName
107
+     * @return string
108
+     */
109
+    protected function renderScript($appName, $scriptName) {
110
+        $content = '';
111
+        $appPath = \OC_App::getAppPath($appName);
112
+        $scriptPath = $appPath . '/' . $scriptName;
113
+        if (file_exists($scriptPath)) {
114
+            // TODO: sanitize path / script name ?
115
+            ob_start();
116
+            include $scriptPath;
117
+            $content = ob_get_contents();
118
+            @ob_end_clean();
119
+        }
120
+        return $content;
121
+    }
122 122
 
123
-	/**
124
-	 * FIXME: Replace with non static code
125
-	 *
126
-	 * @return array
127
-	 * @throws \OCP\Files\NotFoundException
128
-	 */
129
-	protected function getStorageInfo() {
130
-		$dirInfo = \OC\Files\Filesystem::getFileInfo('/', false);
131
-		return \OC_Helper::getStorageInfo('/', $dirInfo);
132
-	}
123
+    /**
124
+     * FIXME: Replace with non static code
125
+     *
126
+     * @return array
127
+     * @throws \OCP\Files\NotFoundException
128
+     */
129
+    protected function getStorageInfo() {
130
+        $dirInfo = \OC\Files\Filesystem::getFileInfo('/', false);
131
+        return \OC_Helper::getStorageInfo('/', $dirInfo);
132
+    }
133 133
 
134
-	/**
135
-	 * @NoCSRFRequired
136
-	 * @NoAdminRequired
137
-	 *
138
-	 * @param string $dir
139
-	 * @param string $view
140
-	 * @param string $fileid
141
-	 * @return TemplateResponse|RedirectResponse
142
-	 */
143
-	public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
144
-		if ($fileid !== null) {
145
-			try {
146
-				return $this->showFile($fileid);
147
-			} catch (NotFoundException $e) {
148
-				return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
149
-			}
150
-		}
134
+    /**
135
+     * @NoCSRFRequired
136
+     * @NoAdminRequired
137
+     *
138
+     * @param string $dir
139
+     * @param string $view
140
+     * @param string $fileid
141
+     * @return TemplateResponse|RedirectResponse
142
+     */
143
+    public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
144
+        if ($fileid !== null) {
145
+            try {
146
+                return $this->showFile($fileid);
147
+            } catch (NotFoundException $e) {
148
+                return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
149
+            }
150
+        }
151 151
 
152
-		$nav = new \OCP\Template('files', 'appnavigation', '');
152
+        $nav = new \OCP\Template('files', 'appnavigation', '');
153 153
 
154
-		// Load the files we need
155
-		\OCP\Util::addStyle('files', 'merged');
156
-		\OCP\Util::addScript('files', 'merged-index');
154
+        // Load the files we need
155
+        \OCP\Util::addStyle('files', 'merged');
156
+        \OCP\Util::addScript('files', 'merged-index');
157 157
 
158
-		// mostly for the home storage's free space
159
-		// FIXME: Make non static
160
-		$storageInfo = $this->getStorageInfo();
158
+        // mostly for the home storage's free space
159
+        // FIXME: Make non static
160
+        $storageInfo = $this->getStorageInfo();
161 161
 
162
-		\OCA\Files\App::getNavigationManager()->add(
163
-			[
164
-				'id' => 'favorites',
165
-				'appname' => 'files',
166
-				'script' => 'simplelist.php',
167
-				'order' => 5,
168
-				'name' => $this->l10n->t('Favorites')
169
-			]
170
-		);
162
+        \OCA\Files\App::getNavigationManager()->add(
163
+            [
164
+                'id' => 'favorites',
165
+                'appname' => 'files',
166
+                'script' => 'simplelist.php',
167
+                'order' => 5,
168
+                'name' => $this->l10n->t('Favorites')
169
+            ]
170
+        );
171 171
 
172
-		$navItems = \OCA\Files\App::getNavigationManager()->getAll();
173
-		usort($navItems, function($item1, $item2) {
174
-			return $item1['order'] - $item2['order'];
175
-		});
176
-		$nav->assign('navigationItems', $navItems);
172
+        $navItems = \OCA\Files\App::getNavigationManager()->getAll();
173
+        usort($navItems, function($item1, $item2) {
174
+            return $item1['order'] - $item2['order'];
175
+        });
176
+        $nav->assign('navigationItems', $navItems);
177 177
 
178 178
 
179
-		$nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
180
-		if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
181
-			$totalSpace = $this->l10n->t('Unlimited');
182
-		} else {
183
-			$totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
184
-		}
185
-		$nav->assign('total_space', $totalSpace);
186
-		$nav->assign('quota', $storageInfo['quota']);
187
-		$nav->assign('usage_relative', $storageInfo['relative']);
179
+        $nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
180
+        if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
181
+            $totalSpace = $this->l10n->t('Unlimited');
182
+        } else {
183
+            $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
184
+        }
185
+        $nav->assign('total_space', $totalSpace);
186
+        $nav->assign('quota', $storageInfo['quota']);
187
+        $nav->assign('usage_relative', $storageInfo['relative']);
188 188
 
189
-		$contentItems = [];
189
+        $contentItems = [];
190 190
 
191
-		// render the container content for every navigation item
192
-		foreach ($navItems as $item) {
193
-			$content = '';
194
-			if (isset($item['script'])) {
195
-				$content = $this->renderScript($item['appname'], $item['script']);
196
-			}
197
-			$contentItem = [];
198
-			$contentItem['id'] = $item['id'];
199
-			$contentItem['content'] = $content;
200
-			$contentItems[] = $contentItem;
201
-		}
191
+        // render the container content for every navigation item
192
+        foreach ($navItems as $item) {
193
+            $content = '';
194
+            if (isset($item['script'])) {
195
+                $content = $this->renderScript($item['appname'], $item['script']);
196
+            }
197
+            $contentItem = [];
198
+            $contentItem['id'] = $item['id'];
199
+            $contentItem['content'] = $content;
200
+            $contentItems[] = $contentItem;
201
+        }
202 202
 
203
-		$event = new GenericEvent(null, ['hiddenFields' => []]);
204
-		$this->eventDispatcher->dispatch('OCA\Files::loadAdditionalScripts', $event);
203
+        $event = new GenericEvent(null, ['hiddenFields' => []]);
204
+        $this->eventDispatcher->dispatch('OCA\Files::loadAdditionalScripts', $event);
205 205
 
206
-		$params = [];
207
-		$params['usedSpacePercent'] = (int)$storageInfo['relative'];
208
-		$params['owner'] = $storageInfo['owner'];
209
-		$params['ownerDisplayName'] = $storageInfo['ownerDisplayName'];
210
-		$params['isPublic'] = false;
211
-		$params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
212
-		$user = $this->userSession->getUser()->getUID();
213
-		$params['defaultFileSorting'] = $this->config->getUserValue($user, 'files', 'file_sorting', 'name');
214
-		$params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc');
215
-		$showHidden = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false);
216
-		$params['showHiddenFiles'] = $showHidden ? 1 : 0;
217
-		$params['fileNotFound'] = $fileNotFound ? 1 : 0;
218
-		$params['appNavigation'] = $nav;
219
-		$params['appContents'] = $contentItems;
220
-		$params['hiddenFields'] = $event->getArgument('hiddenFields');
206
+        $params = [];
207
+        $params['usedSpacePercent'] = (int)$storageInfo['relative'];
208
+        $params['owner'] = $storageInfo['owner'];
209
+        $params['ownerDisplayName'] = $storageInfo['ownerDisplayName'];
210
+        $params['isPublic'] = false;
211
+        $params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
212
+        $user = $this->userSession->getUser()->getUID();
213
+        $params['defaultFileSorting'] = $this->config->getUserValue($user, 'files', 'file_sorting', 'name');
214
+        $params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc');
215
+        $showHidden = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false);
216
+        $params['showHiddenFiles'] = $showHidden ? 1 : 0;
217
+        $params['fileNotFound'] = $fileNotFound ? 1 : 0;
218
+        $params['appNavigation'] = $nav;
219
+        $params['appContents'] = $contentItems;
220
+        $params['hiddenFields'] = $event->getArgument('hiddenFields');
221 221
 
222
-		$response = new TemplateResponse(
223
-			$this->appName,
224
-			'index',
225
-			$params
226
-		);
227
-		$policy = new ContentSecurityPolicy();
228
-		$policy->addAllowedFrameDomain('\'self\'');
229
-		$response->setContentSecurityPolicy($policy);
222
+        $response = new TemplateResponse(
223
+            $this->appName,
224
+            'index',
225
+            $params
226
+        );
227
+        $policy = new ContentSecurityPolicy();
228
+        $policy->addAllowedFrameDomain('\'self\'');
229
+        $response->setContentSecurityPolicy($policy);
230 230
 
231
-		return $response;
232
-	}
231
+        return $response;
232
+    }
233 233
 
234
-	/**
235
-	 * Redirects to the file list and highlight the given file id
236
-	 *
237
-	 * @param string $fileId file id to show
238
-	 * @return RedirectResponse redirect response or not found response
239
-	 * @throws \OCP\Files\NotFoundException
240
-	 */
241
-	private function showFile($fileId) {
242
-		$uid = $this->userSession->getUser()->getUID();
243
-		$baseFolder = $this->rootFolder->getUserFolder($uid);
244
-		$files = $baseFolder->getById($fileId);
245
-		$params = [];
234
+    /**
235
+     * Redirects to the file list and highlight the given file id
236
+     *
237
+     * @param string $fileId file id to show
238
+     * @return RedirectResponse redirect response or not found response
239
+     * @throws \OCP\Files\NotFoundException
240
+     */
241
+    private function showFile($fileId) {
242
+        $uid = $this->userSession->getUser()->getUID();
243
+        $baseFolder = $this->rootFolder->getUserFolder($uid);
244
+        $files = $baseFolder->getById($fileId);
245
+        $params = [];
246 246
 
247
-		if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
248
-			$baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/');
249
-			$files = $baseFolder->getById($fileId);
250
-			$params['view'] = 'trashbin';
251
-		}
247
+        if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
248
+            $baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/');
249
+            $files = $baseFolder->getById($fileId);
250
+            $params['view'] = 'trashbin';
251
+        }
252 252
 
253
-		if (!empty($files)) {
254
-			$file = current($files);
255
-			if ($file instanceof Folder) {
256
-				// set the full path to enter the folder
257
-				$params['dir'] = $baseFolder->getRelativePath($file->getPath());
258
-			} else {
259
-				// set parent path as dir
260
-				$params['dir'] = $baseFolder->getRelativePath($file->getParent()->getPath());
261
-				// and scroll to the entry
262
-				$params['scrollto'] = $file->getName();
263
-			}
264
-			return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', $params));
265
-		}
266
-		throw new \OCP\Files\NotFoundException();
267
-	}
253
+        if (!empty($files)) {
254
+            $file = current($files);
255
+            if ($file instanceof Folder) {
256
+                // set the full path to enter the folder
257
+                $params['dir'] = $baseFolder->getRelativePath($file->getPath());
258
+            } else {
259
+                // set parent path as dir
260
+                $params['dir'] = $baseFolder->getRelativePath($file->getParent()->getPath());
261
+                // and scroll to the entry
262
+                $params['scrollto'] = $file->getName();
263
+            }
264
+            return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', $params));
265
+        }
266
+        throw new \OCP\Files\NotFoundException();
267
+    }
268 268
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	protected function renderScript($appName, $scriptName) {
110 110
 		$content = '';
111 111
 		$appPath = \OC_App::getAppPath($appName);
112
-		$scriptPath = $appPath . '/' . $scriptName;
112
+		$scriptPath = $appPath.'/'.$scriptName;
113 113
 		if (file_exists($scriptPath)) {
114 114
 			// TODO: sanitize path / script name ?
115 115
 			ob_start();
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		$this->eventDispatcher->dispatch('OCA\Files::loadAdditionalScripts', $event);
205 205
 
206 206
 		$params = [];
207
-		$params['usedSpacePercent'] = (int)$storageInfo['relative'];
207
+		$params['usedSpacePercent'] = (int) $storageInfo['relative'];
208 208
 		$params['owner'] = $storageInfo['owner'];
209 209
 		$params['ownerDisplayName'] = $storageInfo['ownerDisplayName'];
210 210
 		$params['isPublic'] = false;
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		$params = [];
246 246
 
247 247
 		if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
248
-			$baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/');
248
+			$baseFolder = $this->rootFolder->get($uid.'/files_trashbin/files/');
249 249
 			$files = $baseFolder->getById($fileId);
250 250
 			$params['view'] = 'trashbin';
251 251
 		}
Please login to merge, or discard this patch.