mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 19:17:58 +00:00
feat: numeric one-time password (#11846)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -36,6 +36,7 @@ class ServerModel with ChangeNotifier {
|
||||
int _connectStatus = 0; // Rendezvous Server status
|
||||
String _verificationMethod = "";
|
||||
String _temporaryPasswordLength = "";
|
||||
bool _allowNumericOneTimePassword = false;
|
||||
String _approveMode = "";
|
||||
int _zeroClientLengthCounter = 0;
|
||||
|
||||
@@ -112,6 +113,12 @@ class ServerModel with ChangeNotifier {
|
||||
*/
|
||||
}
|
||||
|
||||
bool get allowNumericOneTimePassword => _allowNumericOneTimePassword;
|
||||
switchAllowNumericOneTimePassword() async {
|
||||
await mainSetBoolOption(
|
||||
kOptionAllowNumericOneTimePassword, !_allowNumericOneTimePassword);
|
||||
}
|
||||
|
||||
TextEditingController get serverId => _serverId;
|
||||
|
||||
TextEditingController get serverPasswd => _serverPasswd;
|
||||
@@ -227,6 +234,8 @@ class ServerModel with ChangeNotifier {
|
||||
final temporaryPasswordLength =
|
||||
await bind.mainGetOption(key: "temporary-password-length");
|
||||
final approveMode = await bind.mainGetOption(key: kOptionApproveMode);
|
||||
final numericOneTimePassword =
|
||||
await mainGetBoolOption(kOptionAllowNumericOneTimePassword);
|
||||
/*
|
||||
var hideCm = option2bool(
|
||||
'allow-hide-cm', await bind.mainGetOption(key: 'allow-hide-cm'));
|
||||
@@ -265,6 +274,10 @@ class ServerModel with ChangeNotifier {
|
||||
_temporaryPasswordLength = temporaryPasswordLength;
|
||||
update = true;
|
||||
}
|
||||
if (_allowNumericOneTimePassword != numericOneTimePassword) {
|
||||
_allowNumericOneTimePassword = numericOneTimePassword;
|
||||
update = true;
|
||||
}
|
||||
/*
|
||||
if (_hideCm != hideCm) {
|
||||
_hideCm = hideCm;
|
||||
@@ -817,8 +830,8 @@ class Client {
|
||||
|
||||
RxInt unreadChatMessageCount = 0.obs;
|
||||
|
||||
Client(this.id, this.authorized, this.isFileTransfer, this.isViewCamera, this.name, this.peerId,
|
||||
this.keyboard, this.clipboard, this.audio);
|
||||
Client(this.id, this.authorized, this.isFileTransfer, this.isViewCamera,
|
||||
this.name, this.peerId, this.keyboard, this.clipboard, this.audio);
|
||||
|
||||
Client.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
|
||||
Reference in New Issue
Block a user