Completed
Pull Request — master (#3869)
by Björn
15:39
created
settings/personal.php 2 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 $defaults = \OC::$server->getThemingDefaults();
42 42
 $certificateManager = \OC::$server->getCertificateManager();
43 43
 $accountManager = new \OC\Accounts\AccountManager(
44
-	\OC::$server->getDatabaseConnection(),
45
-	\OC::$server->getEventDispatcher(),
46
-	\OC::$server->getJobList()
44
+    \OC::$server->getDatabaseConnection(),
45
+    \OC::$server->getEventDispatcher(),
46
+    \OC::$server->getJobList()
47 47
 );
48 48
 $config = \OC::$server->getConfig();
49 49
 $urlGenerator = \OC::$server->getURLGenerator();
@@ -78,72 +78,72 @@  discard block
 block discarded – undo
78 78
 
79 79
 // array of common languages
80 80
 $commonLangCodes = array(
81
-	'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko'
81
+    'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko'
82 82
 );
83 83
 
84 84
 $languages=array();
85 85
 $commonLanguages = array();
86 86
 foreach($languageCodes as $lang) {
87
-	$l = \OC::$server->getL10N('settings', $lang);
88
-	// TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
89
-	$potentialName = (string) $l->t('__language_name__');
90
-	if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file
91
-		$ln = array('code' => $lang, 'name' => $potentialName);
92
-	} elseif ($lang === 'en') {
93
-		$ln = ['code' => $lang, 'name' => 'English (US)'];
94
-	}else{//fallback to language code
95
-		$ln=array('code'=>$lang, 'name'=>$lang);
96
-	}
97
-
98
-	// put appropriate languages into appropriate arrays, to print them sorted
99
-	// used language -> common languages -> divider -> other languages
100
-	if ($lang === $userLang) {
101
-		$userLang = $ln;
102
-	} elseif (in_array($lang, $commonLangCodes)) {
103
-		$commonLanguages[array_search($lang, $commonLangCodes)]=$ln;
104
-	} else {
105
-		$languages[]=$ln;
106
-	}
87
+    $l = \OC::$server->getL10N('settings', $lang);
88
+    // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
89
+    $potentialName = (string) $l->t('__language_name__');
90
+    if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file
91
+        $ln = array('code' => $lang, 'name' => $potentialName);
92
+    } elseif ($lang === 'en') {
93
+        $ln = ['code' => $lang, 'name' => 'English (US)'];
94
+    }else{//fallback to language code
95
+        $ln=array('code'=>$lang, 'name'=>$lang);
96
+    }
97
+
98
+    // put appropriate languages into appropriate arrays, to print them sorted
99
+    // used language -> common languages -> divider -> other languages
100
+    if ($lang === $userLang) {
101
+        $userLang = $ln;
102
+    } elseif (in_array($lang, $commonLangCodes)) {
103
+        $commonLanguages[array_search($lang, $commonLangCodes)]=$ln;
104
+    } else {
105
+        $languages[]=$ln;
106
+    }
107 107
 }
108 108
 
109 109
 // if user language is not available but set somehow: show the actual code as name
110 110
 if (!is_array($userLang)) {
111
-	$userLang = [
112
-		'code' => $userLang,
113
-		'name' => $userLang,
114
-	];
111
+    $userLang = [
112
+        'code' => $userLang,
113
+        'name' => $userLang,
114
+    ];
115 115
 }
116 116
 
117 117
 ksort($commonLanguages);
118 118
 
119 119
 // sort now by displayed language not the iso-code
120 120
 usort( $languages, function ($a, $b) {
121
-	if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) {
122
-		// If a doesn't have a name, but b does, list b before a
123
-		return 1;
124
-	}
125
-	if ($a['code'] !== $a['name'] && $b['code'] === $b['name']) {
126
-		// If a does have a name, but b doesn't, list a before b
127
-		return -1;
128
-	}
129
-	// Otherwise compare the names
130
-	return strcmp($a['name'], $b['name']);
121
+    if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) {
122
+        // If a doesn't have a name, but b does, list b before a
123
+        return 1;
124
+    }
125
+    if ($a['code'] !== $a['name'] && $b['code'] === $b['name']) {
126
+        // If a does have a name, but b doesn't, list a before b
127
+        return -1;
128
+    }
129
+    // Otherwise compare the names
130
+    return strcmp($a['name'], $b['name']);
131 131
 });
132 132
 
133 133
 //links to clients
134 134
 $clients = array(
135
-	'desktop' => $config->getSystemValue('customclient_desktop', $defaults->getSyncClientUrl()),
136
-	'android' => $config->getSystemValue('customclient_android', $defaults->getAndroidClientUrl()),
137
-	'ios'     => $config->getSystemValue('customclient_ios', $defaults->getiOSClientUrl())
135
+    'desktop' => $config->getSystemValue('customclient_desktop', $defaults->getSyncClientUrl()),
136
+    'android' => $config->getSystemValue('customclient_android', $defaults->getAndroidClientUrl()),
137
+    'ios'     => $config->getSystemValue('customclient_ios', $defaults->getiOSClientUrl())
138 138
 );
139 139
 
140 140
 // only show root certificate import if external storages are enabled
141 141
 $enableCertImport = false;
142 142
 $externalStorageEnabled = \OC::$server->getAppManager()->isEnabledForUser('files_external');
143 143
 if ($externalStorageEnabled) {
144
-	/** @var \OCA\Files_External\Service\BackendService $backendService */
145
-	$backendService = \OC_Mount_Config::$app->getContainer()->query('\OCA\Files_External\Service\BackendService');
146
-	$enableCertImport = $backendService->isUserMountingAllowed();
144
+    /** @var \OCA\Files_External\Service\BackendService $backendService */
145
+    $backendService = \OC_Mount_Config::$app->getContainer()->query('\OCA\Files_External\Service\BackendService');
146
+    $enableCertImport = $backendService->isUserMountingAllowed();
147 147
 }
148 148
 
149 149
 
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 $tmpl = new OC_Template( 'settings', 'personal', 'user');
153 153
 $tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used']));
154 154
 if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
155
-	$totalSpace = $l->t('Unlimited');
155
+    $totalSpace = $l->t('Unlimited');
156 156
 } else {
157
-	$totalSpace = OC_Helper::humanFileSize($storageInfo['total']);
157
+    $totalSpace = OC_Helper::humanFileSize($storageInfo['total']);
158 158
 }
159 159
 
160 160
 $uid = $user->getUID();
@@ -193,18 +193,18 @@  discard block
 block discarded – undo
193 193
 
194 194
 foreach ($needVerifyMessage as $property) {
195 195
 
196
-	switch ($userData[$property]['verified']) {
197
-		case \OC\Accounts\AccountManager::VERIFIED:
198
-			$message = $l->t('Verifying');
199
-			break;
200
-		case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
201
-			$message = $l->t('Verifying …');
202
-			break;
203
-		default:
204
-			$message = $l->t('Verify');
205
-	}
206
-
207
-	$tmpl->assign($property . 'Message', $message);
196
+    switch ($userData[$property]['verified']) {
197
+        case \OC\Accounts\AccountManager::VERIFIED:
198
+            $message = $l->t('Verifying');
199
+            break;
200
+        case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
201
+            $message = $l->t('Verifying …');
202
+            break;
203
+        default:
204
+            $message = $l->t('Verify');
205
+    }
206
+
207
+    $tmpl->assign($property . 'Message', $message);
208 208
 }
209 209
 
210 210
 $tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser()));
@@ -234,30 +234,30 @@  discard block
 block discarded – undo
234 234
 
235 235
 // add bottom hardcoded forms from the template
