@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | foreach ($favorites['folders'] as $favorite) { |
| 140 | 140 | $limitations[] = $query->expr()->like('file', $query->createNamedParameter( |
| 141 | - $this->db->escapeLikeParameter($favorite . '/') . '%' |
|
| 141 | + $this->db->escapeLikeParameter($favorite.'/').'%' |
|
| 142 | 142 | )); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | $function = $query->createFunction(' |
| 150 | 150 | CASE |
| 151 | - WHEN ' . $query->getColumnName('app') . ' <> ' . $query->createNamedParameter('files') . ' THEN 1 |
|
| 152 | - WHEN ' . $query->getColumnName('app') . ' = ' . $query->createNamedParameter('files') . ' |
|
| 153 | - AND (' . implode(' OR ', $limitations) . ') |
|
| 151 | + WHEN ' . $query->getColumnName('app').' <> '.$query->createNamedParameter('files').' THEN 1 |
|
| 152 | + WHEN ' . $query->getColumnName('app').' = '.$query->createNamedParameter('files').' |
|
| 153 | + AND (' . implode(' OR ', $limitations).') |
|
| 154 | 154 | THEN 1 |
| 155 | 155 | END = 1' |
| 156 | 156 | ); |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | if (!empty($nodes)) { |
| 65 | 65 | /** @var \OCP\Files\Node $node */ |
| 66 | 66 | $node = array_shift($nodes); |
| 67 | - $path = substr($node->getPath(), strlen($user . '/files/')); |
|
| 67 | + $path = substr($node->getPath(), strlen($user.'/files/')); |
|
| 68 | 68 | |
| 69 | 69 | $items[] = $path; |
| 70 | 70 | if ($node instanceof Folder) { |
@@ -38,14 +38,14 @@ |
||
| 38 | 38 | |
| 39 | 39 | public function run($argument) { |
| 40 | 40 | $isUser = $this->proxy instanceof User_Proxy; |
| 41 | - foreach($argument['records'] as $record) { |
|
| 41 | + foreach ($argument['records'] as $record) { |
|
| 42 | 42 | $access = $this->proxy->getLDAPAccess($record['name']); |
| 43 | 43 | $uuid = $access->getUUID($record['dn'], $isUser); |
| 44 | - if($uuid === false) { |
|
| 44 | + if ($uuid === false) { |
|
| 45 | 45 | // record not found, no prob, continue with the next |
| 46 | 46 | continue; |
| 47 | 47 | } |
| 48 | - if($uuid !== $record['uuid']) { |
|
| 48 | + if ($uuid !== $record['uuid']) { |
|
| 49 | 49 | $this->mapper->setUUIDbyDN($uuid, $record['dn']); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -93,8 +93,7 @@ |
||
| 93 | 93 | public function unlink($path) { |
| 94 | 94 | if ($this->is_dir($path)) { |
| 95 | 95 | return $this->rmdir($path); |
| 96 | - } |
|
| 97 | - else { |
|
| 96 | + } else { |
|
| 98 | 97 | $url = $this->constructUrl($path); |
| 99 | 98 | $result = unlink($url); |
| 100 | 99 | clearstatcache(true, $url); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | use Icewind\Streams\CallbackWrapper; |
| 38 | 38 | use Icewind\Streams\RetryWrapper; |
| 39 | 39 | |
| 40 | -class FTP extends StreamWrapper{ |
|
| 40 | +class FTP extends StreamWrapper { |
|
| 41 | 41 | private $password; |
| 42 | 42 | private $user; |
| 43 | 43 | private $host; |
@@ -46,17 +46,17 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public function __construct($params) { |
| 48 | 48 | if (isset($params['host']) && isset($params['user']) && isset($params['password'])) { |
| 49 | - $this->host=$params['host']; |
|
| 50 | - $this->user=$params['user']; |
|
| 51 | - $this->password=$params['password']; |
|
| 49 | + $this->host = $params['host']; |
|
| 50 | + $this->user = $params['user']; |
|
| 51 | + $this->password = $params['password']; |
|
| 52 | 52 | if (isset($params['secure'])) { |
| 53 | 53 | $this->secure = $params['secure']; |
| 54 | 54 | } else { |
| 55 | 55 | $this->secure = false; |
| 56 | 56 | } |
| 57 | - $this->root=isset($params['root'])?$params['root']:'/'; |
|
| 58 | - if ( ! $this->root || $this->root[0]!=='/') { |
|
| 59 | - $this->root='/'.$this->root; |
|
| 57 | + $this->root = isset($params['root']) ? $params['root'] : '/'; |
|
| 58 | + if (!$this->root || $this->root[0] !== '/') { |
|
| 59 | + $this->root = '/'.$this->root; |
|
| 60 | 60 | } |
| 61 | 61 | if (substr($this->root, -1) !== '/') { |
| 62 | 62 | $this->root .= '/'; |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - public function getId(){ |
|
| 71 | - return 'ftp::' . $this->user . '@' . $this->host . '/' . $this->root; |
|
| 70 | + public function getId() { |
|
| 71 | + return 'ftp::'.$this->user.'@'.$this->host.'/'.$this->root; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | * @return string |
| 78 | 78 | */ |
| 79 | 79 | public function constructUrl($path) { |
| 80 | - $url='ftp'; |
|
| 80 | + $url = 'ftp'; |
|
| 81 | 81 | if ($this->secure) { |
| 82 | - $url.='s'; |
|
| 82 | + $url .= 's'; |
|
| 83 | 83 | } |
| 84 | - $url.='://'.urlencode($this->user).':'.urlencode($this->password).'@'.$this->host.$this->root.$path; |
|
| 84 | + $url .= '://'.urlencode($this->user).':'.urlencode($this->password).'@'.$this->host.$this->root.$path; |
|
| 85 | 85 | return $url; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | return $result; |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | - public function fopen($path,$mode) { |
|
| 104 | - switch($mode) { |
|
| 103 | + public function fopen($path, $mode) { |
|
| 104 | + switch ($mode) { |
|
| 105 | 105 | case 'r': |
| 106 | 106 | case 'rb': |
| 107 | 107 | case 'w': |
@@ -121,17 +121,17 @@ discard block |
||
| 121 | 121 | case 'c': |
| 122 | 122 | case 'c+': |
| 123 | 123 | //emulate these |
| 124 | - if (strrpos($path, '.')!==false) { |
|
| 125 | - $ext=substr($path, strrpos($path, '.')); |
|
| 124 | + if (strrpos($path, '.') !== false) { |
|
| 125 | + $ext = substr($path, strrpos($path, '.')); |
|
| 126 | 126 | } else { |
| 127 | - $ext=''; |
|
| 127 | + $ext = ''; |
|
| 128 | 128 | } |
| 129 | 129 | $tmpFile = \OC::$server->getTempManager()->getTemporaryFile(); |
| 130 | 130 | if ($this->file_exists($path)) { |
| 131 | 131 | $this->getFile($path, $tmpFile); |
| 132 | 132 | } |
| 133 | 133 | $handle = fopen($tmpFile, $mode); |
| 134 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 134 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 135 | 135 | $this->writeBack($tmpFile, $path); |
| 136 | 136 | }); |
| 137 | 137 | } |
@@ -47,10 +47,10 @@ |
||
| 47 | 47 | return false; |
| 48 | 48 | } |
| 49 | 49 | while (($file = readdir($dh)) !== false) { |
| 50 | - if ($this->is_dir($path . '/' . $file)) { |
|
| 51 | - $this->rmdir($path . '/' . $file); |
|
| 50 | + if ($this->is_dir($path.'/'.$file)) { |
|
| 51 | + $this->rmdir($path.'/'.$file); |
|
| 52 | 52 | } else { |
| 53 | - $this->unlink($path . '/' . $file); |
|
| 53 | + $this->unlink($path.'/'.$file); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | $url = $this->constructUrl($path); |
@@ -18,14 +18,14 @@ |
||
| 18 | 18 | <tr> |
| 19 | 19 | <th id='headerName' class="hidden column-name"> |
| 20 | 20 | <div id="headerName-container"> |
| 21 | - <a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a> |
|
| 21 | + <a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a> |
|
| 22 | 22 | </div> |
| 23 | 23 | </th> |
| 24 | 24 | <th id="headerSize" class="hidden column-size"> |
| 25 | 25 | <a class="size sort columntitle" data-sort="size"><span><?php p($l->t('Size')); ?></span><span class="sort-indicator"></span></a> |
| 26 | 26 | </th> |
| 27 | 27 | <th id="headerDate" class="hidden column-mtime"> |
| 28 | - <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t( 'Modified' )); ?></span><span class="sort-indicator"></span></a> |
|
| 28 | + <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t('Modified')); ?></span><span class="sort-indicator"></span></a> |
|
| 29 | 29 | </th> |
| 30 | 30 | </tr> |
| 31 | 31 | </thead> |
@@ -279,7 +279,7 @@ |
||
| 279 | 279 | if ($tagData === null) { |
| 280 | 280 | list($name, $status) = explode('|||', substr($parameter, 3, -3)); |
| 281 | 281 | $tagData = [ |
| 282 | - 'id' => 0,// No way to recover the ID |
|
| 282 | + 'id' => 0, // No way to recover the ID |
|
| 283 | 283 | 'name' => $name, |
| 284 | 284 | 'assignable' => $status === 'assignable', |
| 285 | 285 | 'visible' => $status !== 'invisible', |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | <tr> |
| 16 | 16 | <th id='headerName' class="hidden column-name"> |
| 17 | 17 | <div id="headerName-container"> |
| 18 | - <a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a> |
|
| 18 | + <a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a> |
|
| 19 | 19 | </div> |
| 20 | 20 | </th> |
| 21 | 21 | <th id="headerDate" class="hidden column-mtime"> |
| 22 | - <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t( 'Share time' )); ?></span><span class="sort-indicator"></span></a> |
|
| 22 | + <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t('Share time')); ?></span><span class="sort-indicator"></span></a> |
|
| 23 | 23 | </th> |
| 24 | 24 | <th class="hidden column-expiration"> |
| 25 | - <a class="columntitle"><span><?php p($l->t( 'Expiration date' )); ?></span></a> |
|
| 25 | + <a class="columntitle"><span><?php p($l->t('Expiration date')); ?></span></a> |
|
| 26 | 26 | </th> |
| 27 | 27 | </tr> |
| 28 | 28 | </thead> |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | return [ |
| 141 | 141 | 'type' => 'user', |
| 142 | 142 | 'id' => $remoteUser->getUser(), |
| 143 | - 'name' => $cloudId,// Todo display name from contacts |
|
| 143 | + 'name' => $cloudId, // Todo display name from contacts |
|
| 144 | 144 | 'server' => $remoteUser->getRemote(), |
| 145 | 145 | ]; |
| 146 | 146 | } |