From 08ba5172e025cf2a2aa41e4f34571bfe30b19bfa Mon Sep 17 00:00:00 2001 From: cdujeu Date: Fri, 18 Nov 2016 17:44:23 +0100 Subject: [PATCH 01/11] Fix Imap & EML plugins - Warning php7 requires Mail_mimeDecode 1.5.6 - Fix #1282 --- .../plugins/access.imap/ImapAccessDriver.php | 17 ++++++ .../plugins/access.imap/ImapAccessWrapper.php | 5 +- core/src/plugins/editor.eml/EmlParser.php | 59 +++++++++++-------- 3 files changed, 52 insertions(+), 29 deletions(-) diff --git a/core/src/plugins/access.imap/ImapAccessDriver.php b/core/src/plugins/access.imap/ImapAccessDriver.php index fff0c6e9cc..7413ca0a2d 100644 --- a/core/src/plugins/access.imap/ImapAccessDriver.php +++ b/core/src/plugins/access.imap/ImapAccessDriver.php @@ -71,11 +71,21 @@ public function performChecks() } } + /** + * @param $st1 + * @param $st2 + * @return int + */ public static function inverseSort($st1, $st2) { return strnatcasecmp($st2, $st1); } + /** + * @param $st1 + * @param $st2 + * @return int + */ public static function sortInboxFirst($st1, $st2) { if($st1 == "INBOX") return -1; @@ -83,6 +93,13 @@ public static function sortInboxFirst($st1, $st2) return strcmp($st1, $st2); } + /** + * @param ServerRequestInterface $request + * @param ResponseInterface $response + * @throws PydioException + * @throws \Exception + * @throws \Pydio\Access\Core\Exception\FileNotWriteableException + */ public function switchAction(ServerRequestInterface &$request, ResponseInterface &$response) { if ($request->getAttribute("action") == "ls") { diff --git a/core/src/plugins/access.imap/ImapAccessWrapper.php b/core/src/plugins/access.imap/ImapAccessWrapper.php index 646ad77cc4..35e6dcfd8b 100644 --- a/core/src/plugins/access.imap/ImapAccessWrapper.php +++ b/core/src/plugins/access.imap/ImapAccessWrapper.php @@ -20,7 +20,7 @@ */ namespace Pydio\Access\Driver\StreamProvider\Imap; -use EmlParser; +use Pydio\Editor\EML\EmlParser; use Pydio\Access\Core\IAjxpWrapper; use Pydio\Access\Core\Model\AJXP_Node; @@ -133,7 +133,6 @@ public function stream_open($path, $mode, $options, &$opened_path) $attachmentId = array_pop($ar); $this->currentAttachmentData = array("realPath" => $mailPath, "attachmentId" => $attachmentId); // EXTRACT ATTACHMENT AND RETURN - require_once AJXP_INSTALL_PATH."/plugins/editor.eml/class.EmlParser.php"; $emlParser = new EmlParser("", ""); $attachMeta = array(); $this->data = $emlParser->getAttachmentBody( @@ -212,7 +211,6 @@ public function stream_read($count) if (empty($this->data)) { Logger::debug(__CLASS__,__FUNCTION__,"Attachement", $this->currentAttachmentData); // EXTRACT ATTACHMENT AND RETURN - require_once AJXP_INSTALL_PATH."/plugins/editor.eml/class.EmlParser.php"; $emlParser = new EmlParser("", ""); $attachMeta = array(); $this->data = $emlParser->getAttachmentBody( @@ -309,7 +307,6 @@ public function dir_opendir($path, $options) self::$currentCount = count($this->mailboxes); $this->pos = $this->dir - 1; } else if ($this->fragment == "attachments") { - require_once AJXP_INSTALL_PATH.'/plugins/editor.eml/class.EmlParser.php'; $parser = new EmlParser("", ""); $ar = explode("#", $path); $path = array_shift($ar);// remove fragment diff --git a/core/src/plugins/editor.eml/EmlParser.php b/core/src/plugins/editor.eml/EmlParser.php index 70add2e789..a2f57ac893 100644 --- a/core/src/plugins/editor.eml/EmlParser.php +++ b/core/src/plugins/editor.eml/EmlParser.php @@ -23,6 +23,7 @@ use Pydio\Access\Core\MetaStreamWrapper; use Pydio\Access\Core\Model\AJXP_Node; use Pydio\Access\Core\Model\UserSelection; +use Pydio\Core\Http\Message\UserMessage; use Pydio\Core\Model\ContextInterface; use Pydio\Core\Services\LocalCache; @@ -78,7 +79,7 @@ public function switchAction(\Psr\Http\Message\ServerRequestInterface $requestIn $file = $node->getUrl(); Controller::applyHook("node.read", array($node)); - $wrapperClassName = MetaStreamWrapper::actualRepositoryWrapperClass($node); + $wrapperIsImap = $this->wrapperIsImap($node); $mess = LocaleService::getMessages(); switch ($action) { @@ -88,7 +89,7 @@ public function switchAction(\Psr\Http\Message\ServerRequestInterface $requestIn 'decode_bodies' => false, 'decode_headers' => 'UTF-8' ); - $decoder = $this->getStructureDecoder($file, ($wrapperClassName == "imapAccessWrapper")); + $decoder = $this->getStructureDecoder($file, $wrapperIsImap); $xml = $decoder->getXML($decoder->decode($params)); $doc = new \Pydio\Core\Http\Message\XMLDocMessage($xml); if (function_exists("imap_mime_header_decode")) { @@ -122,8 +123,8 @@ public function switchAction(\Psr\Http\Message\ServerRequestInterface $requestIn 'decode_bodies' => true, 'decode_headers' => false ); - if ($wrapperClassName == "imapAccessWrapper") { - $cache = LocalCache::getItem("eml_remote", $file, null, array("EmlParser", "computeCacheId")); + if ($wrapperIsImap) { + $cache = LocalCache::getItem("eml_remote", $file, null, array($this, "computeCacheId")); $content = $cache->getData(); } else { $content = file_get_contents($file); @@ -153,8 +154,8 @@ public function switchAction(\Psr\Http\Message\ServerRequestInterface $requestIn 'decode_bodies' => true, 'decode_headers' => false ); - if ($wrapperClassName == "imapAccessWrapper") { - $cache = LocalCache::getItem("eml_remote", $file, null, array("EmlParser", "computeCacheId")); + if ($wrapperIsImap) { + $cache = LocalCache::getItem("eml_remote", $file, null, array($this, "computeCacheId")); $content = $cache->getData(); } else { $content = file_get_contents($file); @@ -183,8 +184,8 @@ public function switchAction(\Psr\Http\Message\ServerRequestInterface $requestIn 'decode_bodies' => true, 'decode_headers' => false ); - if ($wrapperClassName == "imapAccessWrapper") { - $cache = LocalCache::getItem("eml_remote", $file, null, array("EmlParser", "computeCacheId")); + if ($wrapperIsImap) { + $cache = LocalCache::getItem("eml_remote", $file, null, array($this, "computeCacheId")); $content = $cache->getData(); } else { $content = file_get_contents($file); @@ -210,12 +211,12 @@ public function switchAction(\Psr\Http\Message\ServerRequestInterface $requestIn if ($fp !== false) { fwrite($fp, $part->body, strlen($part->body)); fclose($fp); - $x->addChunk(new \Pydio\Core\Http\Message\UserMessage(sprintf($mess["editor.eml.7"], $part->d_parameters["filename"], $destRep))); + $x->addChunk(new UserMessage(sprintf($mess["editor.eml.7"], $part->d_parameters["filename"], $destRep))); } else { - $x->addChunk(new \Pydio\Core\Http\Message\UserMessage($mess["editor.eml.8"], LOG_LEVEL_ERROR)); + $x->addChunk(new UserMessage($mess["editor.eml.8"], LOG_LEVEL_ERROR)); } } else { - $x->addChunk(new \Pydio\Core\Http\Message\UserMessage($mess["editor.eml.9"], LOG_LEVEL_ERROR)); + $x->addChunk(new UserMessage($mess["editor.eml.9"], LOG_LEVEL_ERROR)); } break; @@ -233,13 +234,13 @@ public function extractMimeHeaders(&$ajxpNode, $isParent = false) if($isParent) return; $currentNode = $ajxpNode->getUrl(); $metadata = $ajxpNode->metadata; - $wrapperClassName = MetaStreamWrapper::actualRepositoryWrapperClass($ajxpNode); + $wrapperIsImap = $this->wrapperIsImap($ajxpNode); $noMail = true; - if ($metadata["is_file"] && ($wrapperClassName == "imapAccessWrapper" || preg_match("/\.eml$/i",$currentNode))) { + if ($metadata["is_file"] && ($wrapperIsImap || preg_match("/\.eml$/i",$currentNode))) { $noMail = false; } - if ($wrapperClassName == "imapAccessWrapper" && !$metadata["is_file"]) { + if ($wrapperIsImap && !$metadata["is_file"]) { $metadata["mimestring"] = "Mailbox"; } $parsed = UrlUtils::mbParseUrl($currentNode); @@ -250,8 +251,8 @@ public function extractMimeHeaders(&$ajxpNode, $isParent = false) if (EmlParser::$currentListingOnlyEmails === NULL) { EmlParser::$currentListingOnlyEmails = true; } - if ($wrapperClassName == "imapAccessWrapper") { - $cachedFile = LocalCache::getItem("eml_remote", $currentNode, null, array("EmlParser", "computeCacheId")); + if ($wrapperIsImap) { + $cachedFile = LocalCache::getItem("eml_remote", $currentNode, null, array($this, "computeCacheId")); $realFile = $cachedFile->getId(); if (!is_file($realFile)) { $cachedFile->getData();// trigger loading! @@ -264,13 +265,23 @@ public function extractMimeHeaders(&$ajxpNode, $isParent = false) $data["ajxp_mime"] = "eml"; $data["mimestring"] = "Email"; $metadata = array_merge($metadata, $data); - if ($wrapperClassName == "imapAccessWrapper" && $metadata["eml_attachments"]!= "0" && (strpos($_SERVER["HTTP_USER_AGENT"], "ajaxplorer-ios") !== false)) { + if ($wrapperIsImap && $metadata["eml_attachments"]!= "0" && (strpos($_SERVER["HTTP_USER_AGENT"], "ajaxplorer-ios") !== false)) { $metadata["is_file"] = false; $metadata["nodeName"] = basename($currentNode)."#attachments"; } $ajxpNode->metadata = $metadata; } + /** + * @param AJXP_Node $node + * @return bool + */ + protected function wrapperIsImap($node){ + $refClassName = "Pydio\\Access\\Driver\\StreamProvider\\Imap\\ImapAccessWrapper"; + $wrapperClassName = MetaStreamWrapper::actualRepositoryWrapperClass($node); + return $wrapperClassName === $refClassName; + } + /** * @param $masterFile * @param $targetFile @@ -328,15 +339,13 @@ public function mimeExtractorCallback($masterFile, $targetFile) public function lsPostProcess(\Psr\Http\Message\ServerRequestInterface $requestInterface, \Psr\Http\Message\ResponseInterface &$responseInterface) { if (!EmlParser::$currentListingOnlyEmails) { - header('Content-Type: text/xml; charset=UTF-8'); - header('Cache-Control: no-cache'); return $responseInterface; } $config = ' - + + - @@ -363,7 +372,7 @@ public function lsPostProcess(\Psr\Http\Message\ServerRequestInterface $requestI } $index ++; } else { - $text = $child->getAttribute("eml_from"); + $text = $child->getAttribute("eml_subject"); } $child->setAttribute("text", $text); $child->setAttribute("ajxp_modiftime", $child->getAttribute("eml_time")); @@ -377,7 +386,7 @@ public function lsPostProcess(\Psr\Http\Message\ServerRequestInterface $requestI $imported = $dom->importNode($insert->documentElement, true); $dom->documentElement->appendChild($imported); $responseInterface = new \Zend\Diactoros\Response(); - $responseInterface = $responseInterface->withHeader("ContentType", "text/xml"); + $responseInterface = $responseInterface->withHeader("Content-Type", "text/xml"); $responseInterface = $responseInterface->withHeader("Cache-Control", "no-cache"); $responseInterface->getBody()->write($dom->saveXML()); return $responseInterface; @@ -394,7 +403,7 @@ public function getStructureDecoder($file, $cacheRemoteContent = false) { require_once ("Mail/mimeDecode.php"); if ($cacheRemoteContent) { - $cache = LocalCache::getItem ( "eml_remote", $file , null, array("EmlParser", "computeCacheId")); + $cache = LocalCache::getItem ( "eml_remote", $file , null, array($this, "computeCacheId")); $content = $cache->getData (); } else { $content = file_get_contents ( $file ); @@ -522,7 +531,7 @@ protected function _findAttachmentById($structure, $attachId) * @param $mailPath * @return string */ - public static function computeCacheId($mailPath) + public function computeCacheId($mailPath) { $header = file_get_contents($mailPath."#header"); //$this->logDebug("Headers ", $header); From b9ed5a7b84dba20cb0fe25b0481b2128dbca5e3b Mon Sep 17 00:00:00 2001 From: cdujeu Date: Sat, 19 Nov 2016 17:17:21 +0100 Subject: [PATCH 02/11] Fix #1288 --- core/src/plugins/action.scheduler/src/Scheduler.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/plugins/action.scheduler/src/Scheduler.php b/core/src/plugins/action.scheduler/src/Scheduler.php index 91a7e562de..c347870ece 100644 --- a/core/src/plugins/action.scheduler/src/Scheduler.php +++ b/core/src/plugins/action.scheduler/src/Scheduler.php @@ -326,8 +326,11 @@ public function handleTasks(ServerRequestInterface $requestInterface, ResponseIn $task = TaskService::getInstance()->getTaskById(InputFilter::sanitize($httpVars["task_id"], InputFilter::SANITIZE_ALPHANUM)); if($task !== null){ $children = $task->getChildrenTasks(); - if(!empty($children)){ - throw new PydioException("This task has currently jobs running, please wait that they are finished"); + foreach ($children as $child){ + if($child->getStatus() === Task::STATUS_RUNNING){ + throw new PydioException("This task has currently jobs running, please wait that they are finished"); + } + TaskService::getInstance()->deleteTask($child->getId()); } TaskService::getInstance()->deleteTask($task->getId()); } From 1a694236832a2524823e9cd57e19c9a6337b53f0 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Sat, 19 Nov 2016 17:54:01 +0100 Subject: [PATCH 03/11] Rewire ALLOWED_EXTENSIONS configs - Fix #1283 --- .../plugins/uploader.html/js/react/UploaderModel.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/plugins/uploader.html/js/react/UploaderModel.js b/core/src/plugins/uploader.html/js/react/UploaderModel.js index 507547b212..7dfd0d429f 100644 --- a/core/src/plugins/uploader.html/js/react/UploaderModel.js +++ b/core/src/plugins/uploader.html/js/react/UploaderModel.js @@ -143,12 +143,14 @@ let bytesLoaded = computableEvent.loaded; this.setProgress(percentage, bytesLoaded); }.bind(this); + this.setStatus('loading'); let maxUpload = parseFloat(UploaderConfigs.getInstance().getOption('UPLOAD_MAX_SIZE')); let queryString; try{ + UploaderConfigs.getInstance().extensionAllowed(this); queryString = this.buildQueryString(); }catch(e){ this.onError(e.message); @@ -589,6 +591,17 @@ } } + extensionAllowed(uploadItem){ + let extString = this.getOption("ALLOWED_EXTENSIONS", '', ''); + if(!extString) return true; + let extDescription = this.getOption("ALLOWED_EXTENSIONS_READABLE", '', ''); + if(extDescription) extDescription = ' (' + extDescription + ')'; + let itemExt = PathUtils.getFileExtension(uploadItem.getLabel()); + if(extString.split(',').indexOf(itemExt) === -1){ + throw new Error(global.pydio.MessageHash[367] + extString + extDescription); + } + } + getOptionAsBool(name, userPref = '', defaultValue = undefined){ let o = this.getOption(name, userPref, defaultValue); return (o === true || o === 'true'); From 61e90bc5e2b2cfdf9c2e6ecb39deb63173e62b77 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Sat, 19 Nov 2016 19:28:02 +0100 Subject: [PATCH 04/11] Fix SMB access driver and custom smbclient path. Close #1290 --- .../plugins/access.smb/SMBAccessDriver.php | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/core/src/plugins/access.smb/SMBAccessDriver.php b/core/src/plugins/access.smb/SMBAccessDriver.php index 702523110f..1fbe06e8ee 100644 --- a/core/src/plugins/access.smb/SMBAccessDriver.php +++ b/core/src/plugins/access.smb/SMBAccessDriver.php @@ -22,12 +22,20 @@ namespace Pydio\Access\Driver\StreamProvider\SMB; use DOMNode; +use PclZip; +use Pydio\Access\Core\MetaStreamWrapper; use Pydio\Access\Core\Model\AJXP_Node; +use Pydio\Access\Core\Model\UserSelection; use Pydio\Access\Core\RecycleBinManager; use Pydio\Access\Core\Model\Repository; use Pydio\Access\Driver\StreamProvider\FS\FsAccessDriver; use Pydio\Core\Model\ContextInterface; use Pydio\Core\Exception\PydioException; +use Pydio\Core\Services\ConfService; +use Pydio\Core\Utils\TextEncoder; +use Pydio\Core\Utils\Vars\InputFilter; +use Pydio\Tasks\Task; +use Pydio\Tasks\TaskService; defined('AJXP_EXEC') or die( 'Access not allowed'); @@ -47,6 +55,16 @@ class SMBAccessDriver extends FsAccessDriver protected $wrapperClassName; protected $urlBase; + protected function loadExternalWrapper(){ + if(!empty($this->pluginConf['SMBCLIENT']) && !defined('SMB4PHP_SMBCLIENT')){ + define ('SMB4PHP_SMBCLIENT', $this->pluginConf["SMBCLIENT"]); + } + if(!empty($this->pluginConf['SMB_PATH_TMP']) && !defined('SMB_PATH_TMP')){ + define ('SMB4PHP_SMBTMP', $this->pluginConf["SMB_PATH_TMP"]); + } + require_once($this->getBaseDir()."/smb.php"); + } + /** * @param ContextInterface $contextInterface * @throws PydioException @@ -59,13 +77,7 @@ protected function initRepository(ContextInterface $contextInterface) } else { $this->driverConf = array(); } - $smbclientPath = $this->driverConf["SMBCLIENT"]; - define ('SMB4PHP_SMBCLIENT', $smbclientPath); - - $smbtmpPath = $this->driverConf["SMB_PATH_TMP"]; - define ('SMB4PHP_SMBTMP', $smbtmpPath); - - require_once($this->getBaseDir()."/smb.php"); + $this->loadExternalWrapper(); //$create = $this->repository->getOption("CREATE"); $recycle = $this->repository->getContextOption($contextInterface, "RECYCLE_BIN"); @@ -92,7 +104,7 @@ protected function initRepository(ContextInterface $contextInterface) public function detectStreamWrapper($register = false, ContextInterface $ctx = null) { if ($register) { - require_once($this->getBaseDir()."/smb.php"); + $this->loadExternalWrapper(); } return parent::detectStreamWrapper($register, $ctx); } From 5ea81c5e6eab04af0a07ee5b9d7186167ae5d32c Mon Sep 17 00:00:00 2001 From: cdujeu Date: Sat, 19 Nov 2016 19:30:01 +0100 Subject: [PATCH 05/11] Fix zip operation when child drivers are remote (inc. smb) - Fix #1287 Fix base detection for archive --- .../src/pydio/Core/Utils/Vars/PathUtils.php | 38 +++++++++++++++++++ core/src/plugins/access.fs/FsAccessDriver.php | 7 +++- .../core.access/src/Model/UserSelection.php | 9 +++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/core/src/core/src/pydio/Core/Utils/Vars/PathUtils.php b/core/src/core/src/pydio/Core/Utils/Vars/PathUtils.php index 92acea1103..2d6a3d9de3 100644 --- a/core/src/core/src/pydio/Core/Utils/Vars/PathUtils.php +++ b/core/src/core/src/pydio/Core/Utils/Vars/PathUtils.php @@ -73,5 +73,43 @@ public static function unPatchPathForBaseDir($dirPath) return str_replace("__ZIP_EXTENSION__", ".zip", $dirPath); } + /** + * Return highest common folder + * @param $items + * @return mixed + */ + public static function commonPath($items) + { + $arr = array(); + foreach($items as $i => $path) + { + $items[$i] = explode('/', $path); + unset($items[$i][0]); + + $arr[$i] = count($items[$i]); + } + + $min = min($arr); + + for($i = 0; $i < count($items); $i++) + { + while(count($items[$i]) > $min) + { + array_pop($items[$i]); + } + + $items[$i] = '/' . implode('/' , $items[$i]); + } + + $items = array_unique($items); + while(count($items) !== 1) + { + $items = array_map('dirname', $items); + $items = array_unique($items); + } + reset($items); + + return current($items); + } } \ No newline at end of file diff --git a/core/src/plugins/access.fs/FsAccessDriver.php b/core/src/plugins/access.fs/FsAccessDriver.php index 2f59be888b..2d21cf6ca6 100644 --- a/core/src/plugins/access.fs/FsAccessDriver.php +++ b/core/src/plugins/access.fs/FsAccessDriver.php @@ -650,6 +650,8 @@ public function downloadAction(ServerRequestInterface &$request, ResponseInterfa } else { if(isset($httpVars["dir"])){ $dir = InputFilter::decodeSecureMagic($httpVars["dir"], InputFilter::SANITIZE_DIRNAME); + }else{ + $dir = $selection->commonDirFromSelection(); } $base = basename(PathUtils::forwardSlashDirname($selection->getUniqueFile())); $zip = true; @@ -2391,7 +2393,8 @@ public function makeZip (UserSelection $selection, $dest, $basedir, $taskId = nu $filePaths = []; $selectedNodes = $selection->buildNodes(); foreach ($selectedNodes as $node) { - $realFile = $node->getRealFile(); + //$realFile = $node->getRealFile(); + $realFile = MetaStreamWrapper::getRealFSReference($node->getUrl()); if (basename($node->getPath()) == "") { $filePaths[] = [PCLZIP_ATT_FILE_NAME => $realFile]; } else { @@ -2427,7 +2430,7 @@ public function makeZip (UserSelection $selection, $dest, $basedir, $taskId = nu if($basedir == "__AJXP_ZIP_FLAT__/"){ $vList = $archive->create($filePaths, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_NO_COMPRESSION, PCLZIP_OPT_ADD_TEMP_FILE_ON, PCLZIP_CB_PRE_ADD, $preAddCallback); }else{ - $basedir = MetaStreamWrapper::getRealFSReference($selection->currentBaseUrl()).trim($basedir); + $basedir = rtrim(MetaStreamWrapper::getRealFSReference($selection->currentBaseUrl()), '/').trim($basedir); $this->logDebug("Basedir", [$basedir]); $vList = $archive->create($filePaths, PCLZIP_OPT_REMOVE_PATH, $basedir, PCLZIP_OPT_NO_COMPRESSION, PCLZIP_OPT_ADD_TEMP_FILE_ON, PCLZIP_CB_PRE_ADD, $preAddCallback); } diff --git a/core/src/plugins/core.access/src/Model/UserSelection.php b/core/src/plugins/core.access/src/Model/UserSelection.php index 979d33b917..e32210d789 100644 --- a/core/src/plugins/core.access/src/Model/UserSelection.php +++ b/core/src/plugins/core.access/src/Model/UserSelection.php @@ -330,6 +330,15 @@ public function buildNodes() } + /** + * Find common base path for current selection + * @return mixed + */ + public function commonDirFromSelection(){ + $items = array_values($this->files); + return PathUtils::commonPath($items); + } + /** * @return string * @throws \Exception From f49aa9032adc0754e510f98ac761e5fef69a8495 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Mon, 21 Nov 2016 10:02:30 +0100 Subject: [PATCH 06/11] Auth.ldap: add starttsl support. See #1248, should fix it. --- core/src/plugins/auth.ldap/LdapAuthDriver.php | 4 +++- core/src/plugins/auth.ldap/manifest.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/plugins/auth.ldap/LdapAuthDriver.php b/core/src/plugins/auth.ldap/LdapAuthDriver.php index d8b8a90a7a..dd410a289b 100644 --- a/core/src/plugins/auth.ldap/LdapAuthDriver.php +++ b/core/src/plugins/auth.ldap/LdapAuthDriver.php @@ -214,8 +214,10 @@ public function startConnexion() if ($this->ldapconn == null) { $this->logError(__FUNCTION__, 'LDAP Server connexion could NOT be established'); } + if ($this->ldapconn !== null && isSet($this->options["LDAP_PROTOCOL"]) && $this->options["LDAP_PROTOCOL"] === 'starttls') { + ldap_start_tls($this->ldapconn); + } } - //return $this->ldapconn; } public function __deconstruct() diff --git a/core/src/plugins/auth.ldap/manifest.xml b/core/src/plugins/auth.ldap/manifest.xml index 4b1c49ce66..13e833f969 100644 --- a/core/src/plugins/auth.ldap/manifest.xml +++ b/core/src/plugins/auth.ldap/manifest.xml @@ -12,7 +12,7 @@ - + From 72bf93932af927079f010b7d4f0c1b28e61e5c4e Mon Sep 17 00:00:00 2001 From: cdujeu Date: Mon, 21 Nov 2016 10:10:49 +0100 Subject: [PATCH 07/11] Manual merge of #1292 (put encoding call directly inside win-dedicated function. --- core/src/plugins/access.smb/smb.php | 48 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/core/src/plugins/access.smb/smb.php b/core/src/plugins/access.smb/smb.php index 06ebeabc52..cdc2fae2b9 100644 --- a/core/src/plugins/access.smb/smb.php +++ b/core/src/plugins/access.smb/smb.php @@ -22,6 +22,7 @@ ################################################################### namespace Pydio\Access\Driver\StreamProvider\SMB; +use Pydio\Core\Utils\TextEncoder; use Pydio\Log\Core\Logger; define ('SMB4PHP_VERSION', '0.8'); @@ -553,7 +554,7 @@ class smb_stream_wrapper extends smb { # variables - public $stream, $url, $parsed_url = array (), $mode, $tmpfile; + public $stream, $url, $parsed_url = array (), $mode, $tmpfile, $defer_stream_read; public $need_flush = FALSE; public $dir = array (), $dir_index = -1; @@ -648,7 +649,6 @@ public function stream_open ($url, $mode, $options, $opened_path) $url = smb::cleanUrl($url); $this->url = $url; $this->mode = $mode; - $this->defer_stream_read; $this->parsed_url = $pu = smb::parse_url($url); if ($pu['type'] <> 'path') trigger_error('stream_open(): error in URL', E_USER_ERROR); switch ($mode) { @@ -745,38 +745,36 @@ function ConvSmbParameterToWinOs($params) { $paramstemp = explode(" ", $params); - - // first command '-d' or '-L' ? - if ($paramstemp[0] == "-d") { - $count_params = count($paramstemp); + // first command '-d' or '-L' ? + if ($paramstemp[0] === '-d') { + + $count_params = count($paramstemp); // index command = 4; // index start path = 6; $paramstemp[6] = '""'.$paramstemp[6]; $type_cmd = substr($paramstemp[4], 1); switch ($type_cmd) { - case get: - case put: - case rename: - $index_end_path = $count_params - 2; - $paramstemp[$index_end_path] = $paramstemp[$index_end_path].'""'; - $new_params = implode(" ", $paramstemp); - $new_params = str_replace(' ', '"" ""', $new_params); - break; - - //Cmd: dir, del, rmdir, mkdir - default: - $index_end_path = $count_params - 2; - $paramstemp[$index_end_path] = $paramstemp[$index_end_path].'""'; - $new_params = implode(" ", $paramstemp); - } + case 'get': + case 'put': + case 'rename': + $index_end_path = $count_params - 2; + $paramstemp[$index_end_path] = $paramstemp[$index_end_path].'""'; + $new_params = implode(" ", $paramstemp); + $new_params = str_replace(' ', '"" ""', $new_params); + break; - return $new_params; - } - else { - return $params; + //Cmd: dir, del, rmdir, mkdir + default: + $index_end_path = $count_params - 2; + $paramstemp[$index_end_path] = $paramstemp[$index_end_path].'""'; + $new_params = implode(" ", $paramstemp); + } + $params = $new_params; } + + return TextEncoder::toStorageEncoding($params); } ################################################################### From c2f492623657852a09497c84147029394ea758b1 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Mon, 21 Nov 2016 11:15:15 +0100 Subject: [PATCH 08/11] Update trigger as mysql automatically pads varchars when comparing, creating a content instead of path in some case (trailing spaces). See #1253 --- core/src/plugins/meta.syncable/create.mysql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/plugins/meta.syncable/create.mysql b/core/src/plugins/meta.syncable/create.mysql index 26ad0403a0..62556af8ff 100644 --- a/core/src/plugins/meta.syncable/create.mysql +++ b/core/src/plugins/meta.syncable/create.mysql @@ -35,4 +35,4 @@ DROP TRIGGER IF EXISTS `LOG_UPDATE`; CREATE TRIGGER `LOG_UPDATE` AFTER UPDATE ON `ajxp_index` FOR EACH ROW INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) - VALUES (new.repository_identifier, new.node_id, old.node_path, new.node_path, CASE old.node_path COLLATE utf8_bin = new.node_path COLLATE utf8_bin WHEN true THEN 'content' ELSE 'path' END); + VALUES (new.repository_identifier, new.node_id, old.node_path, new.node_path, CASE LENGTH(new.node_path) = LENGTH(old.node_path) AND old.node_path COLLATE utf8_bin = new.node_path COLLATE utf8_bin WHEN true THEN 'content' ELSE 'path' END); From 1646efe8f10e906efdc8f8a842f3cdd01f113149 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Mon, 21 Nov 2016 11:48:11 +0100 Subject: [PATCH 09/11] i18n new prompt exception mechanism --- .../pydio/Core/Exception/PydioPromptException.php | 14 +++++++++----- .../pydio/Core/Exception/WorkspaceAuthRequired.php | 6 +++++- core/src/plugins/core.ajaxplorer/i18n/ca.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/cs.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/da.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/de.php | 5 ++++- core/src/plugins/core.ajaxplorer/i18n/en.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/es.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/et.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/eus.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/fi.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/fr.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/gr.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/he.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/hu.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/it.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/ja.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/kr.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/nl.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/no.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/pl.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/pt-br.php | 9 ++++++--- core/src/plugins/core.ajaxplorer/i18n/pt.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/ru.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/si.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/sv.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/tr.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/zh-tw.php | 3 +++ core/src/plugins/core.ajaxplorer/i18n/zh.php | 3 +++ 29 files changed, 99 insertions(+), 10 deletions(-) diff --git a/core/src/core/src/pydio/Core/Exception/PydioPromptException.php b/core/src/core/src/pydio/Core/Exception/PydioPromptException.php index 63579a4ee5..c0f108b433 100644 --- a/core/src/core/src/pydio/Core/Exception/PydioPromptException.php +++ b/core/src/core/src/pydio/Core/Exception/PydioPromptException.php @@ -23,6 +23,7 @@ use Pydio\Core\Http\Middleware\WorkspaceAuthMiddleware; use Pydio\Core\Http\Response\JSONSerializableResponseChunk; use Pydio\Core\Http\Response\XMLSerializableResponseChunk; +use Pydio\Core\Services\LocaleService; defined('AJXP_EXEC') or die( 'Access not allowed'); @@ -83,12 +84,15 @@ public function __construct($promptType, $data, $messageString, $messageId = fal * @return PydioPromptException */ public static function promptForWorkspaceCredentials($parameters, $postSubmitCallback = ""){ + $mess = LocaleService::getMessages(); $inputs = []; foreach($parameters as $key => $value){ if($key === WorkspaceAuthMiddleware::FORM_RESUBMIT_LOGIN) { - $inputs[] = ""; + $loginString = str_replace("'","\'", $mess['181']); + $inputs[] = ""; }else if($key === WorkspaceAuthMiddleware::FORM_RESUBMIT_PASS){ - $inputs[] = ""; + $passString = str_replace("'","\'", $mess['182']); + $inputs[] = ""; }else{ $inputs[] = ""; } @@ -97,8 +101,8 @@ public static function promptForWorkspaceCredentials($parameters, $postSubmitCal "confirm", array( "DIALOG" => "
-