236 236
 if ($enableCertImport) {
237
-	$certificatesTemplate = new OC_Template('settings', 'certificates');
238
-	$certificatesTemplate->assign('type', 'personal');
239
-	$certificatesTemplate->assign('uploadRoute', 'settings.Certificate.addPersonalRootCertificate');
240
-	$certificatesTemplate->assign('certs', $certificateManager->listCertificates());
241
-	$certificatesTemplate->assign('urlGenerator', $urlGenerator);
242
-	$forms[] = $certificatesTemplate->fetchPage();
237
+    $certificatesTemplate = new OC_Template('settings', 'certificates');
238
+    $certificatesTemplate->assign('type', 'personal');
239
+    $certificatesTemplate->assign('uploadRoute', 'settings.Certificate.addPersonalRootCertificate');
240
+    $certificatesTemplate->assign('certs', $certificateManager->listCertificates());
241
+    $certificatesTemplate->assign('urlGenerator', $urlGenerator);
242
+    $forms[] = $certificatesTemplate->fetchPage();
243 243
 }
244 244
 
245 245
 $formsMap = array_map(function($form){
246
-	if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
247
-		$sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]);
248
-		$sectionName = str_replace('</h2>', '', $sectionName);
249
-		$anchor = strtolower($sectionName);
250
-		$anchor = str_replace(' ', '-', $anchor);
251
-
252
-		return array(
253
-			'anchor' => $anchor,
254
-			'section-name' => $sectionName,
255
-			'form' => $form
256
-		);
257
-	}
258
-	return array(
259
-		'form' => $form
260
-	);
246
+    if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
247
+        $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]);
248
+        $sectionName = str_replace('</h2>', '', $sectionName);
249
+        $anchor = strtolower($sectionName);
250
+        $anchor = str_replace(' ', '-', $anchor);
251
+
252
+        return array(
253
+            'anchor' => $anchor,
254
+            'section-name' => $sectionName,
255
+            'form' => $form
256
+        );
257
+    }
258
+    return array(
259
+        'form' => $form
260
+    );
261 261
 }, $forms);
262 262
 
263 263
 $formsAndMore = array_merge($formsAndMore, $formsMap);
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 OC_Util::addScript('settings', 'federationscopemenu');
58 58
 OC_Util::addScript('settings', 'personal');
59 59
 OC_Util::addScript('settings', 'certificates');
60
-OC_Util::addStyle( 'settings', 'settings' );
60
+OC_Util::addStyle('settings', 'settings');
61 61
 \OC_Util::addVendorScript('strengthify/jquery.strengthify');
62 62
 \OC_Util::addVendorStyle('strengthify/strengthify');
63 63
 \OC_Util::addScript('files', 'jquery.fileupload');
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
 // Highlight navigation entry
70 70
 OC::$server->getNavigationManager()->setActiveEntry('personal');
71 71
 
72
-$storageInfo=OC_Helper::getStorageInfo('/');
72
+$storageInfo = OC_Helper::getStorageInfo('/');
73 73
 
74 74
 $user = OC::$server->getUserManager()->get(OC_User::getUser());
75 75
 
76
-$userLang=$config->getUserValue( OC_User::getUser(), 'core', 'lang', \OC::$server->getL10NFactory()->findLanguage() );
76
+$userLang = $config->getUserValue(OC_User::getUser(), 'core', 'lang', \OC::$server->getL10NFactory()->findLanguage());
77 77
 $languageCodes = \OC::$server->getL10NFactory()->findAvailableLanguages();
78 78
 
79 79
 // array of common languages
@@ -81,18 +81,18 @@  discard block
 block discarded – undo
81 81
 	'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko'
82 82
 );
83 83
 
84
-$languages=array();
84
+$languages = array();
85 85
 $commonLanguages = array();
86
-foreach($languageCodes as $lang) {
86
+foreach ($languageCodes as $lang) {
87 87
 	$l = \OC::$server->getL10N('settings', $lang);
88 88
 	// TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
89 89
 	$potentialName = (string) $l->t('__language_name__');
90
-	if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file
90
+	if ($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file
91 91
 		$ln = array('code' => $lang, 'name' => $potentialName);
92 92
 	} elseif ($lang === 'en') {
93 93
 		$ln = ['code' => $lang, 'name' => 'English (US)'];
94
-	}else{//fallback to language code
95
-		$ln=array('code'=>$lang, 'name'=>$lang);
94
+	} else {//fallback to language code
95
+		$ln = array('code'=>$lang, 'name'=>$lang);
96 96
 	}
97 97
 
98 98
 	// put appropriate languages into appropriate arrays, to print them sorted
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 	if ($lang === $userLang) {
101 101
 		$userLang = $ln;
102 102
 	} elseif (in_array($lang, $commonLangCodes)) {
103
-		$commonLanguages[array_search($lang, $commonLangCodes)]=$ln;
103
+		$commonLanguages[array_search($lang, $commonLangCodes)] = $ln;
104 104
 	} else {
105
-		$languages[]=$ln;
105
+		$languages[] = $ln;
106 106
 	}
107 107
 }
108 108
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 ksort($commonLanguages);
118 118
 
119 119
 // sort now by displayed language not the iso-code
120
-usort( $languages, function ($a, $b) {
120
+usort($languages, function($a, $b) {
121 121
 	if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) {
122 122
 		// If a doesn't have a name, but b does, list b before a
123 123
 		return 1;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 // Return template
151 151
 $l = \OC::$server->getL10N('settings');
152
-$tmpl = new OC_Template( 'settings', 'personal', 'user');
152
+$tmpl = new OC_Template('settings', 'personal', 'user');
153 153
 $tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used']));
154 154
 if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
155 155
 	$totalSpace = $l->t('Unlimited');
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 			$message = $l->t('Verify');
205 205
 	}
206 206
 
207
-	$tmpl->assign($property . 'Message', $message);
207
+	$tmpl->assign($property.'Message', $message);
208 208
 }
209 209
 
210 210
 $tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser()));
@@ -224,12 +224,12 @@  discard block
 block discarded – undo
224 224
 
225 225
 // add hardcoded forms from the template
226 226
 $formsAndMore = [];
227
-$formsAndMore[]= ['anchor' => 'personal-settings', 'section-name' => $l->t('Personal info')];
228
-$formsAndMore[]= ['anchor' => 'sessions', 'section-name' => $l->t('Sessions')];
229
-$formsAndMore[]= ['anchor' => 'apppasswords', 'section-name' => $l->t('App passwords')];
230
-$formsAndMore[]= ['anchor' => 'clientsbox', 'section-name' => $l->t('Sync clients')];
227
+$formsAndMore[] = ['anchor' => 'personal-settings', 'section-name' => $l->t('Personal info')];
228
+$formsAndMore[] = ['anchor' => 'sessions', 'section-name' => $l->t('Sessions')];
229
+$formsAndMore[] = ['anchor' => 'apppasswords', 'section-name' => $l->t('App passwords')];
230
+$formsAndMore[] = ['anchor' => 'clientsbox', 'section-name' => $l->t('Sync clients')];
231 231
 
232
-$forms=OC_App::getForms('personal');
232
+$forms = OC_App::getForms('personal');
233 233
 
234 234
 
235 235
 // add bottom hardcoded forms from the template
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 	$forms[] = $certificatesTemplate->fetchPage();
243 243
 }
244 244
 
