mirror of https://github.com/nextcloud/server.git
Adds a "Request password" button to the public share authentication page for shares
of type TYPE_EMAIL, when the "video verification" checkbox isn't checked. Users accessing non-anonymous public shares (TYPE_EMAIL shares) can now request a temporary password themselves. - Creates a migration step for the files_sharing app to add the 'password_expiration_time' attribute to the oc_shares table. - Makes share temporary passwords' expiration time configurable via a system value. - Adds a system config value to allow permanent share passwords -Fixes a typo in a comment in apps/files_sharing/src/components/SharingEntryLink.vue See https://github.com/nextcloud/server/issues/31005 Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>pull/31220/head
parent
60f946aba5
commit
c6a5c07041
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 Vincent Petry <vincent@nextloud.com>
|
||||
*
|
||||
* @author Vincent Petry <vincent@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
namespace OCA\Files_Sharing\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCP\DB\Types;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
class Version24000Date20220208195521 extends SimpleMigrationStep {
|
||||
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
* @return null|ISchemaWrapper
|
||||
*/
|
||||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
||||
$schema = $schemaClosure();
|
||||
$table = $schema->getTable('share');
|
||||
$table->addColumn('password_expiration_time', Types::DATETIME, [
|
||||
'notnull' => false,
|
||||
]);
|
||||
return $schema;
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +1,52 @@
|
||||
function showEmailAddressPromptForm() {
|
||||
// Shows email prompt
|
||||
var emailInput = document.getElementById('email-input-form');
|
||||
emailInput.style.display="block";
|
||||
|
||||
// Shows back button
|
||||
var backButton = document.getElementById('request-password-back-button');
|
||||
backButton.style.display="block";
|
||||
|
||||
// Hides password prompt and 'request password' button
|
||||
var passwordRequestButton = document.getElementById('request-password-button-not-talk');
|
||||
var passwordInput = document.getElementById('password-input-form');
|
||||
passwordRequestButton.style.display="none";
|
||||
passwordInput.style.display="none";
|
||||
|
||||
// Hides identification result messages, if any
|
||||
var identificationResultSuccess = document.getElementById('identification-success');
|
||||
var identificationResultFailure = document.getElementById('identification-failure');
|
||||
if (identificationResultSuccess) {
|
||||
identificationResultSuccess.style.display="none";
|
||||
}
|
||||
if (identificationResultFailure) {
|
||||
identificationResultFailure.style.display="none";
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Enables password submit button only when user has typed something in the password field
|
||||
var passwordInput = document.getElementById('password');
|
||||
var passwordButton = document.getElementById('password-submit');
|
||||
var eventListener = function() {
|
||||
passwordButton.disabled = passwordInput.value.length === 0;
|
||||
};
|
||||
|
||||
passwordInput.addEventListener('click', eventListener);
|
||||
passwordInput.addEventListener('keyup', eventListener);
|
||||
passwordInput.addEventListener('change', eventListener);
|
||||
|
||||
// Enables email request button only when user has typed something in the email field
|
||||
var emailInput = document.getElementById('email');
|
||||
var emailButton = document.getElementById('password-request');
|
||||
eventListener = function() {
|
||||
emailButton.disabled = emailInput.value.length === 0;
|
||||
};
|
||||
emailInput.addEventListener('click', eventListener);
|
||||
emailInput.addEventListener('keyup', eventListener);
|
||||
emailInput.addEventListener('change', eventListener);
|
||||
|
||||
// Adds functionality to the request password button
|
||||
var passwordRequestButton = document.getElementById('request-password-button-not-talk');
|
||||
passwordRequestButton.addEventListener('click', showEmailAddressPromptForm);
|
||||
|
||||
});
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue