@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | $this->respondToActions |= $respondToActions; |
61 | 61 | |
62 | 62 | foreach ($this->which as $action => $v) { |
63 | - if (is_int($action) && (bool)($respondToActions & $action)) { |
|
63 | + if (is_int($action) && (bool) ($respondToActions & $action)) { |
|
64 | 64 | $this->which[$action] = $plugin; |
65 | 65 | \OC::$server->getLogger()->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']); |
66 | 66 | } |
67 | 67 | } |
68 | - if (method_exists($plugin,'deleteUser')) { |
|
68 | + if (method_exists($plugin, 'deleteUser')) { |
|
69 | 69 | $this->which['deleteUser'] = $plugin; |
70 | 70 | \OC::$server->getLogger()->debug("Registered action deleteUser to plugin ".get_class($plugin), ['app' => 'user_ldap']); |
71 | 71 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $plugin = $this->which[Backend::CREATE_USER]; |
93 | 93 | |
94 | 94 | if ($plugin) { |
95 | - return $plugin->createUser($username,$password); |
|
95 | + return $plugin->createUser($username, $password); |
|
96 | 96 | } |
97 | 97 | throw new \Exception('No plugin implements createUser in this LDAP Backend.'); |
98 | 98 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $plugin = $this->which[Backend::SET_PASSWORD]; |
109 | 109 | |
110 | 110 | if ($plugin) { |
111 | - return $plugin->setPassword($uid,$password); |
|
111 | + return $plugin->setPassword($uid, $password); |
|
112 | 112 | } |
113 | 113 | throw new \Exception('No plugin implements setPassword in this LDAP Backend.'); |
114 | 114 | } |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | <?php endif; ?> |
25 | 25 | <div id="message" class="hidden"> |
26 | 26 | <img class="float-spinner" alt="" |
27 | - src="<?php p(image_path('core', 'loading-dark.gif'));?>"> |
|
27 | + src="<?php p(image_path('core', 'loading-dark.gif')); ?>"> |
|
28 | 28 | <span id="messageText"></span> |
29 | 29 | <!-- the following div ensures that the spinner is always inside the #message div --> |
30 | 30 | <div style="clear: both;"></div> |
31 | 31 | </div> |
32 | 32 | <p class="grouptop"> |
33 | 33 | <input type="password" id="oldPassword" name="oldPassword" |
34 | - placeholder="<?php echo $l->t('Current password');?>" |
|
34 | + placeholder="<?php echo $l->t('Current password'); ?>" |
|
35 | 35 | autofocus autocomplete="off" autocapitalize="off" autocorrect="off" required/> |
36 | 36 | <label for="oldPassword" class="infield"><?php p($l->t('Current password')); ?></label> |
37 | 37 | </p> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | <input type="checkbox" id="personal-show" name="show" class="hidden-visually" /><label for="personal-show"></label> |
41 | 41 | <label id="newPassword-label" for="newPassword" class="infield"><?php p($l->t('New password')); ?></label> |
42 | 42 | <input type="password" id="newPassword" name="newPassword" |
43 | - placeholder="<?php echo $l->t('New password');?>" |
|
43 | + placeholder="<?php echo $l->t('New password'); ?>" |
|
44 | 44 | data-typetoggle="#personal-show" autofocus autocomplete="off" autocapitalize="off" autocorrect="off" required/> |
45 | 45 | </p> |
46 | 46 |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | </select> |
15 | 15 | <button type="button" id="ldap_action_add_configuration" |
16 | 16 | name="ldap_action_add_configuration" class="icon-add icon-default-style" |
17 | - title="<?php p($l->t('Add a new configuration'));?>"> </button> |
|
17 | + title="<?php p($l->t('Add a new configuration')); ?>"> </button> |
|
18 | 18 | <button type="button" id="ldap_action_copy_configuration" |
19 | 19 | name="ldap_action_copy_configuration" |
20 | 20 | class="ldapIconCopy icon-default-style" |
21 | - title="<?php p($l->t('Copy current configuration into new directory binding'));?>"> </button> |
|
21 | + title="<?php p($l->t('Copy current configuration into new directory binding')); ?>"> </button> |
|
22 | 22 | <button type="button" id="ldap_action_delete_configuration" |
23 | 23 | name="ldap_action_delete_configuration" class="icon-delete icon-default-style" |
24 | - title="<?php p($l->t('Delete the current configuration'));?>"> </button> |
|
24 | + title="<?php p($l->t('Delete the current configuration')); ?>"> </button> |
|
25 | 25 | </p> |
26 | 26 | |
27 | 27 | <div class="hostPortCombinator"> |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | <div class="table"> |
31 | 31 | <input type="text" class="host" id="ldap_host" |
32 | 32 | name="ldap_host" |
33 | - placeholder="<?php p($l->t('Host'));?>" |
|
34 | - title="<?php p($l->t('You can omit the protocol, unless you require SSL. If so, start with ldaps://'));?>" |
|
33 | + placeholder="<?php p($l->t('Host')); ?>" |
|
34 | + title="<?php p($l->t('You can omit the protocol, unless you require SSL. If so, start with ldaps://')); ?>" |
|
35 | 35 | /> |
36 | 36 | <span class="hostPortCombinatorSpan"> |
37 | 37 | <input type="number" id="ldap_port" name="ldap_port" |
38 | - placeholder="<?php p($l->t('Port'));?>" /> |
|
38 | + placeholder="<?php p($l->t('Port')); ?>" /> |
|
39 | 39 | <button class="ldapDetectPort" name="ldapDetectPort" type="button"> |
40 | - <?php p($l->t('Detect Port'));?> |
|
40 | + <?php p($l->t('Detect Port')); ?> |
|
41 | 41 | </button> |
42 | 42 | </span> |
43 | 43 | </div> |
@@ -47,19 +47,19 @@ discard block |
||
47 | 47 | <div class="tablerow"> |
48 | 48 | <input type="text" id="ldap_dn" name="ldap_dn" |
49 | 49 | class="tablecell" |
50 | - placeholder="<?php p($l->t('User DN'));?>" autocomplete="off" |
|
51 | - title="<?php p($l->t('The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty.'));?>" |
|
50 | + placeholder="<?php p($l->t('User DN')); ?>" autocomplete="off" |
|
51 | + title="<?php p($l->t('The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty.')); ?>" |
|
52 | 52 | /> |
53 | 53 | </div> |
54 | 54 | |
55 | 55 | <div class="tablerow"> |
56 | 56 | <input type="password" id="ldap_agent_password" |
57 | 57 | class="tablecell" name="ldap_agent_password" |
58 | - placeholder="<?php p($l->t('Password'));?>" autocomplete="off" |
|
59 | - title="<?php p($l->t('For anonymous access, leave DN and Password empty.'));?>" |
|
58 | + placeholder="<?php p($l->t('Password')); ?>" autocomplete="off" |
|
59 | + title="<?php p($l->t('For anonymous access, leave DN and Password empty.')); ?>" |
|
60 | 60 | /> |
61 | 61 | <button class="ldapSaveAgentCredentials" name="ldapSaveAgentCredentials" type="button"> |
62 | - <?php p($l->t('Save Credentials'));?> |
|
62 | + <?php p($l->t('Save Credentials')); ?> |
|
63 | 63 | </button> |
64 | 64 | </div> |
65 | 65 | <div class="tablerow"> </div> |
@@ -67,24 +67,24 @@ discard block |
||
67 | 67 | <div class="tablerow"> |
68 | 68 | <textarea id="ldap_base" name="ldap_base" |
69 | 69 | class="tablecell" |
70 | - placeholder="<?php p($l->t('One Base DN per line'));?>" |
|
71 | - title="<?php p($l->t('You can specify Base DN for users and groups in the Advanced tab'));?>"> |
|
70 | + placeholder="<?php p($l->t('One Base DN per line')); ?>" |
|
71 | + title="<?php p($l->t('You can specify Base DN for users and groups in the Advanced tab')); ?>"> |
|
72 | 72 | </textarea> |
73 | 73 | <button class="ldapDetectBase" name="ldapDetectBase" type="button"> |
74 | - <?php p($l->t('Detect Base DN'));?> |
|
74 | + <?php p($l->t('Detect Base DN')); ?> |
|
75 | 75 | </button> |
76 | 76 | <button class="ldapTestBase" name="ldapTestBase" type="button"> |
77 | - <?php p($l->t('Test Base DN'));?> |
|
77 | + <?php p($l->t('Test Base DN')); ?> |
|
78 | 78 | </button> |
79 | 79 | </div> |
80 | 80 | |
81 | 81 | <div class="tablerow left"> |
82 | 82 | <input type="checkbox" id="ldap_experienced_admin" value="1" |
83 | 83 | name="ldap_experienced_admin" class="tablecell" |
84 | - title="<?php p($l->t('Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge.'));?>" |
|
84 | + title="<?php p($l->t('Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge.')); ?>" |
|
85 | 85 | /> |
86 | 86 | <label for="ldap_experienced_admin" class="tablecell"> |
87 | - <?php p($l->t('Manually enter LDAP filters (recommended for large directories)'));?> |
|
87 | + <?php p($l->t('Manually enter LDAP filters (recommended for large directories)')); ?> |
|
88 | 88 | </label> |
89 | 89 | </div> |
90 | 90 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | \OC_JSON::checkAppEnabled('user_ldap'); |
31 | 31 | \OC_JSON::callCheck(); |
32 | 32 | |
33 | -$prefix = (string)$_POST['ldap_serverconfig_chooser']; |
|
33 | +$prefix = (string) $_POST['ldap_serverconfig_chooser']; |
|
34 | 34 | |
35 | 35 | // Checkboxes are not submitted, when they are unchecked. Set them manually. |
36 | 36 | // only legacy checkboxes (Advanced and Expert tab) need to be handled here, |
@@ -39,13 +39,13 @@ |
||
39 | 39 | if (!isset($_POST['action'])) { |
40 | 40 | \OC_JSON::error(['message' => $l->t('No action specified')]); |
41 | 41 | } |
42 | -$action = (string)$_POST['action']; |
|
42 | +$action = (string) $_POST['action']; |
|
43 | 43 | |
44 | 44 | |
45 | 45 | if (!isset($_POST['ldap_serverconfig_chooser'])) { |
46 | 46 | \OC_JSON::error(['message' => $l->t('No configuration specified')]); |
47 | 47 | } |
48 | -$prefix = (string)$_POST['ldap_serverconfig_chooser']; |
|
48 | +$prefix = (string) $_POST['ldap_serverconfig_chooser']; |
|
49 | 49 | |
50 | 50 | $ldapWrapper = new \OCA\User_LDAP\LDAP(); |
51 | 51 | $configuration = new \OCA\User_LDAP\Configuration($prefix); |
@@ -33,16 +33,16 @@ |
||
33 | 33 | \OC_JSON::checkAppEnabled('user_ldap'); |
34 | 34 | \OC_JSON::callCheck(); |
35 | 35 | |
36 | -$subject = (string)$_POST['ldap_clear_mapping']; |
|
36 | +$subject = (string) $_POST['ldap_clear_mapping']; |
|
37 | 37 | $mapping = null; |
38 | 38 | try { |
39 | 39 | if ($subject === 'user') { |
40 | 40 | $mapping = new UserMapping(\OC::$server->getDatabaseConnection()); |
41 | 41 | $result = $mapping->clearCb( |
42 | - function ($uid) { |
|
42 | + function($uid) { |
|
43 | 43 | \OC::$server->getUserManager()->emit('\OC\User', 'preUnassignedUserId', [$uid]); |
44 | 44 | }, |
45 | - function ($uid) { |
|
45 | + function($uid) { |
|
46 | 46 | \OC::$server->getUserManager()->emit('\OC\User', 'postUnassignedUserId', [$uid]); |
47 | 47 | } |
48 | 48 | ); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $encryptedRecoveryKey = $this->crypt->encryptPrivateKey($decryptedRecoveryKey, $newPassword); |
127 | 127 | $header = $this->crypt->generateHeader(); |
128 | 128 | if ($encryptedRecoveryKey) { |
129 | - $this->keyManager->setSystemPrivateKey($this->keyManager->getRecoveryKeyId(), $header . $encryptedRecoveryKey); |
|
129 | + $this->keyManager->setSystemPrivateKey($this->keyManager->getRecoveryKeyId(), $header.$encryptedRecoveryKey); |
|
130 | 130 | return true; |
131 | 131 | } |
132 | 132 | return false; |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | $value); |
188 | 188 | |
189 | 189 | if ($value === '1') { |
190 | - $this->addRecoveryKeys('/' . $this->user->getUID() . '/files/'); |
|
190 | + $this->addRecoveryKeys('/'.$this->user->getUID().'/files/'); |
|
191 | 191 | } else { |
192 | - $this->removeRecoveryKeys('/' . $this->user->getUID() . '/files/'); |
|
192 | + $this->removeRecoveryKeys('/'.$this->user->getUID().'/files/'); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | return true; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | foreach ($dirContent as $item) { |
208 | 208 | $filePath = $item->getPath(); |
209 | 209 | if ($item['type'] === 'dir') { |
210 | - $this->addRecoveryKeys($filePath . '/'); |
|
210 | + $this->addRecoveryKeys($filePath.'/'); |
|
211 | 211 | } else { |
212 | 212 | $fileKey = $this->keyManager->getFileKey($filePath, $this->user->getUID()); |
213 | 213 | if (!empty($fileKey)) { |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | foreach ($dirContent as $item) { |
236 | 236 | $filePath = $item->getPath(); |
237 | 237 | if ($item['type'] === 'dir') { |
238 | - $this->removeRecoveryKeys($filePath . '/'); |
|
238 | + $this->removeRecoveryKeys($filePath.'/'); |
|
239 | 239 | } else { |
240 | 240 | $this->keyManager->deleteShareKey($filePath, $this->keyManager->getRecoveryKeyId()); |
241 | 241 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | $privateKey = $this->crypt->decryptPrivateKey($encryptedKey, $recoveryPassword); |
255 | 255 | if ($privateKey !== false) { |
256 | - $this->recoverAllFiles('/' . $user . '/files/', $privateKey, $user); |
|
256 | + $this->recoverAllFiles('/'.$user.'/files/', $privateKey, $user); |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | // Get relative path from encryption/keyfiles |
272 | 272 | $filePath = $item->getPath(); |
273 | 273 | if ($this->view->is_dir($filePath)) { |
274 | - $this->recoverAllFiles($filePath . '/', $privateKey, $uid); |
|
274 | + $this->recoverAllFiles($filePath.'/', $privateKey, $uid); |
|
275 | 275 | } else { |
276 | 276 | $this->recoverFile($filePath, $privateKey, $uid); |
277 | 277 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | value="1" <?php if ($_['encryptHomeStorage']) { |
15 | 15 | print_unescaped('checked="checked"'); |
16 | 16 | } ?> /> |
17 | - <label for="encryptHomeStorage"><?php p($l->t('Encrypt the home storage'));?></label></br> |
|
17 | + <label for="encryptHomeStorage"><?php p($l->t('Encrypt the home storage')); ?></label></br> |
|
18 | 18 | <em><?php p($l->t("Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted")); ?></em> |
19 | 19 | </p> |
20 | 20 | <br /> |
@@ -87,9 +87,9 @@ |
||
87 | 87 | private function getLegacyForms() { |
88 | 88 | $forms = \OC_App::getForms('admin'); |
89 | 89 | |
90 | - $forms = array_map(function ($form) { |
|
90 | + $forms = array_map(function($form) { |
|
91 | 91 | if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
92 | - $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
92 | + $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]); |
|
93 | 93 | $sectionName = str_replace('</h2>', '', $sectionName); |
94 | 94 | $anchor = strtolower($sectionName); |
95 | 95 | $anchor = str_replace(' ', '-', $anchor); |