245
-$formsMap = array_map(function($form){
245
+$formsMap = array_map(function($form) {
246 246
 	if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
247 247
 		$sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]);
248 248
 		$sectionName = str_replace('</h2>', '', $sectionName);
Please login to merge, or discard this patch.
apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -29,61 +29,61 @@
 block discarded – undo
29 29
 use OCP\ILogger;
30 30
 
31 31
 class RetryJob extends Job {
32
-	/** @var IClientService */
33
-	private $clientService;
34
-	/** @var IJobList */
35
-	private $jobList;
36
-	/** @var string */
37
-	private $lookupServer = 'https://lookup.nextcloud.com/users';
32
+    /** @var IClientService */
33
+    private $clientService;
34
+    /** @var IJobList */
35
+    private $jobList;
36
+    /** @var string */
37
+    private $lookupServer = 'https://lookup.nextcloud.com/users';
38 38
 
39
-	/**
40
-	 * @param IClientService $clientService
41
-	 * @param IJobList $jobList
42
-	 */
43
-	public function __construct(IClientService $clientService,
44
-								IJobList $jobList) {
45
-		$this->clientService = $clientService;
46
-		$this->jobList = $jobList;
47
-	}
39
+    /**
40
+     * @param IClientService $clientService
41
+     * @param IJobList $jobList
42
+     */
43
+    public function __construct(IClientService $clientService,
44
+                                IJobList $jobList) {
45
+        $this->clientService = $clientService;
46
+        $this->jobList = $jobList;
47
+    }
48 48
 
49
-	/**
50
-	 * run the job, then remove it from the jobList
51
-	 *
52
-	 * @param JobList $jobList
53
-	 * @param ILogger $logger
54
-	 */
55
-	public function execute($jobList, ILogger $logger = null) {
49
+    /**
50
+     * run the job, then remove it from the jobList
51
+     *
52
+     * @param JobList $jobList
53
+     * @param ILogger $logger
54
+     */
55
+    public function execute($jobList, ILogger $logger = null) {
56 56
 
57
-		if ($this->shouldRun($this->argument)) {
58
-			parent::execute($jobList, $logger);
59
-			$jobList->remove($this, $this->argument);
60
-		}
57
+        if ($this->shouldRun($this->argument)) {
58
+            parent::execute($jobList, $logger);
59
+            $jobList->remove($this, $this->argument);
60
+        }
61 61
 
62
-	}
62
+    }
63 63
 
64
-	protected function run($argument) {
65
-		if($argument['retryNo'] === 5) {
66
-			return;
67
-		}
64
+    protected function run($argument) {
65
+        if($argument['retryNo'] === 5) {
66
+            return;
67
+        }
68 68
 
69
-		$client = $this->clientService->newClient();
69
+        $client = $this->clientService->newClient();
70 70
 
71
-		try {
72
-			$client->post($this->lookupServer,
73
-				[
74
-					'body' => json_encode($argument['dataArray']),
75
-					'timeout' => 10,
76
-					'connect_timeout' => 3,
77
-				]
78
-			);
79
-		} catch (\Exception $e) {
80
-			$this->jobList->add(RetryJob::class,
81
-				[
82
-					'dataArray' => $argument['dataArray'],
83
-					'retryNo' => $argument['retryNo'] + 1,
84
-				]
85
-			);
71
+        try {
72
+            $client->post($this->lookupServer,
73
+                [
74
+                    'body' => json_encode($argument['dataArray']),
75
+                    'timeout' => 10,
76
+                    'connect_timeout' => 3,
77
+                ]
78
+            );
79
+        } catch (\Exception $e) {
80
+            $this->jobList->add(RetryJob::class,
81
+                [
82
+                    'dataArray' => $argument['dataArray'],
83
+                    'retryNo' => $argument['retryNo'] + 1,
84
+                ]
85
+            );
86 86
 
87
-		}
88
-	}
87
+        }
88
+    }
89 89
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	protected function run($argument) {
65
-		if($argument['retryNo'] === 5) {
65
+		if ($argument['retryNo'] === 5) {
66 66
 			return;
67 67
 		}
68 68
 
Please login to merge, or discard this patch.
settings/templates/personal.php 3 patches
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
 <div id="app-navigation">
12 12
 	<ul class="with-icon">
13 13
 	<?php foreach($_['forms'] as $form) {
14
-		if (isset($form['anchor'])) {
15
-			$anchor = '#' . $form['anchor'];
16
-			$class = 'nav-icon-' . $form['anchor'];
17
-			$sectionName = $form['section-name'];
18
-			print_unescaped(sprintf("<li><a href='%s' class='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor),
19
-			\OCP\Util::sanitizeHTML($class), \OCP\Util::sanitizeHTML($sectionName)));
20
-		}
21
-	}?>
14
+        if (isset($form['anchor'])) {
15
+            $anchor = '#' . $form['anchor'];
16
+            $class = 'nav-icon-' . $form['anchor'];
17
+            $sectionName = $form['section-name'];
18
+            print_unescaped(sprintf("<li><a href='%s' class='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor),
19
+            \OCP\Util::sanitizeHTML($class), \OCP\Util::sanitizeHTML($sectionName)));
20
+        }
21
+    }?>
22 22
 	</ul>
23 23
 </div>
24 24
 
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 		<p id="quotatext">
31 31
 			<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
32 32
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
33
-					[$_['usage'], $_['total_space']]));?>
33
+                    [$_['usage'], $_['total_space']]));?>
34 34
 			<?php else: ?>