Credentials Required

-
Please provide a password to enter this workspace.
+

".$mess['557']."

+
".$mess['558']."
".implode("\n", $inputs)."
@@ -112,7 +116,7 @@ public static function promptForWorkspaceCredentials($parameters, $postSubmitCal "EVAL" => "" ) ), - "Credentials Needed"); + $mess['557']); } diff --git a/core/src/core/src/pydio/Core/Exception/WorkspaceAuthRequired.php b/core/src/core/src/pydio/Core/Exception/WorkspaceAuthRequired.php index 9b9f61656e..f1a02b35ce 100644 --- a/core/src/core/src/pydio/Core/Exception/WorkspaceAuthRequired.php +++ b/core/src/core/src/pydio/Core/Exception/WorkspaceAuthRequired.php @@ -24,6 +24,7 @@ use Pydio\Auth\Core\MemorySafe; use Pydio\Core\Model\Context; use Pydio\Core\Model\UserInterface; +use Pydio\Core\Services\LocaleService; defined('AJXP_EXEC') or die('Access not allowed'); @@ -43,10 +44,13 @@ class WorkspaceAuthRequired extends PydioException { * @param boolean $requireLogin * @param string $message */ - public function __construct($workspaceId, $requireLogin = false, $message = "Authentication required for this workspace") + public function __construct($workspaceId, $requireLogin = false, $message = "") { $this->workspaceId = $workspaceId; $this->requireLogin = $requireLogin; + if(empty($message)){ + $message = LocaleService::getMessages()['559']; + } parent::__construct($message, false, null); } diff --git a/core/src/plugins/core.ajaxplorer/i18n/ca.php b/core/src/plugins/core.ajaxplorer/i18n/ca.php index 7690491ac4..6ba2d5cafd 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/ca.php +++ b/core/src/plugins/core.ajaxplorer/i18n/ca.php @@ -654,5 +654,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/cs.php b/core/src/plugins/core.ajaxplorer/i18n/cs.php index 63148cd1b7..754424c028 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/cs.php +++ b/core/src/plugins/core.ajaxplorer/i18n/cs.php @@ -651,4 +651,7 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/da.php b/core/src/plugins/core.ajaxplorer/i18n/da.php index 680ce1301a..1118b4ed5c 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/da.php +++ b/core/src/plugins/core.ajaxplorer/i18n/da.php @@ -656,5 +656,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/de.php b/core/src/plugins/core.ajaxplorer/i18n/de.php index 1c11c70db5..3f4d8cb3c1 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/de.php +++ b/core/src/plugins/core.ajaxplorer/i18n/de.php @@ -658,6 +658,9 @@ "553" => "Ungültiges Passwort. Bitte stellen Sie sicher, dass die Feststelltaste nicht gedrückt ist und geben Sie das Kennwort erneut ein.", "554" => "%s Ergebnis(se) im Papierkorb", "556" => "Starte Aufgabe %s im Hintergrund", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ /* password strength tester */ -); +); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/en.php b/core/src/plugins/core.ajaxplorer/i18n/en.php index 7a062937de..a66adffc79 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/en.php +++ b/core/src/plugins/core.ajaxplorer/i18n/en.php @@ -653,4 +653,7 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", ); diff --git a/core/src/plugins/core.ajaxplorer/i18n/es.php b/core/src/plugins/core.ajaxplorer/i18n/es.php index 8d896597de..6bb2939560 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/es.php +++ b/core/src/plugins/core.ajaxplorer/i18n/es.php @@ -658,4 +658,7 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/et.php b/core/src/plugins/core.ajaxplorer/i18n/et.php index e3fccc7318..9e7f17d563 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/et.php +++ b/core/src/plugins/core.ajaxplorer/i18n/et.php @@ -654,5 +654,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/eus.php b/core/src/plugins/core.ajaxplorer/i18n/eus.php index 7dbb2e54a7..3437a59e1f 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/eus.php +++ b/core/src/plugins/core.ajaxplorer/i18n/eus.php @@ -652,5 +652,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/fi.php b/core/src/plugins/core.ajaxplorer/i18n/fi.php index f3a69d478a..05117637ca 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/fi.php +++ b/core/src/plugins/core.ajaxplorer/i18n/fi.php @@ -654,5 +654,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/fr.php b/core/src/plugins/core.ajaxplorer/i18n/fr.php index 4c50227b1f..93ce5412a1 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/fr.php +++ b/core/src/plugins/core.ajaxplorer/i18n/fr.php @@ -653,5 +653,8 @@ "553" => "Mot de passe invalide, veuillez réessayer. \\n Attention à ce que votre touche Majuscule ne soit pas activée.", "554" => "%s résultat(s) dans la Corbeille", "556" => "Lancement de %s en tâche de fond", +"557" => "Identification requise", +"558" => "Veuillez entrer votre mot de passe pour accéder à ce workspace.", +"559" => "L'authentification pour accéder au workspace a échoué.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/gr.php b/core/src/plugins/core.ajaxplorer/i18n/gr.php index f20ae6777a..de454e293b 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/gr.php +++ b/core/src/plugins/core.ajaxplorer/i18n/gr.php @@ -651,5 +651,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/he.php b/core/src/plugins/core.ajaxplorer/i18n/he.php index 0c97f68102..c606d2d0cd 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/he.php +++ b/core/src/plugins/core.ajaxplorer/i18n/he.php @@ -651,5 +651,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/hu.php b/core/src/plugins/core.ajaxplorer/i18n/hu.php index 2c1ce573df..dd0c2d63c1 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/hu.php +++ b/core/src/plugins/core.ajaxplorer/i18n/hu.php @@ -656,5 +656,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/it.php b/core/src/plugins/core.ajaxplorer/i18n/it.php index b10856c495..9ade2fbb6b 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/it.php +++ b/core/src/plugins/core.ajaxplorer/i18n/it.php @@ -671,5 +671,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/ja.php b/core/src/plugins/core.ajaxplorer/i18n/ja.php index 2a3deeaefd..2d875f6342 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/ja.php +++ b/core/src/plugins/core.ajaxplorer/i18n/ja.php @@ -656,6 +656,9 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* 文章はここまで */ /* 文章終了 */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/kr.php b/core/src/plugins/core.ajaxplorer/i18n/kr.php index 13e5598d2f..eb159446d2 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/kr.php +++ b/core/src/plugins/core.ajaxplorer/i18n/kr.php @@ -660,5 +660,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/nl.php b/core/src/plugins/core.ajaxplorer/i18n/nl.php index 0dc42bfd64..f9093bfd69 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/nl.php +++ b/core/src/plugins/core.ajaxplorer/i18n/nl.php @@ -657,5 +657,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/no.php b/core/src/plugins/core.ajaxplorer/i18n/no.php index 25d1ecb8d2..16ccd93e2d 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/no.php +++ b/core/src/plugins/core.ajaxplorer/i18n/no.php @@ -655,5 +655,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/pl.php b/core/src/plugins/core.ajaxplorer/i18n/pl.php index 8a4f34d3df..dbecdfe59b 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/pl.php +++ b/core/src/plugins/core.ajaxplorer/i18n/pl.php @@ -651,5 +651,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/pt-br.php b/core/src/plugins/core.ajaxplorer/i18n/pt-br.php index f5d09a76ec..afffdcc032 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/pt-br.php +++ b/core/src/plugins/core.ajaxplorer/i18n/pt-br.php @@ -257,7 +257,6 @@ "204" => "O arquivo \"", "205" => "\" excede o limite de tamanho (", "206" => "Mb).\\nNão será enviado.", -/* END SENTENCE */ "207" => "Você não tem permissão de escrita neste diretório", "208" => "Você não tem permissão de leitura neste diretório", "209" => "Erro interno no servidor, contate o administrador do sistema!", @@ -433,7 +432,6 @@ "375" => "Aviso, você esteve inativo mais do que __IDLE__, você será desconectado em __LOGOUT__", "376" => "Clique em qualquer lugar para reativar", "378" => "Aviso, senha vazia ou muito curta!", -/* testador de força de senha */ "379" => "Palavra não-segura!", "380" => "Muito curto", "381" => "Muito fraco", @@ -653,4 +651,9 @@ "553" => "Senha inválida, favor tentar novamente. \\n Verifique se a função Caps Lock não está ativada!", "554" => "%s resultado(s) na Lixeira", "556" => "Executando tarefa %s em segundo plano", -); +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", +/* END SENTENCE */ +/* testador de força de senha */ +); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/pt.php b/core/src/plugins/core.ajaxplorer/i18n/pt.php index f1690382d5..87d5a02187 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/pt.php +++ b/core/src/plugins/core.ajaxplorer/i18n/pt.php @@ -651,6 +651,9 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ /* password strength tester */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/ru.php b/core/src/plugins/core.ajaxplorer/i18n/ru.php index 4dd4359187..f8476fc567 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/ru.php +++ b/core/src/plugins/core.ajaxplorer/i18n/ru.php @@ -651,6 +651,9 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ /* password strength tester */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/si.php b/core/src/plugins/core.ajaxplorer/i18n/si.php index c9a3bc1cd7..a92e5d8986 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/si.php +++ b/core/src/plugins/core.ajaxplorer/i18n/si.php @@ -652,5 +652,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/sv.php b/core/src/plugins/core.ajaxplorer/i18n/sv.php index 38f77f3774..9b720d76ad 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/sv.php +++ b/core/src/plugins/core.ajaxplorer/i18n/sv.php @@ -651,5 +651,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/tr.php b/core/src/plugins/core.ajaxplorer/i18n/tr.php index d60b0fb6fc..73af423b8f 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/tr.php +++ b/core/src/plugins/core.ajaxplorer/i18n/tr.php @@ -654,5 +654,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/zh-tw.php b/core/src/plugins/core.ajaxplorer/i18n/zh-tw.php index bfd2000d21..6892901038 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/zh-tw.php +++ b/core/src/plugins/core.ajaxplorer/i18n/zh-tw.php @@ -654,5 +654,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file diff --git a/core/src/plugins/core.ajaxplorer/i18n/zh.php b/core/src/plugins/core.ajaxplorer/i18n/zh.php index a96d5f06eb..fe2714095e 100644 --- a/core/src/plugins/core.ajaxplorer/i18n/zh.php +++ b/core/src/plugins/core.ajaxplorer/i18n/zh.php @@ -663,5 +663,8 @@ "553" => "Invalid password, please try again. \\n Make sure your Caps Lock is not engaged!", "554" => "%s result(s) in Recycle Bin", "556" => "Launching task %s in background", +"557" => "Credentials required", +"558" => "Please provide a password to enter this workspace.", +"559" => "Authentication failed for this workspace.", /* END SENTENCE */ ); \ No newline at end of file From 5d6b0ddb83164f18ce2ac24b3a6641e901bd5407 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Mon, 21 Nov 2016 12:31:17 +0100 Subject: [PATCH 10/11] RolesManager loading role data : Make sure to remove invalid repos on error from shared repositories list. --- core/src/plugins/access.ajxp_conf/src/RolesManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/plugins/access.ajxp_conf/src/RolesManager.php b/core/src/plugins/access.ajxp_conf/src/RolesManager.php index bafbdeac82..bbc8f0df9e 100644 --- a/core/src/plugins/access.ajxp_conf/src/RolesManager.php +++ b/core/src/plugins/access.ajxp_conf/src/RolesManager.php @@ -233,10 +233,12 @@ public function rolesActions(ServerRequestInterface $requestInterface, ResponseI || ($repositoryObject->getUniqueUser() != null && $repositoryObject->getUniqueUser() != $userObject->getId()) ) ){ + if(isSet($sharedRepos[$repositoryId])) unset($sharedRepos[$repositoryId]); continue; }else if(empty($userObject) && ( (empty($currentMainUser) && !$currentMainUser->canAdministrate($repositoryObject)) || $repositoryObject->isTemplate() )){ + if(isSet($sharedRepos[$repositoryId])) unset($sharedRepos[$repositoryId]); continue; } $meta = array(); From d54df84f70226956d6ea0f90ce41d8266d5a4641 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Mon, 21 Nov 2016 13:59:25 +0100 Subject: [PATCH 11/11] Initiate release note and dist resources for 7.0.2 --- core/src/conf/RELEASE_NOTE | 50 +++++++++++++++++++ dist/php/7.0.2.html | 99 ++++++++++++++++++++++++++++++++++++++ dist/php/7.0.2.mysql | 6 +++ 3 files changed, 155 insertions(+) create mode 100644 dist/php/7.0.2.html create mode 100644 dist/php/7.0.2.mysql diff --git a/core/src/conf/RELEASE_NOTE b/core/src/conf/RELEASE_NOTE index c406835036..fa9fc52445 100644 --- a/core/src/conf/RELEASE_NOTE +++ b/core/src/conf/RELEASE_NOTE @@ -13,6 +13,56 @@ Pydio 7.0.1 Fix main upgrade issues of 7.0 . Check php version: 5.6 is finally required for enterprise dist, because of ioncube loaders. . Fix case sensitive rename (details) +Pydio 7.0.2 Bugfix release for Pydio 7 +-- +. Fix command line automatic comma-split, let it enabled only for -i and -r options, otherwise it can break some commands. (details) +. Update current stable version (details) +. Use a dedicated mbParseUrl() function instead of parse_url that may fail with utf-8 on some specific installs (inc. macos) (details) +. Fix issue #1259: Zip on-the-fly option creates 0-sized empty files (apache compatibility) (details) +. Users and groups deletion: use UsersService and RolesService instead of deleting directly in db to fix caching issues. (details) +. Fix roles assignment when updating user groupPath (details) +. JS UI: handle Prompt exception and dialog. (details) +. New Middleware WorkspaceAuthRequired catches specific exception, sends JS prompt message and re-initialize request when form is submitted. (details) +. changed invalid link to developer guide to v7 developer guide (details) +. Reorganize MemorySafe. Add a context identifier to handle multiple credential sources. For storing when passed via ENV CLi. (details) +. Tplus / Tminus were moved to subfolder. Fix #1255 (details) +. Change docs editors orders. Fix #1264 (details) +. Fix ChainCache declaring PatternClearable although subacaches may not have this feature. Fix #1265 (details) +. Make sure to save repoId in session when loading minisite, can make some issues if shared user have other workspaces accesses. (details) +. Sets a default provider for TaskService otherwise top-level errors of command line are not visible to task status. (details) +. Fix slug issues - Fix #1273 (details) +. Prevent enabling cache at install if apc/apcu is not enabled. Should fix #1261 (details) +. Make sure to recompute readonly flag if current context has a permission mask, by using node.info.nocache hook. (details) +. Change icon for dwg files, use cube. Fix #1230 (details) +. Do not post "change" notifications or alerts when just copying a file to another workspace. Fix #1274 (details) +. Silently ignore register channel on non-readable repository. Avoid sending events on write-only repositories, see #1256 (details) +. Dav impl childExists function is highly inefficient, replace by a simple call to is_file on childnode. (details) +. And WorkspaceAuthRequired instead of simple exception (details) +. Fix meta.git download/preview. Fix #1275 (details). . +. Fix Shared Files download, the associated method is no more switchAction but downloadAction. Fix #1276 (details) +. Use file_exists instead of is_file (details) +. CLI and task_id passed : make sure to update status by default, for actions that do not implement specific tasks management. Otherwise scheduler will show "Starting action.... " and nothing more. (details) +. Missing context in cleanUserShares() could create an error on user deletion. Close #1279 (details) +. Fix mbParseUrl if preg_replace returns null. (details) +. Catch deleteById() exceptions in ElasticSearch (details) +. Remote download was broken. Fix #1281 (details) +. Auth.multi : when looking for shared users only, skip master driver. Auth.ldap : fix users count caching per baseGroup. (details) +. Fix CSS on share dialog title. (details) +. Add user if not in indexed URL. (details) +. Meta.git: make sure to apply node.change after revert operation. (details) +. Fix counting user on ldap (details) +. Missing curly brace (details) +. Fix Imap & EML plugins - Warning php7 requires Mail_mimeDecode 1.5.6 - Fix #1282 (details) +. Fix #1288 (details) +. Rewire ALLOWED_EXTENSIONS configs - Fix #1283 (details) +. Fix SMB access driver and custom smbclient path. Close #1290 (details) +. Fix zip operation when child drivers are remote (inc. smb) - Fix #1287 Fix base detection for archive (details) +. Auth.ldap: add starttsl support. See #1248, should fix it. (details) +. Manual merge of #1292 (put encoding call directly inside win-dedicated function. (details) +. Update trigger as mysql automatically pads varchars when comparing, creating a content instead of path in some case (trailing spaces). See #1253 (details) +. i18n new prompt exception mechanism (details) +. RolesManager loading role data : Make sure to remove invalid repos on error from shared repositories list. (details) + ************** New Features ************** diff --git a/dist/php/7.0.2.html b/dist/php/7.0.2.html new file mode 100644 index 0000000000..2ba027471a --- /dev/null +++ b/dist/php/7.0.2.html @@ -0,0 +1,99 @@ +
+ +

