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

Commit 85bbb1f

Browse files
committed
Merge branch 'develop'
2 parents af9c59f + e265d40 commit 85bbb1f

File tree

10 files changed

+41
-18
lines changed

10 files changed

+41
-18
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ public static function updateDefaultRights(&$userObject)
632632
{
633633
if (!$userObject->hasParent()) {
634634
$changes = false;
635-
$repoList = ConfService::getRepositoriesList();
635+
$repoList = ConfService::getRepositoriesList("all");
636636
foreach ($repoList as $repositoryId => $repoObject) {
637637
if(!self::allowedForCurrentGroup($repoObject, $userObject)) continue;
638638
if($repoObject->isTemplate) continue;

core/src/core/classes/class.ConfService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ public function switchRootDirInst($rootDirIndex=-1, $temporary=false)
350350
* See instance method
351351
* @static
352352
* @param String $scope "user" or "all"
353+
* @param bool $includeShared
353354
* @return Repository[]
354355
*/
355356
public static function getRepositoriesList($scope = "user", $includeShared = true)

core/src/core/classes/class.HTMLWriter.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ public static function javascriptErrorHandler($errorType, $errorMessage)
148148
die("<script language='javascript'>parent.ajaxplorer.displayMessage('ERROR', '".str_replace("'", "\'", $errorMessage)."');</script>");
149149
}
150150

151+
public static function encodeAttachmentName($name){
152+
if (preg_match('/ MSIE /',$_SERVER['HTTP_USER_AGENT'])
153+
|| preg_match('/ WebKit /',$_SERVER['HTTP_USER_AGENT'])
154+
|| preg_match('/ Trident/',$_SERVER['HTTP_USER_AGENT'])) {
155+
$name = str_replace("+", " ", urlencode(SystemTextEncoding::toUTF8($name)));
156+
}
157+
return $name;
158+
}
159+
151160
/**
152161
* @static
153162
* @param string $attachmentName
@@ -157,9 +166,7 @@ public static function javascriptErrorHandler($errorType, $errorMessage)
157166
*/
158167
public static function generateAttachmentsHeader(&$attachmentName, $dataSize, $isFile=true, $gzip=false)
159168
{
160-
if (preg_match('/ MSIE /',$_SERVER['HTTP_USER_AGENT']) || preg_match('/ WebKit /',$_SERVER['HTTP_USER_AGENT'])) {
161-
$attachmentName = str_replace("+", " ", urlencode(SystemTextEncoding::toUTF8($attachmentName)));
162-
}
169+
$attachmentName = self::encodeAttachmentName($attachmentName);
163170

164171
header("Content-Type: application/force-download; name=\"".$attachmentName."\"");
165172
header("Content-Transfer-Encoding: binary");
@@ -197,6 +204,8 @@ public static function generateAttachmentsHeader(&$attachmentName, $dataSize, $i
197204

198205
public static function generateInlineHeaders($attachName, $fileSize, $mimeType)
199206
{
207+
$attachName = self::encodeAttachmentName($attachName);
208+
200209
//Send headers
201210
header("Content-Type: " . $mimeType . "; name=\"" . $attachName . "\"");
202211
header("Content-Disposition: inline; filename=\"" . $attachName . "\"");

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,10 @@ public function switchAction($action, $httpVars, $fileVars)
11261126
case "get_templates_definition":
11271127

11281128
AJXP_XMLWriter::header("repository_templates");
1129-
$repositories = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array(
1129+
$count = 0;
1130+
$repositories = ConfService::listRepositoriesWithCriteria(array(
11301131
"isTemplate" => '1'
1131-
));
1132+
), $count);
11321133
foreach ($repositories as $repo) {
11331134
if(!$repo->isTemplate) continue;
11341135
$repoId = $repo->getUniqueId();
@@ -2035,7 +2036,8 @@ public function listRoles($root, $child, $hashValue = null, $returnNodes = false
20352036
//if(strpos($roleId, "AJXP_GRP_") === 0 && !$this->listSpecialRoles) continue;
20362037
$r = array();
20372038
if(!AuthService::canAdministrate($roleObject)) continue;
2038-
$repos = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array("role" => $roleObject));
2039+
$count = 0;
2040+
$repos = ConfService::listRepositoriesWithCriteria(array("role" => $roleObject), $count);
20392041
foreach ($repos as $repoId => $repository) {
20402042
if($repository->getAccessType() == "ajxp_shared") continue;
20412043
if(!$roleObject->canRead($repoId) && !$roleObject->canWrite($repoId)) continue;

core/src/plugins/access.ajxp_user/class.UserDashboardDriver.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,10 @@ public function listUsers()
284284
$loggedUser = AuthService::getLoggedUser();
285285
$users = ConfService::getConfStorageImpl()->getUserChildren($loggedUser->getId()); // AuthService::listUsers();
286286
$mess = ConfService::getMessages();
287-
$repoList = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array(
287+
$count = 0;
288+
$repoList = ConfService::listRepositoriesWithCriteria(array(
288289
"owner_user_id" => $loggedUser->getId()
289-
));
290+
), $count);
290291
$userArray = array();
291292
foreach ($users as $userIndex => $userObject) {
292293
$label = $userObject->getId();
@@ -330,9 +331,10 @@ public function listRepositories()
330331
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/><column messageId="user_dash.9" attributeName="parent_label" sortType="String"/><column messageId="user_dash.9" attributeName="repo_accesses" sortType="String"/></columns>');
331332
$repoArray = array();
332333
$loggedUser = AuthService::getLoggedUser();
333-
$repos = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array(
334+
$count = 0;
335+
$repos = ConfService::listRepositoriesWithCriteria(array(
334336
"owner_user_id" => $loggedUser->getId()
335-
));
337+
), $count);
336338

337339
$searchAll = ConfService::getCoreConf("CROSSUSERS_ALLGROUPS", "conf");
338340
$displayAll = ConfService::getCoreConf("CROSSUSERS_ALLGROUPS_DISPLAY", "conf");

core/src/plugins/action.scheduler/class.AjxpScheduler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function parseSpecificContributions(&$contribNode)
7878
if(!$paramList->length) return;
7979
$paramNode = $paramList->item(0);
8080
$sVals = array();
81-
$repos = ConfService::getRepositoriesList();
81+
$repos = ConfService::getRepositoriesList("all");
8282
foreach ($repos as $repoId => $repoObject) {
8383
$sVals[] = $repoId."|". AJXP_Utils::xmlEntities($repoObject->getDisplay());
8484
}
@@ -189,7 +189,7 @@ public function runTask($taskId, $status = null, &$currentlyRunning = -1, $force
189189
$data["user_id"] = "queue:".$tmpQueue;
190190
}
191191
if ($data["repository_id"] == "*") {
192-
$data["repository_id"] = implode(",", array_keys(ConfService::getRepositoriesList()));
192+
$data["repository_id"] = implode(",", array_keys(ConfService::getRepositoriesList("all")));
193193
}
194194
$process = AJXP_Controller::applyActionInBackground(
195195
$data["repository_id"],

core/src/plugins/action.share/class.ShareCenter.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,14 @@ public function buildPublicDlURL()
942942
{
943943
$downloadFolder = ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER");
944944
$dlURL = ConfService::getCoreConf("PUBLIC_DOWNLOAD_URL");
945-
if ($dlURL != "") {
946-
return rtrim($dlURL, "/");
945+
if (!empty($dlURL)) {
946+
$parts = parse_url($dlURL);
947+
if($parts['scheme']) {
948+
return rtrim($dlURL, "/");
949+
} else {
950+
$host = AJXP_Utils::detectServerURL();
951+
return rtrim($host, "/")."/".trim($dlURL, "/");
952+
}
947953
} else {
948954
$fullUrl = AJXP_Utils::detectServerURL(true);
949955
return str_replace("\\", "/", rtrim($fullUrl, "/").rtrim(str_replace(AJXP_INSTALL_PATH, "", $downloadFolder), "/"));

core/src/plugins/core.ajaxplorer/manifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
<global_param name="DEFAULT_LANGUAGE" group="CONF_MESSAGE[Main]" type="select" choices="AJXP_AVAILABLE_LANGUAGES" label="CONF_MESSAGE[Default Language]" description="CONF_MESSAGE[Default language when a user does not have set his/her own.]" mandatory="true" default="en"/>
2121
<global_param name="SERVER_URL" group="CONF_MESSAGE[Main]" type="string" label="CONF_MESSAGE[Server URL]" description="CONF_MESSAGE[Server URL used to build share links and notifications. It will be detected if empty.]" mandatory="false"/>
2222
<global_param name="PUBLIC_DOWNLOAD_FOLDER" group="CONF_MESSAGE[Sharing]" type="string" label="CONF_MESSAGE[Download Folder]" description="CONF_MESSAGE[Absolute path to the public folder where temporary download links will be created. Setting this empty will disable the sharing feature.]" mandatory="false" default="AJXP_INSTALL_PATH/data/public"/>
23-
<global_param name="PUBLIC_DOWNLOAD_URL" group="CONF_MESSAGE[Sharing]" type="string" label="CONF_MESSAGE[Download URL]" description="CONF_MESSAGE[If not inferred directly from the current ajaxplorer URI plus the public download folder name, replace the public access URL here.]" mandatory="false" default=""/>
23+
<!-- MAKE SURE NOT TO CHANGE ORDER OF name AND default ATTRIBUTES, CAN BE REPLACED BY INSTALLERS -->
24+
<global_param name="PUBLIC_DOWNLOAD_URL" default="" group="CONF_MESSAGE[Sharing]" type="string" label="CONF_MESSAGE[Download URL]" description="CONF_MESSAGE[If not inferred directly from the current ajaxplorer URI plus the public download folder name, replace the public access URL here.]" mandatory="false"/>
2425
<global_param name="WEBDAV_ENABLE" group="CONF_MESSAGE[WebDAV Server]" type="boolean" label="CONF_MESSAGE[Enable WebDAV]" description="CONF_MESSAGE[Enable the webDAV support. Please READ THE DOC to safely use this feature.]" mandatory="false" default="false"/>
2526
<global_param name="WEBDAV_BASEURI" group="CONF_MESSAGE[WebDAV Server]" type="string" label="CONF_MESSAGE[Shares URI]" description="CONF_MESSAGE[Common URI to access the shares. Please READ THE DOC to safely use this feature.]" mandatory="false" default="/ajaxplorer/shares"/>
2627
<global_param name="WEBDAV_BASEHOST" group="CONF_MESSAGE[WebDAV Server]" type="string" label="CONF_MESSAGE[Shares Host]" description="CONF_MESSAGE[Host used in webDAV protocol. Should be detected by default. Please READ THE DOC to safely use this feature.]" mandatory="false" default=""/>

core/src/plugins/core.conf/class.AbstractConfDriver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,10 @@ public function switchAction($action, $httpVars, $fileVars)
940940
case "get_user_templates_definition":
941941

942942
AJXP_XMLWriter::header("repository_templates");
943-
$repositories = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array(
943+
$count = 0;
944+
$repositories = ConfService::listRepositoriesWithCriteria(array(
944945
"isTemplate" => 1
945-
));
946+
), $count);
946947
$pServ = AJXP_PluginsService::getInstance();
947948
foreach ($repositories as $repo) {
948949
if(!$repo->isTemplate) continue;

dist/rpm/pydio.spec.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ sed -i 's/\/\/ define("AJXP_FORCE_LOGPATH/define("AJXP_FORCE_LOGPATH/g' conf/boo
3535

3636
# Update Share URL
3737
sed -i 's/"AJXP_INSTALL_PATH\/data\/public"/"\/var\/lib\/pydio\/public"/g' plugins/core.ajaxplorer/manifest.xml
38+
sed -i 's/name="PUBLIC_DOWNLOAD_URL" default=""/name="PUBLIC_DOWNLOAD_URL" default="\/pydio_public"/g' plugins/core.ajaxplorer/manifest.xml
3839

3940
%build
4041

0 commit comments

Comments
 (0)