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

Commit e8084be

Browse files
committed
Merge branch 'develop' of http://github.com/pydio/pydio-core into develop
* 'develop' of http://github.com/pydio/pydio-core: Fix TeamsList searching Refix group sorting. We must compare to 0. Missing var in disclaimer javascript. Fix isUnique() function in datamodel. Fix #1108: Caching issues for unoconv-generated previews of office files. Fix Team and Group listing and filtering by keeping an alt. pregexp value. Enable "Explore" action on root folder. Dedup files in UserSelection Fix ShutdownScheduler that could skip deferred events when already in deferred loop. Fix possible issue in metastore for root node. Fix fireContextChange by passing a dataModel: fix right-click instabilities. (cherry picked from commit 9d9851b) Missing auto-complete styling for .e.g tags metadata. Fix root node actions detection. Do not display inbox in cross repo list. Set POST by default on client to avoid too long requests. Fix URL for plugins documentation Fix group sorting in orderRoles ( close #1126 ) Adding react tap event clear dependency (cherry picked from commit 8c358fe) Set REPO_SYNCABLE on default repositories (cherry picked from commit 86497a8) SearchEngine: change "more results" messages, we may not know the exact total result count. (cherry picked from commit 58bbd23) Change S3 clients instanciation.
2 parents 1404c72 + a8962a7 commit e8084be

Some content is hidden

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

56 files changed

+364
-199
lines changed

core/src/conf/bootstrap_repositories.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
),
5353
"meta.filehasher" => array(),
5454
"meta.watch" => array(),
55-
"meta.syncable" => array(),
55+
"meta.syncable" => array("REPO_SYNCABLE" => true),
5656
"meta.exif" => array(
5757
"meta_fields" => "COMPUTED_GPS.GPS_Latitude,COMPUTED_GPS.GPS_Longitude",
5858
"meta_labels" => "Latitude,Longitude"
@@ -91,7 +91,7 @@
9191
),
9292
"meta.filehasher" => array(),
9393
"meta.watch" => array(),
94-
"meta.syncable" => array(),
94+
"meta.syncable" => array("REPO_SYNCABLE" => true),
9595
"meta.exif" => array(
9696
"meta_fields" => "COMPUTED_GPS.GPS_Latitude,COMPUTED_GPS.GPS_Longitude",
9797
"meta_labels" => "Latitude,Longitude"

core/src/core/classes/class.AJXP_ShutdownScheduler.php

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,33 @@ public function registerShutdownEvent()
8181
$this->callbacks[] = $callback;
8282
return true;
8383
}
84-
public function callRegisteredShutdown()
85-
{
86-
session_write_close();
84+
85+
public function callRegisteredShutdown()
86+
{
87+
session_write_close();
8788
if (!headers_sent()) {
88-
$size = ob_get_length();
89-
header("Connection: close\r\n");
90-
//header("Content-Encoding: none\r\n");
91-
header("Content-Length: $size");
92-
}
89+
$size = ob_get_length();
90+
header("Connection: close\r\n");
91+
//header("Content-Encoding: none\r\n");
92+
header("Content-Length: $size");
93+
}
9394
ob_end_flush();
94-
flush();
95-
foreach ($this->callbacks as $arguments) {
96-
$callback = array_shift($arguments);
97-
try {
98-
call_user_func_array($callback, $arguments);
99-
} catch (Exception $e) {
100-
AJXP_Logger::error(__CLASS__, __FUNCTION__, array("context"=>"Applying hook ".get_class($callback[0])."::".$callback[1], "message" => $e->getMessage()));
101-
}
102-
}
103-
}
95+
flush();
96+
$index = 0;
97+
while (count($this->callbacks)) {
98+
$arguments = array_shift($this->callbacks);
99+
$callback = array_shift($arguments);
100+
try {
101+
call_user_func_array($callback, $arguments);
102+
} catch (\Exception $e) {
103+
AJXP_Logger::error(__CLASS__, __FUNCTION__, array("context" => "Applying hook " . get_class($callback[0]) . "::" . $callback[1], "message" => $e->getMessage()));
104+
}
105+
$index++;
106+
if($index > 200) {
107+
AJXP_Logger::error(__CLASS__, __FUNCTION__, "Breaking ShutdownScheduler loop, seems too big (200)");
108+
break;
109+
}
110+
}
111+
}
112+
104113
}

