Passed
Push — master ( 62b4f9...011aab )
by Roeland
12:11
created
settings/templates/settings/personal/security.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,25 +29,25 @@  discard block
 block discarded – undo
29 29
 	'settings/authtoken-init'
30 30
 ]);
31 31
 
32
-if($_['passwordChangeSupported']) {
32
+if ($_['passwordChangeSupported']) {
33 33
 	script('settings', 'security_password');
34 34
 	script('jquery-showpassword');
35 35
 }
36 36
 
37 37
 ?>
38
-<?php if($_['passwordChangeSupported']) { ?>
38
+<?php if ($_['passwordChangeSupported']) { ?>
39 39
 <div id="security-password" class="section">
40
-	<h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
40
+	<h2 class="inlineblock"><?php p($l->t('Password')); ?></h2>
41 41
 	<span id="password-error-msg" class="msg success hidden">Saved</span>
42 42
 	<div class="personal-settings-setting-box personal-settings-password-box">
43 43
 			<form id="passwordform">
44 44
 				<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
45 45
 				<input type="password" id="pass1" name="oldpassword"
46
-					   placeholder="<?php p($l->t('Current password'));?>"
46
+					   placeholder="<?php p($l->t('Current password')); ?>"
47 47
 					   autocomplete="off" autocapitalize="none" autocorrect="off" />
48 48
 
49 49
 				<div class="personal-show-container">
50
-					<label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
50
+					<label for="pass2" class="hidden-visually"><?php p($l->t('New password')); ?>: </label>
51 51
 					<input type="password" id="pass2" name="newpassword"
52 52
 						   placeholder="<?php p($l->t('New password')); ?>"
53 53
 						   data-typetoggle="#personal-show"
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 <?php } ?>
65 65
 
66 66
 <div id="security" class="section">
67
-	<h2><?php p($l->t('Devices & sessions'));?></h2>
68
-	<p class="settings-hint hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.'));?></p>
67
+	<h2><?php p($l->t('Devices & sessions')); ?></h2>
68
+	<p class="settings-hint hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.')); ?></p>
69 69
 	<table class="icon-loading">
70 70
 		<thead class="token-list-header">
71 71
 			<tr>
72 72
 				<th></th>
73
-				<th><?php p($l->t('Device'));?></th>
74
-				<th><?php p($l->t('Last activity'));?></th>
73
+				<th><?php p($l->t('Device')); ?></th>
74
+				<th><?php p($l->t('Last activity')); ?></th>
75 75
 				<th></th>
76 76
 			</tr>
77 77
 		</thead>
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 </div>
102 102
 
103 103
 <div id="two-factor-auth" class="section">
104
-	<h2><?php p($l->t('Two-Factor Authentication'));?></h2>
104
+	<h2><?php p($l->t('Two-Factor Authentication')); ?></h2>
105 105
 	<ul>
106 106
 	<?php foreach ($_['twoFactorProviderData']['providers'] as $data) { ?>
107 107
 		<li>
Please login to merge, or discard this patch.
lib/private/legacy/template.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 *                         "admin".
72 72
 	 * @param bool $registerCall = true
73 73
 	 */
74
-	public function __construct( $app, $name, $renderAs = "", $registerCall = true ) {
74
+	public function __construct($app, $name, $renderAs = "", $registerCall = true) {
75 75
 		// Read the selected theme from the config file
76 76
 		self::initTemplateEngine($renderAs);
77 77
 
@@ -98,20 +98,20 @@  discard block
 block discarded – undo
98 98
 	 * @param string $renderAs
99 99
 	 */
100 100
 	public static function initTemplateEngine($renderAs) {
101
-		if (self::$initTemplateEngineFirstRun){
101
+		if (self::$initTemplateEngineFirstRun) {
102 102
 
103 103
 			//apps that started before the template initialization can load their own scripts/styles
104 104
 			//so to make sure this scripts/styles here are loaded first we use OC_Util::addScript() with $prepend=true
105 105
 			//meaning the last script/style in this list will be loaded first
106
-			if (\OC::$server->getSystemConfig()->getValue ('installed', false) && $renderAs !== 'error' && !\OCP\Util::needUpgrade()) {
107
-				if (\OC::$server->getConfig ()->getAppValue ( 'core', 'backgroundjobs_mode', 'ajax' ) == 'ajax') {
108
-					OC_Util::addScript ( 'backgroundjobs', null, true );
106
+			if (\OC::$server->getSystemConfig()->getValue('installed', false) && $renderAs !== 'error' && !\OCP\Util::needUpgrade()) {
107
+				if (\OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
108
+					OC_Util::addScript('backgroundjobs', null, true);
109 109
 				}
110 110
 			}
111 111
 
112 112
 			OC_Util::addStyle('css-variables', null, true);
113 113
 			OC_Util::addStyle('server', null, true);
114
-			OC_Util::addStyle('jquery-ui-fixes',null,true);
114
+			OC_Util::addStyle('jquery-ui-fixes', null, true);
115 115
 			OC_Util::addStyle('jquery.ocdialog');
116 116
 			OC_Util::addTranslations("core", null, true);
117 117
 			OC_Util::addStyle('search', 'results');
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	protected function findTemplate($theme, $app, $name) {
150 150
 		// Check if it is a app template or not.
151
-		if( $app !== '' ) {
151
+		if ($app !== '') {
152 152
 			$dirs = $this->getAppTemplateDirs($theme, $app, OC::$SERVERROOT, OC_App::getAppPath($app));
153 153
 		} else {
154 154
 			$dirs = $this->getCoreTemplateDirs($theme, OC::$SERVERROOT);
155 155
 		}
156
-		$locator = new \OC\Template\TemplateFileLocator( $dirs );
156
+		$locator = new \OC\Template\TemplateFileLocator($dirs);
157 157
 		$template = $locator->find($name);
158 158
 		$path = $locator->getPath();
159 159
 		return array($path, $template);
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 	 * @param string $text the text content for the element. If $text is null then the
167 167
 	 * element will be written as empty element. So use "" to get a closing tag.
168 168
 	 */
169
-	public function addHeader($tag, $attributes, $text=null) {
170
-		$this->headers[]= array(
169
+	public function addHeader($tag, $attributes, $text = null) {
170
+		$this->headers[] = array(
171 171
 			'tag' => $tag,
172 172
 			'attributes' => $attributes,
173 173
 			'text' => $text
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
 	public function fetchPage($additionalParams = null) {
185 185
 		$data = parent::fetchPage($additionalParams);
186 186
 
187
-		if( $this->renderAs ) {
187
+		if ($this->renderAs) {
188 188
 			$page = new TemplateLayout($this->renderAs, $this->app);
189 189
 
190
-			if(is_array($additionalParams)) {
190
+			if (is_array($additionalParams)) {
191 191
 				foreach ($additionalParams as $key => $value) {
192 192
 					$page->assign($key, $value);
193 193
 				}
@@ -195,12 +195,12 @@  discard block
 block discarded – undo
195 195
 
196 196
 			// Add custom headers
197 197
 			$headers = '';
198
-			foreach(OC_Util::$headers as $header) {
198
+			foreach (OC_Util::$headers as $header) {
199 199
 				$headers .= '<'.\OCP\Util::sanitizeHTML($header['tag']);
200
-				if ( strcasecmp($header['tag'], 'script') === 0 && in_array('src', array_map('strtolower', array_keys($header['attributes']))) ) {
200
+				if (strcasecmp($header['tag'], 'script') === 0 && in_array('src', array_map('strtolower', array_keys($header['attributes'])))) {
201 201
 					$headers .= ' defer';
202 202
 				}
203
-				foreach($header['attributes'] as $name=>$value) {
203
+				foreach ($header['attributes'] as $name=>$value) {
204 204
 					$headers .= ' '.\OCP\Util::sanitizeHTML($name).'="'.\OCP\Util::sanitizeHTML($value).'"';
205 205
 				}
206 206
 				if ($header['text'] !== null) {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 * Includes another template. use <?php echo $this->inc('template'); ?> to
230 230
 	 * do this.
231 231
 	 */
232
-	public function inc( $file, $additionalParams = null ) {
232
+	public function inc($file, $additionalParams = null) {
233 233
 		return $this->load($this->path.$file.'.php', $additionalParams);
234 234
 	}
235 235
 
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
 	 * @param array $parameters Parameters for the template
241 241
 	 * @return boolean|null
242 242
 	 */
243
-	public static function printUserPage( $application, $name, $parameters = array() ) {
244
-		$content = new OC_Template( $application, $name, "user" );
245
-		foreach( $parameters as $key => $value ) {
246
-			$content->assign( $key, $value );
243
+	public static function printUserPage($application, $name, $parameters = array()) {
244
+		$content = new OC_Template($application, $name, "user");
245
+		foreach ($parameters as $key => $value) {
246
+			$content->assign($key, $value);
247 247
 		}
248 248
 		print $content->printPage();
249 249
 	}
@@ -255,10 +255,10 @@  discard block
 block discarded – undo
255 255
 	 * @param array $parameters Parameters for the template
256 256
 	 * @return bool
257 257
 	 */
258
-	public static function printAdminPage( $application, $name, $parameters = array() ) {
259
-		$content = new OC_Template( $application, $name, "admin" );
260
-		foreach( $parameters as $key => $value ) {
261
-			$content->assign( $key, $value );
258
+	public static function printAdminPage($application, $name, $parameters = array()) {
259
+		$content = new OC_Template($application, $name, "admin");
260
+		foreach ($parameters as $key => $value) {
261
+			$content->assign($key, $value);
262 262
 		}
263 263
 		return $content->printPage();
264 264
 	}
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
 	 * @param array|string $parameters Parameters for the template
271 271
 	 * @return bool
272 272
 	 */
273
-	public static function printGuestPage( $application, $name, $parameters = array() ) {
274
-		$content = new OC_Template( $application, $name, "guest" );
275
-		foreach( $parameters as $key => $value ) {
276
-			$content->assign( $key, $value );
273
+	public static function printGuestPage($application, $name, $parameters = array()) {
274
+		$content = new OC_Template($application, $name, "guest");
275
+		foreach ($parameters as $key => $value) {
276
+			$content->assign($key, $value);
277 277
 		}
278 278
 		return $content->printPage();
279 279
 	}
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	 * @param int $statusCode
286 286
 	 * @suppress PhanAccessMethodInternal
287 287
 	 */
288
-	public static function printErrorPage( $error_msg, $hint = '', $statusCode = 500) {
288
+	public static function printErrorPage($error_msg, $hint = '', $statusCode = 500) {
289 289
 		if (\OC::$server->getAppManager()->isEnabledForUser('theming') && !\OC_App::isAppLoaded('theming')) {
290 290
 			\OC_App::loadApp('theming');
291 291
 		}
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
 
299 299
 		http_response_code($statusCode);
300 300
 		try {
301
-			$content = new \OC_Template( '', 'error', 'error', false );
301
+			$content = new \OC_Template('', 'error', 'error', false);
302 302
 			$errors = array(array('error' => $error_msg, 'hint' => $hint));
303
-			$content->assign( 'errors', $errors );
303
+			$content->assign('errors', $errors);
304 304
 			$content->printPage();
305 305
 		} catch (\Exception $e) {
306 306
 			$logger = \OC::$server->getLogger();
Please login to merge, or discard this patch.