Skip to content

Commit

Permalink
fixup! fixup! fixup! Public dav endpoint v2
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Oct 28, 2022
1 parent 4147cb0 commit 65483de
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 29 deletions.
7 changes: 5 additions & 2 deletions apps/dav/lib/Connector/Sabre/PublicAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,18 @@ class PublicAuth extends AbstractBasic {
private ISession $session;
private IRequest $request;
private Throttler $throttler;
private LoggerInterface $logger;

public function __construct(IRequest $request,
IManager $shareManager,
ISession $session,
Throttler $throttler) {
Throttler $throttler,
LoggerInterface $logger) {
$this->request = $request;
$this->shareManager = $shareManager;
$this->session = $session;
$this->throttler = $throttler;
$this->logger = $logger;

// setup realm
$defaults = new \OCP\Defaults();
Expand Down Expand Up @@ -107,7 +110,7 @@ public function check(RequestInterface $request, ResponseInterface $response): a
} catch (\Exception $e) {
$class = get_class($e);
$msg = $e->getMessage();
\OC::$server->get(LoggerInterface::class)->error($e->getMessage(), ['exception' => $e]);
$this->logger->error($e->getMessage(), ['exception' => $e]);
throw new ServiceUnavailable("$class: $msg");
}
}
Expand Down
14 changes: 2 additions & 12 deletions apps/files_sharing/js/files_drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
var output = this.template();
var token = $('#sharingToken').val()

// note: password not be required, the endpoint
// will recognize previous validation from the session
var filesClient = new OC.Files.Client({
host: OC.getHost(),
port: OC.getPort(),
Expand All @@ -47,18 +49,6 @@

data.multipart = false;

if (!data.headers) {
data.headers = {};
}

var userName = filesClient.getUserName();
var password = filesClient.getPassword();
if (userName) {
// copy username/password from DAV client
data.headers['Authorization'] =
'Basic ' + btoa(userName + ':' + (password || ''));
}

$('#drop-upload-done-indicator').addClass('hidden');
$('#drop-upload-progress-indicator').removeClass('hidden');

Expand Down
2 changes: 2 additions & 0 deletions apps/files_sharing/js/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ OCA.Sharing.PublicApp = {
this.$showGridView.on('change', _.bind(this._onGridviewChange, this));
$('#view-toggle').tooltip({placement: 'bottom', trigger: 'hover'});

// note: password not be required, the endpoint
// will recognize previous validation from the session
var filesClient = new OC.Files.Client({
host: OC.getHost(),
port: OC.getPort(),
Expand Down
17 changes: 2 additions & 15 deletions lib/composer/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,8 @@
// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
exit(1);
}

require_once __DIR__ . '/composer/autoload_real.php';
Expand Down

0 comments on commit 65483de

Please sign in to comment.