mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
Admin can reset password without old password.
This commit is contained in:
@ -25,6 +25,7 @@ export const PasswordModal = (props) => {
|
|||||||
const [newPassword, setNewPassword] = React.useState("");
|
const [newPassword, setNewPassword] = React.useState("");
|
||||||
const [rePassword, setRePassword] = React.useState("");
|
const [rePassword, setRePassword] = React.useState("");
|
||||||
const {user} = props;
|
const {user} = props;
|
||||||
|
const {account} = props;
|
||||||
|
|
||||||
const showModal = () => {
|
const showModal = () => {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
@ -73,7 +74,7 @@ export const PasswordModal = (props) => {
|
|||||||
width={600}
|
width={600}
|
||||||
>
|
>
|
||||||
<Col style={{margin: "0px auto 40px auto", width: 1000, height: 300}}>
|
<Col style={{margin: "0px auto 40px auto", width: 1000, height: 300}}>
|
||||||
{ hasOldPassword ? (
|
{ (hasOldPassword && !Setting.isAdminUser(account)) ? (
|
||||||
<Row style={{width: "100%", marginBottom: "20px"}}>
|
<Row style={{width: "100%", marginBottom: "20px"}}>
|
||||||
<Input.Password addonBefore={i18next.t("user:Old Password")} placeholder={i18next.t("user:input password")} onChange={(e) => setOldPassword(e.target.value)}/>
|
<Input.Password addonBefore={i18next.t("user:Old Password")} placeholder={i18next.t("user:input password")} onChange={(e) => setOldPassword(e.target.value)}/>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -202,7 +202,7 @@ class UserEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("general:Password"), i18next.t("general:Password - Tooltip"))} :
|
{Setting.getLabel(i18next.t("general:Password"), i18next.t("general:Password - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<PasswordModal user={this.state.user} />
|
<PasswordModal user={this.state.user} account={this.props.account} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row style={{marginTop: '20px'}} >
|
<Row style={{marginTop: '20px'}} >
|
||||||
|
Reference in New Issue
Block a user