Pydio 7.0.2 successfully installed

+ +

+ Pydio 7.0.2 is a bugfix release for Pydio 7. Main changes/fixes are +

    +
  • Encoding, zip operation, installation issues
  • +
  • Some plugins needed upgrade for v7 compatibility (imap, eml)
  • +
  • New uploader did not take into account the 'allowed extensions' parameter
  • +
  • See detailed changelog below
  • +
+ This version also introduce a new feature for dynamically providing a password for a workspace relying on session-based authentication. +

+ +

Pydio 7 Important Features

+ +

Pydio Booster

+ +

Pydio Go is a complement to Pydio that runs as a Server. It is based on GO, a performant language developed by Google. It will improve overall software performances, by delegating CPU-consuming task to this new tool. In this first version, it will handle uploads, scheduler triggers, and best of all, one-click install websocket server, which will especially improve scalability and performances by pushing events from server instead of polling all the time.
+ Pydio Go is available for Pydio Community and Pydio Enterprise.

+ +

File Gateway improves your server security

+ Pydio offers a brand new SaaS-based service called FileGateway, a host proxy to send public links without disclosing your server URL. + Choose your domain name (filesend.cc / yoursha.re) and your region (US / EU). + +

Online Documents Edition

+ + By hosting your own instance of Libreoffice Online from Collabora and using our new connector, you can now edit any office documents directly online, without the need to use third-party services like Zoho. + +