35 35
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)',
36
-					[$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
36
+                    [$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
37 37
 			<?php endif ?>
38 38
 		</p>
39 39
 	</div>
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 			<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') p('hidden'); ?>">
103 103
 				<img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src="
104 104
 				<?php
105
-				switch($_['emailVerification']) {
106
-					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
107
-						p(image_path('core', 'actions/verifying.svg'));
108
-						break;
109
-					case \OC\Accounts\AccountManager::VERIFIED:
110
-						p(image_path('core', 'actions/verified.svg'));
111
-						break;
112
-					default:
113
-						p(image_path('core', 'actions/verify.svg'));
114
-				}
115
-				?>">
105
+                switch($_['emailVerification']) {
106
+                    case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
107
+                        p(image_path('core', 'actions/verifying.svg'));
108
+                        break;
109
+                    case \OC\Accounts\AccountManager::VERIFIED:
110
+                        p(image_path('core', 'actions/verified.svg'));
111
+                        break;
112
+                    default:
113
+                        p(image_path('core', 'actions/verify.svg'));
114
+                }
115
+                ?>">
116 116
 			</div>
117 117
 			<input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
118 118
 				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
@@ -169,17 +169,17 @@  discard block
 block discarded – undo
169 169
 			<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') p('hidden'); ?>">
170 170
 				<img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src="
171 171
 				<?php
172
-				switch($_['websiteVerification']) {
173
-					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
174
-						p(image_path('core', 'actions/verifying.svg'));
175
-						break;
176
-					case \OC\Accounts\AccountManager::VERIFIED:
177
-						p(image_path('core', 'actions/verified.svg'));
178
-						break;
179
-					default:
180
-						p(image_path('core', 'actions/verify.svg'));
181
-				}
182
-				?>"
172
+                switch($_['websiteVerification']) {
173
+                    case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
174
+                        p(image_path('core', 'actions/verifying.svg'));
175
+                        break;
176
+                    case \OC\Accounts\AccountManager::VERIFIED:
177
+                        p(image_path('core', 'actions/verified.svg'));
178
+                        break;
179
+                    default:
180
+                        p(image_path('core', 'actions/verify.svg'));
181
+                }
182
+                ?>"
183 183
 				<?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
184 184
 				>
185 185
 				<div class="verification-dialog popovermenu bubble menu">
@@ -206,17 +206,17 @@  discard block
 block discarded – undo
206 206
 			<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') p('hidden'); ?>">
207 207
 				<img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src="
208 208
 				<?php
209
-				switch($_['twitterVerification']) {
210
-					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
211
-						p(image_path('core', 'actions/verifying.svg'));
212
-						break;
213
-					case \OC\Accounts\AccountManager::VERIFIED:
214
-						p(image_path('core', 'actions/verified.svg'));
215
-						break;
216
-					default:
217
-						p(image_path('core', 'actions/verify.svg'));
218
-				}
219
-				?>"
209
+                switch($_['twitterVerification']) {
210
+                    case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
211
+                        p(image_path('core', 'actions/verifying.svg'));
212
+                        break;
213
+                    case \OC\Accounts\AccountManager::VERIFIED:
214
+                        p(image_path('core', 'actions/verified.svg'));
215
+                        break;
216
+                    default:
217
+                        p(image_path('core', 'actions/verify.svg'));
218
+                }
219
+                ?>"
220 220
 				<?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
221 221
 				>
222 222
 				<div class="verification-dialog popovermenu bubble menu">
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
 <?php
251 251
 if($_['passwordChangeSupported']) {
252
-	script('jquery-showpassword');
252
+    script('jquery-showpassword');
253 253
 ?>
254 254
 <form id="passwordform" class="section">
255 255
 	<h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
@@ -318,15 +318,15 @@  discard block
 block discarded – undo
318 318
 
319 319
 		<p>
320 320
 			<?php print_unescaped(str_replace(
321
-				[
322
-					'{contributeopen}',
323
-					'{linkclose}',
324
-				],
325
-				[
326
-					'<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer">',
327
-					'</a>',
328
-				],
329
-				$l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
321
+                [
322
+                    '{contributeopen}',
323
+                    '{linkclose}',
324
+                ],
325
+                [
326
+                    '<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer">',
327
+                    '</a>',
328
+                ],
329
+                $l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
330 330
 		</p>
331 331
 
332 332
 	<?php if(OC_APP::isEnabled('firstrunwizard')) {?>
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 </div>
388 388
 
389 389
 <?php foreach($_['forms'] as $form) {
390
-	if (isset($form['form'])) {?>
390
+    if (isset($form['form'])) {?>
391 391
 	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
392 392
 	<?php }
393 393
 };?>
Please login to merge, or discard this patch.
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 <div id="app-navigation">
12 12
 	<ul class="with-icon">
13
-	<?php foreach($_['forms'] as $form) {
13
+	<?php foreach ($_['forms'] as $form) {
14 14
 		if (isset($form['anchor'])) {
15
-			$anchor = '#' . $form['anchor'];
16
-			$class = 'nav-icon-' . $form['anchor'];
15
+			$anchor = '#'.$form['anchor'];
16
+			$class = 'nav-icon-'.$form['anchor'];
17 17
 			$sectionName = $form['section-name'];
18 18
 			print_unescaped(sprintf("<li><a href='%s' class='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor),
19 19
 			\OCP\Util::sanitizeHTML($class), \OCP\Util::sanitizeHTML($sectionName)));
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
 <div id="app-content">
26 26
 
27 27
 <div id="quota" class="section">
28
-	<div style="width:<?php p($_['usage_relative']);?>%"
29
-		<?php if($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
28
+	<div style="width:<?php p($_['usage_relative']); ?>%"
29
+		<?php if ($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
30 30
 		<p id="quotatext">
31 31
 			<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
32 32
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
33
-					[$_['usage'], $_['total_space']]));?>
33
+					[$_['usage'], $_['total_space']])); ?>
34 34
 			<?php else: ?>
35 35
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)',
36
-					[$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
36
+					[$_['usage'], $_['total_space'], $_['usage_relative']])); ?>
37 37
 			<?php endif ?>
38 38
 		</p>
39 39
 	</div>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			</div>
68 68
 		</div>
69 69
 		<span class="icon-checkmark hidden"/>
70
-		<?php if($_['lookupServerUploadEnabled']) { ?>
70
+		<?php if ($_['lookupServerUploadEnabled']) { ?>
71 71
 		<input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
72 72
 		<?php } ?>
73 73
 	</form>
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
 				<span class="icon-password"/>
82 82
 			</h2>
83 83
 			<input type="text" id="displayname" name="displayname"
84
-				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
84
+				<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
85 85
 				value="<?php p($_['displayName']) ?>"
86 86
 				autocomplete="on" autocapitalize="none" autocorrect="off" />
87
-			<?php if(!$_['displayNameChangeSupported']) { ?>
88
-				<span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
87
+			<?php if (!$_['displayNameChangeSupported']) { ?>
88
+				<span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
89 89
 			<?php } ?>
90 90
 			<span class="icon-checkmark hidden"/>
91
-			<?php if($_['lookupServerUploadEnabled']) { ?>
91
+			<?php if ($_['lookupServerUploadEnabled']) { ?>
92 92
 			<input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
93 93
 			<?php } ?>
94 94
 		</form>
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 				<label for="email"><?php p($l->t('Email')); ?></label>
100 100
 				<span class="icon-password"/>
101 101
 			</h2>
102
-			<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') p('hidden'); ?>">
102
+			<div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>">
103 103
 				<img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src="
104 104
 				<?php
105
-				switch($_['emailVerification']) {
105
+				switch ($_['emailVerification']) {
106 106
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
107 107
 						p(image_path('core', 'actions/verifying.svg'));
108 108
 						break;
@@ -115,23 +115,23 @@  discard block
 block discarded – undo
115 115
 				?>">
116 116
 			</div>
117 117
 			<input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
118
-				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
118
+				<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
119 119
 				placeholder="<?php p($l->t('Your email address')); ?>"
120 120
 				autocomplete="on" autocapitalize="none" autocorrect="off" />
121
-			<?php if(!$_['displayNameChangeSupported']) { ?>
122
-				<span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
121
+			<?php if (!$_['displayNameChangeSupported']) { ?>
122
+				<span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
123 123
 			<?php } ?>
124
-			<?php if($_['displayNameChangeSupported']) { ?>
124
+			<?php if ($_['displayNameChangeSupported']) { ?>
125 125
 				<br />
126 126
 				<em><?php p($l->t('For password reset and notifications')); ?></em>
127 127
 			<?php } ?>
128 128
 			<span class="icon-checkmark hidden"/>
129
-			<?php if($_['lookupServerUploadEnabled']) { ?>
129
+			<?php if ($_['lookupServerUploadEnabled']) { ?>
130 130
 			<input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
131 131
 			<?php } ?>
132 132
 		</form>
133 133
 	</div>
134
-	<?php if($_['lookupServerUploadEnabled']) { ?>
134
+	<?php if ($_['lookupServerUploadEnabled']) { ?>
135 135
 	<div class="personal-settings-setting-box">
136 136
 		<form id="phoneform" class="section">
137 137
 			<h2>
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 				<label for="website"><?php p($l->t('Website')); ?></label>
167 167
 				<span class="icon-password"/>
168 168
 			</h2>
169
-			<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') p('hidden'); ?>">
169
+			<div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>">
170 170
 				<img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src="
171 171
 				<?php
172
-				switch($_['websiteVerification']) {
172
+				switch ($_['websiteVerification']) {
173 173
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
174 174
 						p(image_path('core', 'actions/verifying.svg'));
175 175
 						break;
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
 						p(image_path('core', 'actions/verify.svg'));
181 181
 				}
182 182
 				?>"
183
-				<?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
183
+				<?php if ($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
184 184
 				>
185 185
 				<div class="verification-dialog popovermenu bubble menu">
186 186
 					<div class="verification-dialog-content">
187 187
 						<p class="explainVerification"></p>
188 188
 						<p class="verificationCode"></p>
189
-						<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
189
+						<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
190 190
 					</div>
191 191
 				</div>
192 192
 			</div>
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 				<label for="twitter"><?php p($l->t('Twitter')); ?></label>
204 204
 				<span class="icon-password"/>
205 205
 			</h2>
206
-			<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') p('hidden'); ?>">
206
+			<div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>">
207 207
 				<img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src="
208 208
 				<?php
209
-				switch($_['twitterVerification']) {
209
+				switch ($_['twitterVerification']) {
210 210
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
211 211
 						p(image_path('core', 'actions/verifying.svg'));
212 212
 						break;
@@ -217,13 +217,13 @@  discard block
 block discarded – undo
217 217
 						p(image_path('core', 'actions/verify.svg'));
218 218
 				}
219 219
 				?>"
220
-				<?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
220
+				<?php if ($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
221 221
 				>
222 222
 				<div class="verification-dialog popovermenu bubble menu">
223 223
 					<div class="verification-dialog-content">
224 224
 						<p class="explainVerification"></p>
225 225
 						<p class="verificationCode"></p>
226
-						<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
226
+						<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
227 227
 					</div>
228 228
 				</div>
229 229
 			</div>
@@ -248,19 +248,19 @@  discard block
 block discarded – undo
248 248
 </div>
249 249
 
250 250
 <?php
251
-if($_['passwordChangeSupported']) {
251
+if ($_['passwordChangeSupported']) {
252 252
 	script('jquery-showpassword');
253 253
 ?>
254 254
 <form id="passwordform" class="section">
255
-	<h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
255
+	<h2 class="inlineblock"><?php p($l->t('Password')); ?></h2>
256 256
 	<div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div>
257 257
 	<br>
258 258
 	<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
259 259
 	<input type="password" id="pass1" name="oldpassword"
260
-		placeholder="<?php p($l->t('Current password'));?>"
260
+		placeholder="<?php p($l->t('Current password')); ?>"
261 261
 		autocomplete="off" autocapitalize="none" autocorrect="off" />
262 262
 	<div class="personal-show-container">
263
-		<label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
263
+		<label for="pass2" class="hidden-visually"><?php p($l->t('New password')); ?>: </label>
264 264
 		<input type="password" id="pass2" name="newpassword"
265 265
 			placeholder="<?php p($l->t('New password')); ?>"
266 266
 			data-typetoggle="#personal-show"
@@ -276,44 +276,44 @@  discard block
 block discarded – undo
276 276
 
277 277
 <form id="language" class="section">
278 278
 	<h2>
279
-		<label for="languageinput"><?php p($l->t('Language'));?></label>
279
+		<label for="languageinput"><?php p($l->t('Language')); ?></label>
280 280
 	</h2>
281
-	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
282
-		<option value="<?php p($_['activelanguage']['code']);?>">
283
-			<?php p($_['activelanguage']['name']);?>
281
+	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>">
282
+		<option value="<?php p($_['activelanguage']['code']); ?>">
283
+			<?php p($_['activelanguage']['name']); ?>
284 284
 		</option>
285
-		<?php foreach($_['commonlanguages'] as $language):?>
286
-			<option value="<?php p($language['code']);?>">
287
-				<?php p($language['name']);?>
285
+		<?php foreach ($_['commonlanguages'] as $language):?>
286
+			<option value="<?php p($language['code']); ?>">
287
+				<?php p($language['name']); ?>
288 288
 			</option>
289
-		<?php endforeach;?>
289
+		<?php endforeach; ?>
290 290
 		<optgroup label="––––––––––"></optgroup>
291
-		<?php foreach($_['languages'] as $language):?>
292
-			<option value="<?php p($language['code']);?>">
293
-				<?php p($language['name']);?>
291
+		<?php foreach ($_['languages'] as $language):?>
292
+			<option value="<?php p($language['code']); ?>">
293
+				<?php p($language['name']); ?>
294 294
 			</option>
295
-		<?php endforeach;?>
295
+		<?php endforeach; ?>
296 296
 	</select>
297 297
 	<a href="https://www.transifex.com/nextcloud/nextcloud/"
298 298
 		target="_blank" rel="noreferrer">
299
-		<em><?php p($l->t('Help translate'));?></em>
299
+		<em><?php p($l->t('Help translate')); ?></em>
300 300
 	</a>
301 301
 </form>
302 302
 
303 303
 
304 304
 <div id="clientsbox" class="section clientsbox">
305
-	<h2><?php p($l->t('Get the apps to sync your files'));?></h2>
305
+	<h2><?php p($l->t('Get the apps to sync your files')); ?></h2>
306 306
 	<a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
307 307
 		<img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
308
-			 alt="<?php p($l->t('Desktop client'));?>" />
308
+			 alt="<?php p($l->t('Desktop client')); ?>" />
309 309
 	</a>
310 310
 	<a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
311 311
 		<img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
312
-			 alt="<?php p($l->t('Android app'));?>" />
312
+			 alt="<?php p($l->t('Android app')); ?>" />
313 313
 	</a>
314 314
 	<a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
315 315
 		<img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
316
-			 alt="<?php p($l->t('iOS app'));?>" />
316
+			 alt="<?php p($l->t('iOS app')); ?>" />
317 317
 	</a>
318 318
 
319 319
 		<p>
@@ -329,19 +329,19 @@  discard block
 block discarded – undo
329 329
 				$l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
330 330
 		</p>
331 331
 
332
-	<?php if(OC_APP::isEnabled('firstrunwizard')) {?>
333
-		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
332
+	<?php if (OC_APP::isEnabled('firstrunwizard')) {?>
333
+		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again')); ?></a></p>
334 334
 	<?php }?>
335 335
 </div>
336 336
 
337 337
 <div id="sessions" class="section">
338
-	<h2><?php p($l->t('Sessions'));?></h2>
339
-	<p class="settings-hint hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.'));?></span>
338
+	<h2><?php p($l->t('Sessions')); ?></h2>
339
+	<p class="settings-hint hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.')); ?></span>
340 340
 	<table class="icon-loading">
341 341
 		<thead class="token-list-header">
342 342
 			<tr>
343
-				<th><?php p($l->t('Device'));?></th>
344
-				<th><?php p($l->t('Last activity'));?></th>
343
+				<th><?php p($l->t('Device')); ?></th>
344
+				<th><?php p($l->t('Last activity')); ?></th>
345 345
 				<th></th>
346 346
 			</tr>
347 347
 		</thead>
@@ -351,13 +351,13 @@  discard block
 block discarded – undo
351 351
 </div>
352 352
 
353 353
 <div id="apppasswords" class="section">
354
-	<h2><?php p($l->t('App passwords'));?></h2>
355
-	<p class="settings-hint"><?php p($l->t('Here you can generate individual passwords for apps so you don’t have to give out your password. You can revoke them individually too.'));?></p>
354
+	<h2><?php p($l->t('App passwords')); ?></h2>
355
+	<p class="settings-hint"><?php p($l->t('Here you can generate individual passwords for apps so you don’t have to give out your password. You can revoke them individually too.')); ?></p>
356 356
 	<table class="icon-loading">
357 357
 		<thead class="hidden-when-empty">
358 358
 			<tr>
359
-				<th><?php p($l->t('Name'));?></th>
360
-				<th><?php p($l->t('Last activity'));?></th>
359
+				<th><?php p($l->t('Name')); ?></th>
360
+				<th><?php p($l->t('Last activity')); ?></th>
361 361
 				<th></th>
362 362
 			</tr>
363 363
 		</thead>
@@ -386,14 +386,14 @@  discard block
 block discarded – undo
386 386
 	</div>
387 387
 </div>
388 388
 
389
-<?php foreach($_['forms'] as $form) {
389
+<?php foreach ($_['forms'] as $form) {
390 390
 	if (isset($form['form'])) {?>
391
-	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
391
+	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p(''); ?>"><?php print_unescaped($form['form']); ?></div>
392 392
 	<?php }
393 393
 };?>
394 394
 
395 395
 <div class="section">
396
-	<h2><?php p($l->t('Version'));?></h2>
396
+	<h2><?php p($l->t('Version')); ?></h2>
397 397
 	<p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
398 398
 	<p><?php include('settings.development.notice.php'); ?></p>
399 399
 </div>
Please login to merge, or discard this patch.
Braces   +32 added lines, -11 removed lines patch added patch discarded remove patch
@@ -31,9 +31,12 @@  discard block
 block discarded – undo
31 31
 			<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
32 32
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
33 33
 					[$_['usage'], $_['total_space']]));?>
34
-			<?php else: ?>
34
+			<?php else {
35
+    : ?>
35 36
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)',
36
-					[$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
37
+					[$_['usage'], $_['total_space'],  $_['usage_relative']]));
38
+}
39
+?>
37 40
 			<?php endif ?>
38 41
 		</p>
39 42
 	</div>
@@ -55,8 +58,11 @@  discard block
 block discarded – undo
55 58
 				<div class="hidden button icon-delete svg" id="removeavatar" title="<?php p($l->t('Remove image')); ?>"></div>
56 59
 				<input type="file" name="files[]" id="uploadavatar" class="hiddenuploadfield">
57 60
 				<p><em><?php p($l->t('png or jpg, max. 20 MB')); ?></em></p>
58
-			<?php else: ?>
59
-				<?php p($l->t('Picture provided by original account')); ?>
61
+			<?php else {
62
+    : ?>
63
+				<?php p($l->t('Picture provided by original account'));
64
+}
65
+?>
60 66
 			<?php endif; ?>
61 67
 		</div>
62 68
 
@@ -99,7 +105,10 @@  discard block
 block discarded – undo
99 105
 				<label for="email"><?php p($l->t('Email')); ?></label>
100 106
 				<span class="icon-password"/>
101 107
 			</h2>
102
-			<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') p('hidden'); ?>">
108
+			<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') {
109
+    p('hidden');
110
+}
111
+?>">
103 112
 				<img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src="
104 113
 				<?php
105 114
 				switch($_['emailVerification']) {
@@ -166,7 +175,10 @@  discard block
 block discarded – undo
166 175
 				<label for="website"><?php p($l->t('Website')); ?></label>
167 176
 				<span class="icon-password"/>
168 177
 			</h2>
169
-			<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') p('hidden'); ?>">
178
+			<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') {
179
+    p('hidden');
180
+}
181
+?>">
170 182
 				<img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src="
171 183
 				<?php
172 184
 				switch($_['websiteVerification']) {
@@ -180,13 +192,16 @@  discard block
 block discarded – undo
180 192
 						p(image_path('core', 'actions/verify.svg'));
181 193
 				}
182 194
 				?>"
183
-				<?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
195
+				<?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) {
196
+    print_unescaped(' class="verify-action"') ?>
184 197
 				>
185 198
 				<div class="verification-dialog popovermenu bubble menu">
186 199
 					<div class="verification-dialog-content">
187 200
 						<p class="explainVerification"></p>
188 201
 						<p class="verificationCode"></p>
189
-						<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
202
+						<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));
203
+}
204
+?></p>
190 205
 					</div>
191 206
 				</div>
192 207
 			</div>
@@ -203,7 +218,10 @@  discard block
 block discarded – undo
203 218
 				<label for="twitter"><?php p($l->t('Twitter')); ?></label>
204 219
 				<span class="icon-password"/>
205 220
 			</h2>
206
-			<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') p('hidden'); ?>">
221
+			<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') {
222
+    p('hidden');
223
+}
224
+?>">
207 225
 				<img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src="
208 226
 				<?php
209 227
 				switch($_['twitterVerification']) {
@@ -217,13 +235,16 @@  discard block
 block discarded – undo
217 235
 						p(image_path('core', 'actions/verify.svg'));
218 236
 				}
219 237
 				?>"
220
-				<?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
238
+				<?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) {
239
+    print_unescaped(' class="verify-action"') ?>
221 240
 				>
222 241
 				<div class="verification-dialog popovermenu bubble menu">
223 242
 					<div class="verification-dialog-content">
224 243
 						<p class="explainVerification"></p>
225 244
 						<p class="verificationCode"></p>
226
-						<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
245
+						<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));
246
+}
247
+?></p>
227 248
 					</div>
228 249
 				</div>
229 250
 			</div>
Please login to merge, or discard this patch.
settings/BackgroundJobs/VerifyUserData.php 2 patches
Indentation   +234 added lines, -234 removed lines patch added patch discarded remove patch
@@ -35,239 +35,239 @@
 block discarded – undo
35 35
 
36 36
 class VerifyUserData extends Job {
37 37
 
38
-	/** @var  bool */
39
-	private $retainJob = true;
40
-
41
-	/** @var int max number of attempts to send the request */
42
-	private $maxTry = 24;
43
-
44
-	/** @var int how much time should be between two tries (1 hour) */
45
-	private $interval = 3600;
46
-
47
-	/** @var AccountManager */
48
-	private $accountManager;
49
-
50
-	/** @var IUserManager */
51
-	private $userManager;
52
-
53
-	/** @var IClientService */
54
-	private $httpClientService;
55
-
56
-	/** @var ILogger */
57
-	private $logger;
58
-
59
-	/** @var string */
60
-	private $lookupServerUrl;
61
-
62
-	/**
63
-	 * VerifyUserData constructor.
64
-	 *
65
-	 * @param AccountManager $accountManager
66
-	 * @param IUserManager $userManager
67
-	 * @param IClientService $clientService
68
-	 * @param ILogger $logger
69
-	 * @param IConfig $config
70
-	 */
71
-	public function __construct(AccountManager $accountManager,
72
-								IUserManager $userManager,
73
-								IClientService $clientService,
74
-								ILogger $logger,
75
-								IConfig $config
76
-	) {
77
-		$this->accountManager = $accountManager;
78
-		$this->userManager = $userManager;
79
-		$this->httpClientService = $clientService;
80
-		$this->logger = $logger;
81
-
82
-		$lookupServerUrl = $config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com');
83
-		$this->lookupServerUrl = rtrim($lookupServerUrl, '/');
84
-	}
85
-
86
-	/**
87
-	 * run the job, then remove it from the jobList
88
-	 *
89
-	 * @param JobList $jobList
90
-	 * @param ILogger $logger
91
-	 */
92
-	public function execute($jobList, ILogger $logger = null) {
93
-
94
-		if ($this->shouldRun($this->argument)) {
95
-			parent::execute($jobList, $logger);
96
-			$jobList->remove($this, $this->argument);
97
-			if ($this->retainJob) {
98
-				$this->reAddJob($jobList, $this->argument);
99
-			}
100
-		}
101
-
102
-	}
103
-
104
-	protected function run($argument) {
105
-
106
-		$try = (int)$argument['try'] + 1;
107
-
108
-		switch($argument['type']) {
109
-			case AccountManager::PROPERTY_WEBSITE:
110
-				$result = $this->verifyWebsite($argument);
111
-				break;
112
-			case AccountManager::PROPERTY_TWITTER:
113
-			case AccountManager::PROPERTY_EMAIL:
114
-				$result = $this->verifyViaLookupServer($argument, $argument['type']);
115
-				break;
116
-			default:
117
-				// no valid type given, no need to retry
118
-				$this->logger->error($argument['type'] . ' is no valid type for user account data.');
119
-				$result = true;
120
-		}
121
-
122
-		if ($result === true || $try > $this->maxTry) {
123
-			$this->retainJob = false;
124
-		}
125
-	}
126
-
127
-	/**
128
-	 * verify web page
129
-	 *
130
-	 * @param array $argument
131
-	 * @return bool true if we could check the verification code, otherwise false
132
-	 */
133
-	protected function verifyWebsite(array $argument) {
134
-
135
-		$result = false;
136
-
137
-		$url = rtrim($argument['data'], '/') . '/.well-known/' . 'CloudIdVerificationCode.txt';
138
-
139
-		$client = $this->httpClientService->newClient();
140
-		try {
141
-			$response = $client->get($url);
142
-		} catch (\Exception $e) {
143
-			return false;
144
-		}
145
-
146
-		if ($response->getStatusCode() === Http::STATUS_OK) {
147
-			$result = true;
148
-			$publishedCode = $response->getBody();
149
-			// remove new lines and spaces
150
-			$publishedCodeSanitized = trim(preg_replace('/\s\s+/', ' ', $publishedCode));
151
-			$user = $this->userManager->get($argument['uid']);
152
-			// we don't check a valid user -> give up
153
-			if ($user === null) {
154
-				$this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.');
155
-				return $result;
156
-			}
157
-			$userData = $this->accountManager->getUser($user);
158
-
159
-			if ($publishedCodeSanitized === $argument['verificationCode']) {
160
-				$userData[AccountManager::PROPERTY_WEBSITE]['verified'] = AccountManager::VERIFIED;
161
-			} else {
162
-				$userData[AccountManager::PROPERTY_WEBSITE]['verified'] = AccountManager::NOT_VERIFIED;
163
-			}
164
-
165
-			$this->accountManager->updateUser($user, $userData);
166
-		}
167
-
168
-		return $result;
169
-	}
170
-
171
-	/**
172
-	 * verify email address
173
-	 *
174
-	 * @param array $argument
175
-	 * @param string $dataType
176
-	 * @return bool true if we could check the verification code, otherwise false
177
-	 */
178
-	protected function verifyViaLookupServer(array $argument, $dataType) {
179
-
180
-		$user = $this->userManager->get($argument['uid']);
181
-
182
-		// we don't check a valid user -> give up
183
-		if ($user === null) {
184
-			$this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.');
185
-			return true;
186
-		}
187
-
188
-		$localUserData = $this->accountManager->getUser($user);
189
-		$cloudId = $user->getCloudId();
190
-
191
-		// ask lookup-server for user data
192
-		$lookupServerData = $this->queryLookupServer($cloudId);
193
-
194
-		// for some reasons we couldn't read any data from the lookup server, try again later
195
-		if (empty($lookupServerData)) {
196
-			return false;
197
-		}
198
-
199
-		// lookup server has verification data for wrong user data (e.g. email address), try again later
200
-		if ($lookupServerData[$dataType]['value'] !== $argument['data']) {
201
-			return false;
202
-		}
203
-
204
-		// lookup server hasn't verified the email address so far, try again later
205
-		if ($lookupServerData[$dataType]['verified'] === AccountManager::NOT_VERIFIED) {
206
-			return false;
207
-		}
208
-
209
-		$localUserData[$dataType]['verified'] = AccountManager::VERIFIED;
210
-		$this->accountManager->updateUser($user, $localUserData);
211
-
212
-		return true;
213
-	}
214
-
215
-	/**
216
-	 * @param string $cloudId
217
-	 * @return array
218
-	 */
219
-	protected function queryLookupServer($cloudId) {
220
-		try {
221
-			$client = $this->httpClientService->newClient();
222
-			$response = $client->get(
223
-				$this->lookupServerUrl . '/users?search=' . urlencode($cloudId) . '&exactCloudId=1',
224
-				[
225
-					'timeout' => 10,
226
-					'connect_timeout' => 3,
227
-				]
228
-			);
229
-
230
-			$body = json_decode($response->getBody(), true);
231
-
232
-			if ($body['federationId'] === $cloudId) {
233
-				return $body;
234
-			}
235
-
236
-		} catch (\Exception $e) {
237
-			// do nothing, we will just re-try later
238
-		}
239
-
240
-		return [];
241
-	}
242
-
243
-	/**
244
-	 * re-add background job with new arguments
245
-	 *
246
-	 * @param IJobList $jobList
247
-	 * @param array $argument
248
-	 */
249
-	protected function reAddJob(IJobList $jobList, array $argument) {
250
-		$jobList->add('OC\Settings\BackgroundJobs\VerifyUserData',
251
-			[
252
-				'verificationCode' => $argument['verificationCode'],
253
-				'data' => $argument['data'],
254
-				'type' => $argument['type'],
255
-				'uid' => $argument['uid'],
256
-				'try' => (int)$argument['try'] + 1,
257
-				'lastRun' => time()
258
-			]
259
-		);
260
-	}
261
-
262
-	/**
263
-	 * test if it is time for the next run
264
-	 *
265
-	 * @param array $argument
266
-	 * @return bool
267
-	 */
268
-	protected function shouldRun(array $argument) {
269
-		$lastRun = (int)$argument['lastRun'];
270
-		return ((time() - $lastRun) > $this->interval);
271
-	}
38
+    /** @var  bool */
39
+    private $retainJob = true;
40
+
41
+    /** @var int max number of attempts to send the request */
42
+    private $maxTry = 24;
43
+
44
+    /** @var int how much time should be between two tries (1 hour) */
45
+    private $interval = 3600;
46
+
47
+    /** @var AccountManager */
48
+    private $accountManager;
49
+
50
+    /** @var IUserManager */
51
+    private $userManager;
52
+
53
+    /** @var IClientService */
54
+    private $httpClientService;
55
+
56
+    /** @var ILogger */
57
+    private $logger;
58
+
59
+    /** @var string */
60
+    private $lookupServerUrl;
61
+
62
+    /**
63
+     * VerifyUserData constructor.
64
+     *
65
+     * @param AccountManager $accountManager
66
+     * @param IUserManager $userManager
67
+     * @param IClientService $clientService
68
+     * @param ILogger $logger
69
+     * @param IConfig $config
70
+     */
71
+    public function __construct(AccountManager $accountManager,
72
+                                IUserManager $userManager,
73
+                                IClientService $clientService,
74
+                                ILogger $logger,
75
+                                IConfig $config
76
+    ) {
77
+        $this->accountManager = $accountManager;
78
+        $this->userManager = $userManager;
79
+        $this->httpClientService = $clientService;
80
+        $this->logger = $logger;
81
+
82
+        $lookupServerUrl = $config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com');
83
+        $this->lookupServerUrl = rtrim($lookupServerUrl, '/');
84
+    }
85
+
86
+    /**
87
+     * run the job, then remove it from the jobList
88
+     *
89
+     * @param JobList $jobList
90
+     * @param ILogger $logger
91
+     */
92
+    public function execute($jobList, ILogger $logger = null) {
93
+
94
+        if ($this->shouldRun($this->argument)) {
95
+            parent::execute($jobList, $logger);
96
+            $jobList->remove($this, $this->argument);
97
+            if ($this->retainJob) {
98
+                $this->reAddJob($jobList, $this->argument);
99
+            }
100
+        }
101
+
102
+    }
103
+
104
+    protected function run($argument) {
105
+
106
+        $try = (int)$argument['try'] + 1;
107
+
108
+        switch($argument['type']) {
109
+            case AccountManager::PROPERTY_WEBSITE:
110
+                $result = $this->verifyWebsite($argument);
111
+                break;
112
+            case AccountManager::PROPERTY_TWITTER:
113
+            case AccountManager::PROPERTY_EMAIL:
114
+                $result = $this->verifyViaLookupServer($argument, $argument['type']);
115
+                break;
116
+            default:
117
+                // no valid type given, no need to retry
118
+                $this->logger->error($argument['type'] . ' is no valid type for user account data.');
119
+                $result = true;
120
+        }
121
+
122
+        if ($result === true || $try > $this->maxTry) {
123
+            $this->retainJob = false;
124
+        }
125
+    }
126
+
127
+    /**
128
+     * verify web page
129
+     *
130
+     * @param array $argument
131
+     * @return bool true if we could check the verification code, otherwise false
132
+     */
133
+    protected function verifyWebsite(array $argument) {
134
+
135
+        $result = false;
136
+
137
+        $url = rtrim($argument['data'], '/') . '/.well-known/' . 'CloudIdVerificationCode.txt';
138
+
139
+        $client = $this->httpClientService->newClient();
140
+        try {
141
+            $response = $client->get($url);
142
+        } catch (\Exception $e) {
143
+            return false;
144
+        }
145
+
146
+        if ($response->getStatusCode() === Http::STATUS_OK) {
147
+            $result = true;
148
+            $publishedCode = $response->getBody();
149
+            // remove new lines and spaces
150
+            $publishedCodeSanitized = trim(preg_replace('/\s\s+/', ' ', $publishedCode));
151
+            $user = $this->userManager->get($argument['uid']);
152
+            // we don't check a valid user -> give up
153
+            if ($user === null) {
154
+                $this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.');
155
+                return $result;
156
+            }
157
+            $userData = $this->accountManager->getUser($user);
158
+
159
+            if ($publishedCodeSanitized === $argument['verificationCode']) {
160
+                $userData[AccountManager::PROPERTY_WEBSITE]['verified'] = AccountManager::VERIFIED;
161
+            } else {
162
+                $userData[AccountManager::PROPERTY_WEBSITE]['verified'] = AccountManager::NOT_VERIFIED;
163
+            }
164
+
165
+            $this->accountManager->updateUser($user, $userData);
166
+        }
167
+
168
+        return $result;
169
+    }
170
+
171
+    /**
172
+     * verify email address
173
+     *
174
+     * @param array $argument
175
+     * @param string $dataType
176
+     * @return bool true if we could check the verification code, otherwise false
177
+     */
178
+    protected function verifyViaLookupServer(array $argument, $dataType) {
179
+
180
+        $user = $this->userManager->get($argument['uid']);
181
+
182
+        // we don't check a valid user -> give up
183
+        if ($user === null) {
184
+            $this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.');
185
+            return true;
186
+        }
187
+
188
+        $localUserData = $this->accountManager->getUser($user);
189
+        $cloudId = $user->getCloudId();
190
+
191
+        // ask lookup-server for user data
192
+        $lookupServerData = $this->queryLookupServer($cloudId);
193
+
194
+        // for some reasons we couldn't read any data from the lookup server, try again later
195
+        if (empty($lookupServerData)) {
196
+            return false;
197
+        }
198
+
199
+        // lookup server has verification data for wrong user data (e.g. email address), try again later
200
+        if ($lookupServerData[$dataType]['value'] !== $argument['data']) {
201
+            return false;
202
+        }
203
+
204
+        // lookup server hasn't verified the email address so far, try again later
205
+        if ($lookupServerData[$dataType]['verified'] === AccountManager::NOT_VERIFIED) {
206
+            return false;
207
+        }
208
+
209
+        $localUserData[$dataType]['verified'] = AccountManager::VERIFIED;
210
+        $this->accountManager->updateUser($user, $localUserData);
211
+
212
+        return true;
213
+    }
214
+
215
+    /**
216
+     * @param string $cloudId
217
+     * @return array
218
+     */
219
+    protected function queryLookupServer($cloudId) {
220
+        try {
221
+            $client = $this->httpClientService->newClient();
222
+            $response = $client->get(
223
+                $this->lookupServerUrl . '/users?search=' . urlencode($cloudId) . '&exactCloudId=1',
224
+                [
225
+                    'timeout' => 10,
226
+                    'connect_timeout' => 3,
227
+                ]
228
+            );
229
+
230
+            $body = json_decode($response->getBody(), true);
231
+
232
+            if ($body['federationId'] === $cloudId) {
233
+                return $body;
234
+            }
235
+
236
+        } catch (\Exception $e) {
237
+            // do nothing, we will just re-try later
238
+        }
239
+
240
+        return [];
241
+    }
242
+
243
+    /**
244
+     * re-add background job with new arguments
245
+     *
246
+     * @param IJobList $jobList
247
+     * @param array $argument
248
+     */
249
+    protected function reAddJob(IJobList $jobList, array $argument) {
250
+        $jobList->add('OC\Settings\BackgroundJobs\VerifyUserData',
251
+            [
252
+                'verificationCode' => $argument['verificationCode'],
253
+                'data' => $argument['data'],
254
+                'type' => $argument['type'],
255
+                'uid' => $argument['uid'],
256
+                'try' => (int)$argument['try'] + 1,
257
+                'lastRun' => time()
258
+            ]
259
+        );
260
+    }
261
+
262
+    /**
263
+     * test if it is time for the next run
264
+     *
265
+     * @param array $argument
266
+     * @return bool
267
+     */
268
+    protected function shouldRun(array $argument) {
269
+        $lastRun = (int)$argument['lastRun'];
270
+        return ((time() - $lastRun) > $this->interval);
271
+    }
272 272
 
273 273
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
 
104 104
 	protected function run($argument) {
105 105
 
106
-		$try = (int)$argument['try'] + 1;
106
+		$try = (int) $argument['try'] + 1;
107 107
 
108
-		switch($argument['type']) {
108
+		switch ($argument['type']) {
109 109
 			case AccountManager::PROPERTY_WEBSITE:
110 110
 				$result = $this->verifyWebsite($argument);
111 111
 				break;
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 				break;
116 116
 			default:
117 117
 				// no valid type given, no need to retry
118
-				$this->logger->error($argument['type'] . ' is no valid type for user account data.');
118
+				$this->logger->error($argument['type'].' is no valid type for user account data.');
119 119
 				$result = true;
120 120
 		}
121 121
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 		$result = false;
136 136
 
137
-		$url = rtrim($argument['data'], '/') . '/.well-known/' . 'CloudIdVerificationCode.txt';
137
+		$url = rtrim($argument['data'], '/').'/.well-known/'.'CloudIdVerificationCode.txt';
138 138
 
139 139
 		$client = $this->httpClientService->newClient();
140 140
 		try {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			$user = $this->userManager->get($argument['uid']);
152 152
 			// we don't check a valid user -> give up
153 153
 			if ($user === null) {
154
-				$this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.');
154
+				$this->logger->error($argument['uid'].' doesn\'t exist, can\'t verify user data.');
155 155
 				return $result;
156 156
 			}
157 157
 			$userData = $this->accountManager->getUser($user);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 		// we don't check a valid user -> give up
183 183
 		if ($user === null) {
184
-			$this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.');
184
+			$this->logger->error($argument['uid'].' doesn\'t exist, can\'t verify user data.');
185 185
 			return true;
186 186
 		}
187 187
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		try {
221 221
 			$client = $this->httpClientService->newClient();
222 222
 			$response = $client->get(
223
-				$this->lookupServerUrl . '/users?search=' . urlencode($cloudId) . '&exactCloudId=1',
223
+				$this->lookupServerUrl.'/users?search='.urlencode($cloudId).'&exactCloudId=1',
224 224
 				[
225 225
 					'timeout' => 10,
226 226
 					'connect_timeout' => 3,
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 				'data' => $argument['data'],
254 254
 				'type' => $argument['type'],
255 255
 				'uid' => $argument['uid'],
256
-				'try' => (int)$argument['try'] + 1,
256
+				'try' => (int) $argument['try'] + 1,
257 257
 				'lastRun' => time()
258 258
 			]
259 259
 		);
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	 * @return bool
267 267
 	 */
268 268
 	protected function shouldRun(array $argument) {
269
-		$lastRun = (int)$argument['lastRun'];
269
+		$lastRun = (int) $argument['lastRun'];
270 270
 		return ((time() - $lastRun) > $this->interval);
271 271
 	}
272 272
 
Please login to merge, or discard this patch.