Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 57944a5

Browse files
committed
Merge branch 'develop'
2 parents 2671537 + f4d1ad4 commit 57944a5

File tree

272 files changed

+2172
-2003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+2172
-2003
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
This is the main source code repository of Pydio (formerly AjaXplorer), containing all the PHP server and HTML5 Web GUI.
1212

13-
* Latest Stable release : 8.0.0
13+
* Latest Stable release : 8.0.1
1414
* License: [AGPLv3](https://www.gnu.org/licenses/agpl.html)
1515
* Lead developer : Charles du Jeu (cdujeu): [Github](https://github.com/cdujeu) | [Twitter](https://twitter.com/Pydio)
1616

@@ -59,7 +59,7 @@ If you think you have found a bug and a way to fix it neatly in the code, use a
5959

6060
#### Writing new plugins
6161

62-
Please read the Developer doc located at https://pydio.com/en/docs/developer-guide-v7, you will find here a bunch of useful information about the plugins architecture, how to create your own plugin, etc. The action.skeleton plugin is a perfect start for that.
62+
Please read the Developer doc located at https://pydio.com/en/docs/developer-guide, you will find here a bunch of useful information about the plugins architecture, how to create your own plugin, etc. The action.skeleton plugin is a perfect start for that.
6363

6464
New in latest build, in the Settings panel, you can find a new "Developer" node where all actions contributed by all plugins are listed. These can be called either by http, or via the CLI API. At the same location, you will find all "hooks" registered and triggered in the server, that are VERY useful when you want your plugin to be really sandboxed.
6565

core/src/conf/RELEASE_NOTE

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,71 @@
11
Pydio ##VERSION_NUMBER## Release Note
22

3-
Bug Fixes for 8.0.0 :
3+
This is a bugfix for Pydio 8.0.1, below is a list of the commits
4+
5+
Fix ldap mapping attribute to roles
6+
Update version to 8.0.1
7+
Fixing a remote stream function
8+
Adding ability to re-generate refresh token if expired
9+
Missing hook for filter_boot.conf
10+
Previous vpath adapter is replaced by use_path_style_endpoint in client config (for custom url)
11+
Make sure action.cart will mount its react component by default.
12+
Clean manifest from old actions
13+
Disable background copy if not using session api, seems to break sync client in some case.
14+
Fix test before create new alias class
15+
Fix set context for object
16+
Fix test key "type" if it exists
17+
Fix test key "type" if it exists
18+
Fix migration public link with password
19+
Fix collabora on smb + session credential workspace
20+
Fix collabora on smb + session credential workspace
21+
Fix collabora on smb + session credential workspace
22+
Updated Korean translation
23+
Missing comma in Korean i18n file was added
24+
Fix remember me feature
25+
Fix upload dialog width when there are few uploaders - Close #1384
26+
Fix #1376
27+
Replace Pear dependency to Mail_mimeDecode to Composer library. Should remove problematic plugin dependency, see #1385
28+
Force redirecting to https version of Pixlr - See #1371
29+
Php doc fix
30+
False negtive on OB detection
31+
Fix #1393
32+
Typo in forbidden
33+
Typo
34+
Fix postgresql convert false to "false"
35+
Remove fuzzy search and upgrade elastica to 5.3.0
36+
Fix displaying user in sql groups
37+
Close session before reading audio file
38+
Remove unused img_library and associated images
39+
Fix developer doc link - Close #1395
40+
Add support referral binding
41+
Implement a default displaymode and default sorting parameter per workspace
42+
Fix download resuming
43+
Fix #1355 - Use renamed from SOURCE instead of renamed to NODE
44+
Remove src attributes
45+
Fix api v2 create user
46+
Reduce Batch size for delete - Fix usage of PATH parameter in S3 driver - Close #1365 at last !
47+
Avoid some js errors with empty values
48+
Forgotten console
49+
Fix getS3Service() method
50+
Add param for smb option
51+
Fix error while index mounted repo
52+
Update password fields everywhere to avoid allowing save when not correctly set.
53+
Fix Admin create/delete group works only if group id starts with double slash
54+
Fix disclaimer dialog (enable scrollBody)
55+
Throw an error when trying to restore on an existing file. Close #1368
56+
Fix write-only workspace : wrong response header - do not show activity log. Close #1367
57+
Hack for user specific locks and api access
58+
Fix quota not updating on workspace switch
59+
Change Accept-Ranges header
60+
Plugin Load ClassFile for a given php version if necessary
61+
Fix Advanced Search and meta fields, inc. missing Content field. Factorize in AbstractSearchEngineIndexer. Try to fix login window not appearing in some case Fix Quota panel not refreshed
62+
New BookmarksList - Meta/Ctrl key support in main files list (close #1351)
63+
Forms: lower onChange trigger timeout to avoid field blinking
64+
Fix field validation
65+
66+
========================
67+
68+
Pydio 8.0.1 - 2017/06/15 - Bug Fixes for 8.0.0
469

570
[Most noticeable]
671
Fix wrong path separator, triggering error on open_basedir

core/src/core/composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
"gimler/guzzle-description-loader" : "*",
1515
"commerceguys/guzzle-oauth2-plugin": "~2.0",
1616
"nikic/fast-route":"~1.0",
17-
"symfony/console":"^3.0",
17+
"symfony/console":"3.3.9",
1818
"davegardnerisme/nsqphp": "dev-master",
1919
"sabre/dav":"1.8.10",
2020
"aws/aws-sdk-php": "^3.19.4",
2121
"meenie/javascript-packer":"1.1",
2222
"dapphp/securimage":"3.6.4",
23-
"phpseclib/phpseclib":"2.0.3"
23+
"phpseclib/phpseclib":"2.0.3",
24+
"pear/mail_mime-decode":"1.5.5.2"
2425
}
2526

2627
}

core/src/core/src/pydio/Core/Controller/Controller.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public static function run(ServerRequestInterface $request, &$actionNode = null)
228228
&& $loggedUser->canWrite($ctx->getRepositoryId()."")){
229229
// Special case of "write only" right : return empty listing, no auth error.
230230
$response = new Response();
231+
$response = $response->withHeader("Content-type", "text/xml");
231232
$response->getBody()->write(XMLHelper::wrapDocument(""));
232233
return $response;
233234
}else{

core/src/core/src/pydio/Core/Exception/ForbiddenCharacterException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ class ForbiddenCharacterException extends PydioException
3434
*/
3535
public function __construct($originalString)
3636
{
37-
parent::__construct("$originalString contains forbbiden characters", null, 5012);
37+
parent::__construct("$originalString contains forbidden characters", null, 5012);
3838
}
3939
}