API, Performances

+ - Full rewrite of Pydio API, especially regarding provisioning, following Open API standards; there is now an extensive, accurate API REST documentation. +
- Increased caching, especially files list, whick makes it mindblasting in terms of performances, especially for remote workspaces like S3 or FTP +
- Search for files or information across several storages / workspaces at the same time, and get quicker search results with the upgrade of our Elastic Search plugin +
- New Admin parameter to easily allow or prevent user to re-share files + +

Under the Hood

+ - Code refactoring, with PSR-7 pattern, Composer, Guzzle +
- New Messaging Server based on NSQ, a language originally developed by Bitly +
- Auto-complete command line makes it easier for Admins to look for specific actions with Pydio (thanks to @symfony) +
- End of some unmaintained plugins (e.g. auth.serial, conf.serial) +
- Internal router embeded solves deployment issues, simplifying RewriteRules at maximum +
- New way of storing shares that will facilitate Pydio migrations +
And many more... !! + + +

7.0.2 detailed changelog

+
    +
  • Fix command line automatic comma-split, let it enabled only for -i and -r options, otherwise it can break some commands. (details)
  • +
  • Update current stable version (details)
  • +
  • Use a dedicated mbParseUrl() function instead of parse_url that may fail with utf-8 on some specific installs (inc. macos) (details)
  • +
  • Fix issue #1259: Zip on-the-fly option creates 0-sized empty files (apache compatibility) (details)
  • +
  • Users and groups deletion: use UsersService and RolesService instead of deleting directly in db to fix caching issues. (details)
  • +
  • Fix roles assignment when updating user groupPath (details)
  • +
  • JS UI: handle Prompt exception and dialog. (details)
  • +
  • New Middleware WorkspaceAuthRequired catches specific exception, sends JS prompt message and re-initialize request when form is submitted. (details)
  • +
  • changed invalid link to developer guide to v7 developer guide (details)
  • +
  • Reorganize MemorySafe. Add a context identifier to handle multiple credential sources. For storing when passed via ENV CLi. (details)
  • +
  • Tplus / Tminus were moved to subfolder. Fix #1255 (details)
  • +
  • Change docs editors orders. Fix #1264 (details)
  • +
  • Fix ChainCache declaring PatternClearable although subacaches may not have this feature. Fix #1265 (details)
  • +
  • Make sure to save repoId in session when loading minisite, can make some issues if shared user have other workspaces accesses. (details)
  • +
  • Sets a default provider for TaskService otherwise top-level errors of command line are not visible to task status. (details)
  • +
  • Fix slug issues - Fix #1273 (details)
  • +
  • Prevent enabling cache at install if apc/apcu is not enabled. Should fix #1261 (details)
  • +
  • Make sure to recompute readonly flag if current context has a permission mask, by using node.info.nocache hook. (details)
  • +
  • Change icon for dwg files, use cube. Fix #1230 (details)
  • +
  • Do not post "change" notifications or alerts when just copying a file to another workspace. Fix #1274 (details)
  • +
  • Silently ignore register channel on non-readable repository. Avoid sending events on write-only repositories, see #1256 (details)
  • +
  • Dav impl childExists function is highly inefficient, replace by a simple call to is_file on childnode. (details)
  • +
  • And WorkspaceAuthRequired instead of simple exception (details)
  • +
  • Fix meta.git download/preview. Fix #1275 (details)
  • +
  • Fix Shared Files download, the associated method is no more switchAction but downloadAction. Fix #1276 (details)
  • +
  • Use file_exists instead of is_file (details)
  • +
  • CLI and task_id passed : make sure to update status by default, for actions that do not implement specific tasks management. Otherwise scheduler will show "Starting action.... " and nothing more. (details)
  • +
  • Missing context in cleanUserShares() could create an error on user deletion. Close #1279 (details)
  • +
  • Fix mbParseUrl if preg_replace returns null. (details)
  • +
  • Catch deleteById() exceptions in ElasticSearch (details)
  • +
  • Remote download was broken. Fix #1281 (details)
  • +
  • Auth.multi : when looking for shared users only, skip master driver. Auth.ldap : fix users count caching per baseGroup. (details)
  • +
  • Fix CSS on share dialog title. (details)
  • +
  • Add user if not in indexed URL. (details)
  • +
  • Meta.git: make sure to apply node.change after revert operation. (details)
  • +
  • Fix counting user on ldap (details)
  • +
  • Missing curly brace (details)
  • +
  • Fix Imap & EML plugins - Warning php7 requires Mail_mimeDecode 1.5.6 - Fix #1282 (details)
  • +
  • Fix #1288 (details)
  • +
  • Rewire ALLOWED_EXTENSIONS configs - Fix #1283 (details)
  • +
  • Fix SMB access driver and custom smbclient path. Close #1290 (details)
  • +
  • Fix zip operation when child drivers are remote (inc. smb) - Fix #1287 Fix base detection for archive (details)
  • +
  • Auth.ldap: add starttsl support. See #1248, should fix it. (details)
  • +
  • Manual merge of #1292 (put encoding call directly inside win-dedicated function. (details)
  • +
  • Update trigger as mysql automatically pads varchars when comparing, creating a content instead of path in some case (trailing spaces). See #1253 (details)
  • +
  • i18n new prompt exception mechanism (details)
  • +
  • RolesManager loading role data : Make sure to remove invalid repos on error from shared repositories list. (details)
  • +
+ +
\ No newline at end of file diff --git a/dist/php/7.0.2.mysql b/dist/php/7.0.2.mysql new file mode 100644 index 0000000000..9c9f8e2070 --- /dev/null +++ b/dist/php/7.0.2.mysql @@ -0,0 +1,6 @@ +/* SEPARATOR */ +DROP TRIGGER IF EXISTS `LOG_UPDATE`; +/* SEPARATOR */ +CREATE TRIGGER `LOG_UPDATE` AFTER UPDATE ON `ajxp_index` +FOR EACH ROW INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) +VALUES (new.repository_identifier, new.node_id, old.node_path, new.node_path, CASE LENGTH(new.node_path) = LENGTH(old.node_path) AND old.node_path COLLATE utf8_bin = new.node_path COLLATE utf8_bin WHEN true THEN 'content' ELSE 'path' END);