core/src/core/classes/class.AuthService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ public static function checkBruteForceLogin(&$loginArray)
195195
{
196196
if (isSet($_SERVER['REMOTE_ADDR'])) {
197197
$serverAddress = $_SERVER['REMOTE_ADDR'];
198-
} else {
198+
} else if(isSet($_SERVER['SERVER_ADDR'])) {
199199
$serverAddress = $_SERVER['SERVER_ADDR'];
200+
} else {
201+
return TRUE;
200202
}
201203
$login = null;
202204
if (isSet($loginArray[$serverAddress])) {

core/src/core/classes/class.UserSelection.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function initFromNodes($nodes)
9090
$this->files = array();
9191
$this->inZip = false;
9292
foreach ($nodes as $n) {
93-
$this->files[] = $n->getPath();
93+
$this->addFile($n->getPath());
9494
}
9595

9696
}
@@ -110,7 +110,7 @@ public function initFromArray($array)
110110
if(strpos($v, "base64encoded:") === 0){
111111
$v = base64_decode(array_pop(explode(':', $v, 2)));
112112
}
113-
$this->files[] = AJXP_Utils::decodeSecureMagic($v);
113+
$this->addFile(AJXP_Utils::decodeSecureMagic($v));
114114
$this->isUnique = true;
115115
//return ;
116116
}
@@ -121,7 +121,7 @@ public function initFromArray($array)
121121
if(strpos($v, "base64encoded:") === 0){
122122
$v = base64_decode(array_pop(explode(':', $v, 2)));
123123
}
124-
$this->files[] = AJXP_Utils::decodeSecureMagic($v);
124+
$this->addFile(AJXP_Utils::decodeSecureMagic($v));
125125
$index ++;
126126
}
127127
$this->isUnique = false;
@@ -133,7 +133,7 @@ public function initFromArray($array)
133133
if (isSet($array["nodes"]) && is_array($array["nodes"])) {
134134
$this->files = array();
135135
foreach($array["nodes"] as $value){
136-
$this->files[] = AJXP_Utils::decodeSecureMagic($value);
136+
$this->addFile(AJXP_Utils::decodeSecureMagic($value));
137137
}
138138
$this->isUnique = count($this->files) == 1;
139139
}
@@ -152,6 +152,18 @@ public function initFromArray($array)
152152
}
153153
}
154154
}
155+
156+
/**
157+
* Add file to selection
158+
* @param string $filePath
159+
*/
160+
public function addFile($filePath){
161+
if(!in_array($filePath, $this->files)){
162+
$this->files[] = $filePath;
163+
}
164+
}
165+
166+
155167
/**
156168
* Does the selection have one or more items
157169
* @return bool
@@ -318,9 +330,5 @@ public function removeFile($file){
318330
$this->nodes = $newNodes;
319331
}
320332
}
321-
322-
public function addFile($file){
323-
$this->files[] = $file;
324-
}
325-
333+
326334
}

core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ public function switchAction($action, $httpVars, $fileVars)
20322032
echo("<param name=\"AJXP_PLUGIN_ENABLED\" value=\"".($ajxpPlugin->isEnabled()?"true":"false")."\"/>");
20332033
}
20342034
echo("</plugin_settings_values>");
2035-
echo("<plugin_doc><![CDATA[<p>".$ajxpPlugin->getPluginInformationHTML("Charles du Jeu", "https://pydio.com/en/docs/references/plugins")."</p>");
2035+
echo("<plugin_doc><![CDATA[<p>".$ajxpPlugin->getPluginInformationHTML("Charles du Jeu", "https://pydio.com/en/docs/references/plugins/")."</p>");
20362036
if (file_exists($ajxpPlugin->getBaseDir()."/plugin_doc.html")) {
20372037
echo(file_get_contents($ajxpPlugin->getBaseDir()."/plugin_doc.html"));
20382038
}

core/src/plugins/access.fs/fsActions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
accessKey="folder_access_key">
77
<context selection="true" dir="" recycle="false"
88
actionBar="true" actionBarGroup="put" contextMenu="true" infoPanel="true"/>
9-
<selectionContext dir="true" file="true" recycle="false"
9+
<selectionContext dir="true" file="true" recycle="false" enableRoot="true"
1010
unique="true" allowedMimes="ajxp_folder,AJXP_MIMES_ZIP" behaviour="hidden">
1111
</selectionContext>
1212
</gui>

core/src/plugins/access.s3/class.pydioS3Client.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,21 @@
2424
use Aws\S3\StreamWrapper;
2525
require_once __DIR__ . DIRECTORY_SEPARATOR . "class.s3CacheService.php";
2626
defined('AJXP_EXEC') or die( 'Access not allowed');
27+
28+
/**
29+
* Class S3Client
30+
* @package AccessS3
31+
*/
2732
class S3Client extends AwsS3Client
2833
{
2934
/**
3035
* Register a new stream wrapper who overwrite the Amazon S3 stream wrapper with this client instance.
36+
* @param string $repositoryId
37+
* @return $this|void
3138
*/
32-
public function registerStreamWrapper()
39+
public function registerStreamWrapper($repositoryId)
3340
{
3441
/* S3Client + s3 protocol + cacheInterface */
35-
StreamWrapper::register($this, "s3", new s3CacheService());
42+
StreamWrapper::register($this, "s3.".$repositoryId, new s3CacheService());
3643
}
3744
}

core/src/plugins/access.s3/class.s3AccessDriver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function performChecks()
5252
* Override parent to register underlying wrapper (s3) as well
5353
*/
5454
public function detectStreamWrapper($register = false){
55-
55+
/*
5656
if(isSet($this->repository)){
5757
require_once("aws.phar");
5858
$options = array(
@@ -99,6 +99,7 @@ public function detectStreamWrapper($register = false){
9999
100100
$this->s3Client->registerStreamWrapper();
101101
}
102+
*/
102103
return parent::detectStreamWrapper($register);
103104
}
104105

0 commit comments

Comments
 (0)