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

Commit 5aa4d8f

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 27dfcac + 59c0aab commit 5aa4d8f

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

core/src/core/src/pydio/Core/Http/Dav/AuthBackendBasic.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ public function authenticate(Sabre\DAV\Server $server, $realm)
131131
//AJXP_Logger::debug("Using Cached Password");
132132
}
133133

134-
135134
if (!$cachedPasswordValid && (!$this->validateUserPass($userpass[0],$userpass[1]))) {
136135
Logger::warning(__CLASS__, "Login failed", array("user" => $userpass[0], "error" => "Invalid WebDAV user or password"));
137136
$auth->requireLogin();

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use Pydio\Core\Services\ApiKeysService;
2828
use Pydio\Auth\Frontend\Core\AbstractAuthFrontend;
2929
use Pydio\Conf\Sql\SqlConfDriver;
30+
use Pydio\Log\Core\Logger;
3031
use Zend\Diactoros\UploadedFile;
3132

3233
defined('AJXP_EXEC') or die('Access not allowed');
@@ -85,9 +86,11 @@ function retrieveParams(ServerRequestInterface &$request, ResponseInterface &$re
8586
if ($action == "upload") {
8687
$stream = $request->getBody();
8788

89+
$size = (int)$request->getHeader("Content-Length")[0];
90+
8891
$uploadedFile = new UploadedFile(
8992
$stream,
90-
(int)$request->getHeader("content-length"),
93+
$size,
9194
0,
9295
basename($path)
9396
);

core/src/plugins/access.fs/FsAccessDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,10 @@ public function uploadAction(ServerRequestInterface &$request, ResponseInterface
485485
}
486486

487487
// PARTIAL UPLOAD CASE - PREPPEND .dlpart extension
488-
if(isSet($httpVars["partial_upload"]) && $httpVars["partial_upload"] == 'true' && isSet($httpVars["partial_target_bytesize"])){
488+
if(isSet($httpVars["partial_upload"]) && $httpVars["partial_upload"] == 'true' && isSet($httpVars["partial_target_bytesize"])) {
489489
$partialUpload = true;
490490
$partialTargetSize = intval($httpVars["partial_target_bytesize"]);
491-
if(!isSet($httpVars["appendto_urlencoded_part"])){
491+
if(!isSet($httpVars["appendto_urlencoded_part"])) {
492492
$userfile_name .= ".dlpart";
493493
$targetUrl = $destination."/".$userfile_name;
494494
}

core/src/plugins/authfront.cas/CasAuthFrontend.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ function loadConfig()
349349
if (!empty($this->pluginConf["PHPCAS_MODE"]["casmode"])) {
350350
$this->cas_mode = $this->pluginConf["PHPCAS_MODE"]["casmode"];
351351
}
352+
else{
353+
$this->cas_mode = PHPCAS_MODE_CLIENT;
354+
}
355+
352356
if (!empty($this->pluginConf["CERTIFICATE_PATH"])) {
353357
$this->cas_certificate_path = trim($this->pluginConf["CERTIFICATE_PATH"]);
354358
}

core/src/plugins/core.access/src/Stream/StreamWrapper.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ public static function register($protocol) {
7070
public function stream_open($path, $mode, $options, &$opened_path) {
7171
$this->stream = self::createStream($path, $mode);
7272

73-
if ($this->stream->isWritable() && !$this->stream->isReadable()) {
74-
$a = 1;
75-
}
76-
7773
return true;
7874
}
7975

@@ -341,7 +337,7 @@ public static function getResolvedOptionsForNode($node)
341337
*/
342338
public function stream_flush()
343339
{
344-
// TODO: Implement stream_flush() method.
340+
//$this->stream->flush();
345341
}
346342

347343
/**

core/src/plugins/core.access/src/Stream/WriteBufferStream.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public function getContents() {
5656
}
5757

5858
public function close() {
59-
//$this->bufferStream->close();
6059
if ($this->size > 0) {
6160
$this->stream->write($this->bufferStream);
6261
}

core/src/plugins/core.ocs/src/Server/Dav/AuthSharingBackend.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ public function __construct(ContextInterface $context){
6868
*
6969
* @param string $username
7070
* @param string $password
71-
* @return bool
71+
* @return mixed AJXP_User|bool
7272
*/
7373
protected function validateUserPass($username, $password)
7474
{
7575
try{
7676
if(isSet($this->shareData["PRESET_LOGIN"])){
77-
AuthService::logUser($this->shareData["PRESET_LOGIN"], $password, false, false);
77+
$user = AuthService::logUser($this->shareData["PRESET_LOGIN"], $password, false, false);
7878
}else{
79-
AuthService::logUser($this->shareData["PRELOG_USER"], "", true);
79+
$user = AuthService::logUser($this->shareData["PRELOG_USER"], "", true);
8080
}
81-
return true;
81+
return $user;
8282
}catch (LoginException $l){
8383
return false;
8484
}
@@ -119,7 +119,9 @@ public function authenticate(DAV\Server $server, $realm) {
119119
$auth->requireLogin();
120120
throw new DAV\Exception\NotAuthenticated('Username or password does not match');
121121
}
122-
if (!$this->validateUserPass($userpass[0],$userpass[1])) {
122+
123+
$user = $this->validateUserPass($userpass[0],$userpass[1]);
124+
if (!$user) {
123125
$auth->requireLogin();
124126
throw new DAV\Exception\NotAuthenticated('Username or password does not match');
125127
}
@@ -136,7 +138,7 @@ public function authenticate(DAV\Server $server, $realm) {
136138
}
137139

138140
$this->currentUser = $userpass[0];
139-
$this->context->setUserId($this->currentUser);
141+
$this->context->setUserObject($user);
140142

141143
Logger::updateContext($this->context);
142144
TextEncoder::updateContext($this->context);

0 commit comments

Comments
 (0)