core/src/core/src/pydio/Core/Http/Response/FileReaderResponse.php

100644100755
Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,11 @@ public function readFile($node = null, $filePath = null, $data = null, $headerTy
240240

241241
$localName = ($localName =="" ? basename((isSet($originalFilePath)?$originalFilePath:$filePathOrData)) : $localName);
242242

243-
if ($headerType == "plain") {
244243

244+
header("Pragma: public");
245+
header("Cache-Control: public, must-revalidate, post-check=0, pre-check=0");
246+
247+
if ($headerType == "plain") {
245248
header("Content-type:text/plain");
246249
header("Content-Length: ".$size);
247250

@@ -253,14 +256,16 @@ public function readFile($node = null, $filePath = null, $data = null, $headerTy
253256

254257
} else {
255258

259+
header("Accept-Ranges: bytes");
260+
256261
if ($isFile) {
257-
header("Accept-Ranges: 0-$size");
258262
$this->logDebug("Sending accept range 0-$size");
263+
$tsstring = gmdate('D, d M Y H:i:s ', filemtime($filePathOrData)) . 'GMT';
264+
header("Last-Modified: $tsstring");
259265
}
260266

261267
// Check if we have a range header (we are resuming a transfer)
262268
if ( isset($serverParams['HTTP_RANGE']) && $isFile && $size != 0 ) {
263-
264269
if ($headerType == "stream_content") {
265270

266271
if (extension_loaded('fileinfo') && (( $node !== null && !$node->wrapperIsRemote()) || $filePath !== null)) {
@@ -282,15 +287,25 @@ public function readFile($node = null, $filePath = null, $data = null, $headerTy
282287
// multiple ranges, which can become pretty complex, so ignore it for now
283288
$ranges = explode('=', $_SERVER['HTTP_RANGE']);
284289
$offsets = explode('-', $ranges[1]);
285-
$offset = floatval($offsets[0]);
290+
if(!$offsets[0]) {
291+
$offset = 0;
292+
}else{
293+
$offset = floatval($offsets[0]);
294+
}
295+
296+
if (!$offsets[1]) {
297+
$length = $size - $offset;
298+
}else{
299+
$length = floatval($offsets[1]) - $offset;
300+
if ($length + $offset > $size || $length < 0) {
301+
$length = $size - $offset;
302+
}
303+
}
286304

287-
$length = floatval($offsets[1]) - $offset;
288-
if (!$length) $length = $size - $offset;
289-
if ($length + $offset > $size || $length < 0) $length = $size - $offset;
305+
$dataSizeFromOffset = ($offset + $length - 1) >= 0 ? ($offset + $length - 1): 0;
290306
$this->logDebug('Content-Range: bytes ' . $offset . '-' . $length . '/' . $size);
291307
header('HTTP/1.1 206 Partial Content');
292-
header('Content-Range: bytes ' . $offset . '-' . ($offset + $length) . '/' . $size);
293-
308+
header('Content-Range: bytes ' . $offset . '-' . $dataSizeFromOffset . '/' . $size);
294309
header("Content-Length: ". $length);
295310
$file = fopen($filePathOrData, 'rb');
296311
if(!is_resource($file)){
@@ -304,32 +319,28 @@ public function readFile($node = null, $filePath = null, $data = null, $headerTy
304319
$relOffset -= 2000000000;
305320
// This works because we never overcome the PHP 32 bit limit
306321
}
307-
fseek($file, $relOffset, SEEK_CUR);
322+
$fseek = fseek($file, $relOffset, SEEK_CUR);
308323

309324
while(ob_get_level()) ob_end_flush();
310325
$readSize = 0.0;
311326
$bufferSize = 1024 * 8;
312327
while (!feof($file) && $readSize < $length && connection_status() == 0) {
313-
$this->logDebug("dl reading $readSize to $length", ["httpRange" => $serverParams["HTTP_RANGE"]]);
314-
echo fread($file, $bufferSize);
328+
echo fread($file, $bufferSize);
315329
$readSize += $bufferSize;
316330
flush();
317331
}
318332

319333
fclose($file);
320334
return;
321335

322-
} else {
323-
336+
}
337+
else {
324338
if ($confGzip) {
325-
326339
$gzippedData = ($data?gzencode($filePathOrData,9):gzencode(file_get_contents($filePathOrData), 9));
327340
$size = strlen($gzippedData);
328341

329342
}
330-
331343
HTMLWriter::emitAttachmentsHeaders($localName, $size, $isFile, $confGzip);
332-
333344
if ($confGzip && isSet($gzippedData)) {
334345
print $gzippedData;
335346
return;
@@ -448,7 +459,7 @@ protected function sendToAccelerator($accelConfiguration, $localPathOrNode, $ser
448459
// Pydio Agent acceleration - We make sure that request was really proxied by Agent, by checking a specific header.
449460
if($accelConfiguration === "pydio" && array_key_exists("HTTP_X_PYDIO_DOWNLOAD_SUPPORTED", $serverParams)
450461
&& ApiKeysService::requestHasValidHeadersForAdminTask($serverParams, PYDIO_BOOSTER_TASK_IDENTIFIER)) {
451-
462+
452463
if ($localPathOrNode instanceof AJXP_Node) {
453464
$options = MetaStreamWrapper::getResolvedOptionsForNode($localPathOrNode);
454465
if($options["TYPE"] === "php"){

core/src/core/src/pydio/Core/Http/Wopi/AuthFrontend.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323
use JWT;
2424
use Psr\Http\Message\ResponseInterface;
2525
use Psr\Http\Message\ServerRequestInterface;
26+
use Pydio\Auth\Core\MemorySafe;
2627
use Pydio\Core\Model\ContextInterface;
2728
use Pydio\Core\Services\ApiKeysService;
2829
use Pydio\Auth\Frontend\Core\AbstractAuthFrontend;
2930
use Pydio\Conf\Sql\SqlConfDriver;
31+
use Pydio\Core\Services\CacheService;
3032
use Pydio\Log\Core\Logger;
3133
use Zend\Diactoros\UploadedFile;
3234

@@ -137,6 +139,12 @@ function tryToLogUser(ServerRequestInterface &$request, ResponseInterface &$resp
137139
$token = $payload->token;
138140
$task = $payload->task;
139141

142+
// store encrypted user's credential in cache.
143+
$sessionId = $payload->session_id;
144+
$encryptedString = CacheService::fetch(AJXP_CACHE_SERVICE_NS_SHARED, $sessionId);
145+
$credential = MemorySafe::getCredentialsFromEncodedString($encryptedString);
146+
MemorySafe::storeCredentials($credential["user"], $credential["password"]);
147+
140148
$key = ApiKeysService::findPairForAdminTask($task, $currentUser->getId());
141149

142150
if ($key["t"] !== $token) {

core/src/core/src/pydio/Core/PluginFramework/Plugin.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,18 @@ public function getClassFile()
782782
if($this->manifestXML != null) $this->unserializeManifest();
783783
$files = $this->xPath->query("class_definition");
784784
if(!$files->length) return false;
785-
return $this->nodeAttrToHash($files->item(0));
785+
foreach($files as $classDef){
786+
$data = $this->nodeAttrToHash($classDef);
787+
if(!empty($data["version"])){
788+
if (version_compare(phpversion(), $data["version"]) >= 0) {
789+
return $data;
790+
} else {
791+
continue;
792+
}
793+
} else {
794+
return $data;
795+
}
796+
}
786797
}
787798

788799
/**

core/src/core/src/pydio/Core/Services/UsersService.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public static function invalidateCache(){
235235

236236
}
237237

238-
238+
239239

240240
/**
241241
* Whether the whole users management system is enabled or not.
@@ -331,7 +331,7 @@ public static function isReservedUserId($username)
331331
* @param $userId
332332
* @param $userPass
333333
* @param bool $cookieString
334-
* @return bool|void
334+
* @return bool
335335
* @throws UserNotFoundException
336336
*/
337337
public static function checkPassword($userId, $userPass, $cookieString = false)
@@ -341,7 +341,7 @@ public static function checkPassword($userId, $userPass, $cookieString = false)
341341
$authDriver = ConfService::getAuthDriverImpl();
342342
if ($cookieString) {
343343
$userObject = self::getUserById($userId);
344-
$res = CookiesHelper::checkCookieString($userObject, $userPass);
344+
$res = CookiesHelper::checkCookieString($userObject, $cookieString);
345345
return $res;
346346
}
347347
return $authDriver->checkPassword($userId, $userPass);
@@ -623,7 +623,7 @@ public static function browseUsersGroupsWithCallback($baseGroup, $userCallback,
623623
if($recursive){
624624
$childrenGroups = $authDriver->listChildrenGroups($baseGroup);
625625
foreach($childrenGroups as $relativePath => $groupLabel){
626-
self::browseUsersGroupsWithCallback(rtrim($baseGroup, "/")."/".$relativePath, $userCallback, true, $groupCallback, $groupLabel);
626+
self::browseUsersGroupsWithCallback(rtrim($baseGroup, "/")."/".ltrim($relativePath,"/"), $userCallback, true, $groupCallback, $groupLabel);
627627
}
628628
}
629629

@@ -765,4 +765,4 @@ public static function getUserPersonalParameter($parameterName, $userIdOrObject,
765765
return $value;
766766

767767
}
768-
}
768+
}

core/src/core/src/pydio/Tests/PHP_OB.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function doTest()
4141
{
4242
$this->failedLevel = "warning";
4343
$v = @ini_get("output_buffering");
44-
if (isSet($v) && (is_numeric($v) || strtolower($v) == "on")) {
44+
if (isSet($v) && ( (is_numeric($v) && $v != "0") || strtolower($v) == "on")) {
4545
$this->testedParams["PHP Output Buffer disabled"] = "No";
4646
return FALSE;
4747
} else if (!isSet($v)) {

0 commit comments

Comments
 (0)