@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | case 'database': |
95 | 95 | case 'mysql': |
96 | 96 | case 'sqlite': |
97 | - \OCP\Util::writeLog('core', 'Adding user backend ' . $backend . '.', \OCP\Util::DEBUG); |
|
97 | + \OCP\Util::writeLog('core', 'Adding user backend '.$backend.'.', \OCP\Util::DEBUG); |
|
98 | 98 | self::$_usedBackends[$backend] = new \OC\User\Database(); |
99 | 99 | \OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]); |
100 | 100 | break; |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | \OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]); |
104 | 104 | break; |
105 | 105 | default: |
106 | - \OCP\Util::writeLog('core', 'Adding default user backend ' . $backend . '.', \OCP\Util::DEBUG); |
|
107 | - $className = 'OC_USER_' . strtoupper($backend); |
|
106 | + \OCP\Util::writeLog('core', 'Adding default user backend '.$backend.'.', \OCP\Util::DEBUG); |
|
107 | + $className = 'OC_USER_'.strtoupper($backend); |
|
108 | 108 | self::$_usedBackends[$backend] = new $className(); |
109 | 109 | \OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]); |
110 | 110 | break; |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | self::useBackend($backend); |
141 | 141 | self::$_setupedBackends[] = $i; |
142 | 142 | } else { |
143 | - \OCP\Util::writeLog('core', 'User backend ' . $class . ' already initialized.', \OCP\Util::DEBUG); |
|
143 | + \OCP\Util::writeLog('core', 'User backend '.$class.' already initialized.', \OCP\Util::DEBUG); |
|
144 | 144 | } |
145 | 145 | } else { |
146 | - \OCP\Util::writeLog('core', 'User backend ' . $class . ' not found.', \OCP\Util::ERROR); |
|
146 | + \OCP\Util::writeLog('core', 'User backend '.$class.' not found.', \OCP\Util::ERROR); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | } |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | if ($user) { |
472 | 472 | return $user->getHome(); |
473 | 473 | } else { |
474 | - return \OC::$server->getSystemConfig()->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $uid; |
|
474 | + return \OC::$server->getSystemConfig()->getValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$uid; |
|
475 | 475 | } |
476 | 476 | } |
477 | 477 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | * @return ILinkAction |
52 | 52 | */ |
53 | 53 | public function newEMailAction($icon, $name, $email) { |
54 | - return $this->newLinkAction($icon, $name, 'mailto:' . urlencode($email)); |
|
54 | + return $this->newLinkAction($icon, $name, 'mailto:'.urlencode($email)); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | } |
@@ -33,6 +33,6 @@ |
||
33 | 33 | * @inheritdoc |
34 | 34 | */ |
35 | 35 | public function like($x, $y, $type = null) { |
36 | - return parent::like($x, $y, $type) . " ESCAPE '\\'"; |
|
36 | + return parent::like($x, $y, $type)." ESCAPE '\\'"; |
|
37 | 37 | } |
38 | 38 | } |
@@ -25,6 +25,6 @@ |
||
25 | 25 | |
26 | 26 | class OCIFunctionBuilder extends FunctionBuilder { |
27 | 27 | public function md5($input) { |
28 | - return new QueryFunction('LOWER(DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw(' . $this->helper->quoteColumnName($input) .')))'); |
|
28 | + return new QueryFunction('LOWER(DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw('.$this->helper->quoteColumnName($input).')))'); |
|
29 | 29 | } |
30 | 30 | } |
@@ -56,8 +56,8 @@ |
||
56 | 56 | */ |
57 | 57 | public function postConnect(ConnectionEventArgs $args) { |
58 | 58 | $sensitive = ($this->caseSensitiveLike) ? 'true' : 'false'; |
59 | - $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive); |
|
60 | - $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode); |
|
59 | + $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = '.$sensitive); |
|
60 | + $args->getConnection()->executeUpdate('PRAGMA journal_mode = '.$this->journalMode); |
|
61 | 61 | /** @var \PDO $pdo */ |
62 | 62 | $pdo = $args->getConnection()->getWrappedConnection(); |
63 | 63 | $pdo->sqliteCreateFunction('md5', 'md5', 1); |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | |
43 | 43 | public function fixupStatement($statement) { |
44 | 44 | $statement = preg_replace('/`(\w+)` ILIKE \?/', 'LOWER($1) LIKE LOWER(?)', $statement); |
45 | - $statement = str_replace( '`', '"', $statement ); |
|
46 | - $statement = str_ireplace( 'NOW()', 'datetime(\'now\')', $statement ); |
|
45 | + $statement = str_replace('`', '"', $statement); |
|
46 | + $statement = str_ireplace('NOW()', 'datetime(\'now\')', $statement); |
|
47 | 47 | $statement = str_ireplace('GREATEST(', 'MAX(', $statement); |
48 | - $statement = str_ireplace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $statement ); |
|
48 | + $statement = str_ireplace('UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $statement); |
|
49 | 49 | return $statement; |
50 | 50 | } |
51 | 51 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | if (empty($compare)) { |
65 | 65 | $compare = array_keys($input); |
66 | 66 | } |
67 | - $fieldList = '`' . implode('`,`', array_keys($input)) . '`'; |
|
67 | + $fieldList = '`'.implode('`,`', array_keys($input)).'`'; |
|
68 | 68 | $query = "INSERT INTO `$table` ($fieldList) SELECT " |
69 | - . str_repeat('?,', count($input)-1).'? ' |
|
69 | + . str_repeat('?,', count($input) - 1).'? ' |
|
70 | 70 | . " WHERE NOT EXISTS (SELECT 1 FROM `$table` WHERE "; |
71 | 71 | |
72 | 72 | $inserts = array_values($input); |
73 | - foreach($compare as $key) { |
|
74 | - $query .= '`' . $key . '`'; |
|
73 | + foreach ($compare as $key) { |
|
74 | + $query .= '`'.$key.'`'; |
|
75 | 75 | if (is_null($input[$key])) { |
76 | 76 | $query .= ' IS NULL AND '; |
77 | 77 | } else { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <div class="warning title"> |
19 | 19 | <?php p($l->t('Please renew your password.')); ?><br> |
20 | 20 | </div> |
21 | - <?php foreach($_['messages'] as $message): ?> |
|
21 | + <?php foreach ($_['messages'] as $message): ?> |
|
22 | 22 | <div class="warning"> |
23 | 23 | <?php p($message); ?><br> |
24 | 24 | </div> |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | <?php endif; ?> |
32 | 32 | <div id="message" class="hidden"> |
33 | 33 | <img class="float-spinner" alt="" |
34 | - src="<?php p(image_path('core', 'loading-dark.gif'));?>"> |
|
34 | + src="<?php p(image_path('core', 'loading-dark.gif')); ?>"> |
|
35 | 35 | <span id="messageText"></span> |
36 | 36 | <!-- the following div ensures that the spinner is always inside the #message div --> |
37 | 37 | <div style="clear: both;"></div> |
38 | 38 | </div> |
39 | 39 | <p class="grouptop"> |
40 | 40 | <input type="password" id="oldPassword" name="oldPassword" |
41 | - placeholder="<?php echo $l->t('Current password');?>" |
|
41 | + placeholder="<?php echo $l->t('Current password'); ?>" |
|
42 | 42 | autofocus autocomplete="off" autocapitalize="off" autocorrect="off" required/> |
43 | 43 | <label for="oldPassword" class="infield"><?php p($l->t('Current password')); ?></label> |
44 | 44 | </p> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | <input type="checkbox" id="personal-show" name="show" /><label for="personal-show"></label> |
48 | 48 | <label id="newPassword-label" for="newPassword" class="infield"><?php p($l->t('New password')); ?></label> |
49 | 49 | <input type="password" id="newPassword" name="newPassword" |
50 | - placeholder="<?php echo $l->t('New password');?>" |
|
50 | + placeholder="<?php echo $l->t('New password'); ?>" |
|
51 | 51 | data-typetoggle="#personal-show" autofocus autocomplete="off" autocapitalize="off" autocorrect="off" required/> |
52 | 52 | </p> |
53 | 53 |
@@ -80,22 +80,22 @@ discard block |
||
80 | 80 | //pass in app.php we do add here, except something else is passed e.g. |
81 | 81 | //in tests. |
82 | 82 | |
83 | - if(isset($arguments['helper'])) { |
|
83 | + if (isset($arguments['helper'])) { |
|
84 | 84 | $this->ldapHelper = $arguments['helper']; |
85 | 85 | } else { |
86 | 86 | $this->ldapHelper = new Helper(\OC::$server->getConfig()); |
87 | 87 | } |
88 | 88 | |
89 | - if(isset($arguments['ocConfig'])) { |
|
89 | + if (isset($arguments['ocConfig'])) { |
|
90 | 90 | $this->ocConfig = $arguments['ocConfig']; |
91 | 91 | } else { |
92 | 92 | $this->ocConfig = \OC::$server->getConfig(); |
93 | 93 | } |
94 | 94 | |
95 | - if(isset($arguments['userBackend'])) { |
|
95 | + if (isset($arguments['userBackend'])) { |
|
96 | 96 | $this->userBackend = $arguments['userBackend']; |
97 | 97 | } else { |
98 | - $this->userBackend = new User_Proxy( |
|
98 | + $this->userBackend = new User_Proxy( |
|
99 | 99 | $this->ldapHelper->getServerConfigurationPrefixes(true), |
100 | 100 | new LDAP(), |
101 | 101 | $this->ocConfig, |
@@ -103,19 +103,19 @@ discard block |
||
103 | 103 | ); |
104 | 104 | } |
105 | 105 | |
106 | - if(isset($arguments['db'])) { |
|
106 | + if (isset($arguments['db'])) { |
|
107 | 107 | $this->db = $arguments['db']; |
108 | 108 | } else { |
109 | 109 | $this->db = \OC::$server->getDatabaseConnection(); |
110 | 110 | } |
111 | 111 | |
112 | - if(isset($arguments['mapping'])) { |
|
112 | + if (isset($arguments['mapping'])) { |
|
113 | 113 | $this->mapping = $arguments['mapping']; |
114 | 114 | } else { |
115 | 115 | $this->mapping = new UserMapping($this->db); |
116 | 116 | } |
117 | 117 | |
118 | - if(isset($arguments['deletedUsersIndex'])) { |
|
118 | + if (isset($arguments['deletedUsersIndex'])) { |
|
119 | 119 | $this->dui = $arguments['deletedUsersIndex']; |
120 | 120 | } else { |
121 | 121 | $this->dui = new DeletedUsersIndex( |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | public function run($argument) { |
131 | 131 | $this->setArguments($argument); |
132 | 132 | |
133 | - if(!$this->isCleanUpAllowed()) { |
|
133 | + if (!$this->isCleanUpAllowed()) { |
|
134 | 134 | return; |
135 | 135 | } |
136 | 136 | $users = $this->mapping->getList($this->getOffset(), $this->limit); |
137 | - if(!is_array($users)) { |
|
137 | + if (!is_array($users)) { |
|
138 | 138 | //something wrong? Let's start from the beginning next time and |
139 | 139 | //abort |
140 | 140 | $this->setOffset(true); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function isCleanUpAllowed() { |
162 | 162 | try { |
163 | - if($this->ldapHelper->haveDisabledConfigurations()) { |
|
163 | + if ($this->ldapHelper->haveDisabledConfigurations()) { |
|
164 | 164 | return false; |
165 | 165 | } |
166 | 166 | } catch (\Exception $e) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | * @return bool |
178 | 178 | */ |
179 | 179 | private function isCleanUpEnabled() { |
180 | - return (bool)$this->ocConfig->getSystemValue( |
|
180 | + return (bool) $this->ocConfig->getSystemValue( |
|
181 | 181 | 'ldapUserCleanupInterval', strval($this->defaultIntervalMin)); |
182 | 182 | } |
183 | 183 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | * @param array $users result from getMappedUsers() |
187 | 187 | */ |
188 | 188 | private function checkUsers(array $users) { |
189 | - foreach($users as $user) { |
|
189 | + foreach ($users as $user) { |
|
190 | 190 | $this->checkUser($user); |
191 | 191 | } |
192 | 192 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @param string[] $user |
197 | 197 | */ |
198 | 198 | private function checkUser(array $user) { |
199 | - if($this->userBackend->userExistsOnLDAP($user['name'])) { |
|
199 | + if ($this->userBackend->userExistsOnLDAP($user['name'])) { |
|
200 | 200 | //still available, all good |
201 | 201 | |
202 | 202 | return; |
@@ -218,8 +218,7 @@ discard block |
||
218 | 218 | * @param bool $reset whether the offset should be set to 0 |
219 | 219 | */ |
220 | 220 | public function setOffset($reset = false) { |
221 | - $newOffset = $reset ? 0 : |
|
222 | - $this->getOffset() + $this->limit; |
|
221 | + $newOffset = $reset ? 0 : $this->getOffset() + $this->limit; |
|
223 | 222 | $this->ocConfig->setAppValue('user_ldap', 'cleanUpJobOffset', $newOffset); |
224 | 223 | } |
225 | 224 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | use OCP\AppFramework\IAppContainer; |
28 | 28 | |
29 | 29 | class Application extends App { |
30 | - public function __construct () { |
|
30 | + public function __construct() { |
|
31 | 31 | parent::__construct('user_ldap'); |
32 | 32 | $container = $this->getContainer(); |
33 | 33 |