mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
repo with encrypt: (#3738)
if sys admin set min password length for repo, use that length to show and check password length in create repo dialog.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label, Alert } from 'reactstrap';
|
||||
import { gettext, enableEncryptedLibrary } from '../../utils/constants';
|
||||
import { gettext, enableEncryptedLibrary, repoPasswordMinLength } from '../../utils/constants';
|
||||
|
||||
const propTypes = {
|
||||
libraryType: PropTypes.string.isRequired,
|
||||
@@ -99,7 +99,7 @@ class CreateRepoDialog extends React.Component {
|
||||
this.setState({errMessage: errMessage});
|
||||
return false;
|
||||
}
|
||||
if (password1.length < 8) {
|
||||
if (password1.length < repoPasswordMinLength) {
|
||||
errMessage = gettext('Password is too short');
|
||||
this.setState({errMessage: errMessage});
|
||||
return false;
|
||||
@@ -197,7 +197,7 @@ class CreateRepoDialog extends React.Component {
|
||||
{!this.state.disabled &&
|
||||
<FormGroup>
|
||||
{/* todo translate */}
|
||||
<Label for="passwd1" className="font-weight-bold">{gettext('Password')}</Label><span className="tip">{' '}{gettext('(at least 8 characters)')}</span>
|
||||
<Label for="passwd1" className="font-weight-bold">{gettext('Password')}</Label><span className="tip">{' '}{gettext('(at least {placeholder} characters)').replace('{placeholder}', repoPasswordMinLength)}</span>
|
||||
<Input
|
||||
id="passwd1"
|
||||
type="password"
|
||||
|
Reference in New Issue
Block a user