mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-02 19:41:28 +03:00
add options: disable-change-permanent-password, disable-change-id, disable-unlock-pin (#13929)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -825,7 +825,8 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
permissions(context),
|
||||
password(context),
|
||||
_Card(title: '2FA', children: [tfa()]),
|
||||
_Card(title: 'ID', children: [changeId()]),
|
||||
if (!isChangeIdDisabled())
|
||||
_Card(title: 'ID', children: [changeId()]),
|
||||
more(context),
|
||||
]),
|
||||
),
|
||||
@@ -1091,6 +1092,10 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
.indexOf(kUsePermanentPassword)] &&
|
||||
(await bind.mainGetPermanentPassword())
|
||||
.isEmpty) {
|
||||
if (isChangePermanentPasswordDisabled()) {
|
||||
await callback();
|
||||
return;
|
||||
}
|
||||
setPasswordDialog(notEmptyCallback: callback);
|
||||
} else {
|
||||
await callback();
|
||||
@@ -1195,7 +1200,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
enabled: tmpEnabled && !locked),
|
||||
if (usePassword) numericOneTimePassword,
|
||||
if (usePassword) radios[1],
|
||||
if (usePassword)
|
||||
if (usePassword && !isChangePermanentPasswordDisabled())
|
||||
_SubButton('Set permanent password', setPasswordDialog,
|
||||
permEnabled && !locked),
|
||||
// if (usePassword)
|
||||
@@ -1218,7 +1223,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
_OptionCheckBox(context, 'allow-only-conn-window-open-tip',
|
||||
'allow-only-conn-window-open',
|
||||
reverse: false, enabled: enabled),
|
||||
if (bind.mainIsInstalled()) unlockPin()
|
||||
if (bind.mainIsInstalled() && !isUnlockPinDisabled()) unlockPin()
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -2654,7 +2659,7 @@ Widget _lock(
|
||||
]).marginSymmetric(vertical: 2)),
|
||||
onPressed: () async {
|
||||
final unlockPin = bind.mainGetUnlockPin();
|
||||
if (unlockPin.isEmpty) {
|
||||
if (unlockPin.isEmpty || isUnlockPinDisabled()) {
|
||||
bool checked = await callMainCheckSuperUserPermission();
|
||||
if (checked) {
|
||||
onUnlock();
|
||||
|
||||
Reference in New Issue
Block a user