From 68afb89b997e04b3efc401b5789e4de6692476ad Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sun, 21 Jan 2024 15:18:25 +0800 Subject: [PATCH 1/7] a quick fix for 2fa --- src/client.rs | 1 - src/server/connection.rs | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client.rs b/src/client.rs index e8167b6c5b64..637ddf529036 100644 --- a/src/client.rs +++ b/src/client.rs @@ -2564,7 +2564,6 @@ pub fn handle_login_error( interface.msgbox("re-input-password", err, "Do you want to enter again?", ""); true } else if err == LOGIN_MSG_2FA_WRONG || err == REQUIRE_2FA { - lc.write().unwrap().password = Default::default(); interface.msgbox("input-2fa", err, "", ""); true } else if LOGIN_ERROR_MAP.contains_key(err) { diff --git a/src/server/connection.rs b/src/server/connection.rs index 1f0685d9b5c1..42b963593598 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1625,8 +1625,8 @@ impl Connection { #[cfg(all(target_os = "linux", feature = "linux_headless"))] #[cfg(not(any(feature = "flatpak", feature = "appimage")))] self.linux_headless_handle.wait_desktop_cm_ready().await; - self.try_start_cm(lr.my_id.clone(), lr.my_name.clone(), true); self.send_logon_response().await; + self.try_start_cm(lr.my_id.clone(), lr.my_name.clone(), self.authorized); if self.port_forward_socket.is_some() { return false; } @@ -1666,7 +1666,7 @@ impl Connection { #[cfg(not(any(feature = "flatpak", feature = "appimage")))] self.linux_headless_handle.wait_desktop_cm_ready().await; self.send_logon_response().await; - self.try_start_cm(lr.my_id, lr.my_name, true); + self.try_start_cm(lr.my_id, lr.my_name, self.authorized); if self.port_forward_socket.is_some() { return false; } @@ -1746,8 +1746,8 @@ impl Connection { if let Some((_instant, uuid_old)) = uuid_old { if uuid == uuid_old { self.from_switch = true; - self.try_start_cm(lr.my_id.clone(), lr.my_name.clone(), true); self.send_logon_response().await; + self.try_start_cm(lr.my_id.clone(), lr.my_name.clone(), self.authorized); #[cfg(not(any(target_os = "android", target_os = "ios")))] self.try_start_cm_ipc(); } From 846db4e68920072e27beccfaa48ca9c9a5d9a4f6 Mon Sep 17 00:00:00 2001 From: solokot Date: Sun, 21 Jan 2024 10:19:57 +0300 Subject: [PATCH 2/7] Update ru.rs (#6926) --- src/lang/ru.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lang/ru.rs b/src/lang/ru.rs index aa5cba5f4648..eb349a8182ac 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -23,10 +23,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Remove", "Удалить"), ("Refresh random password", "Обновить случайный пароль"), ("Set your own password", "Установить свой пароль"), - ("Enable keyboard/mouse", "Включить клавиатуру/мышь"), - ("Enable clipboard", "Включить буфер обмена"), - ("Enable file transfer", "Включить передачу файлов"), - ("Enable TCP tunneling", "Включить туннелирование TCP"), + ("Enable keyboard/mouse", "Использовать клавиатуру/мышь"), + ("Enable clipboard", "Использовать буфер обмена"), + ("Enable file transfer", "Использовать передачу файлов"), + ("Enable TCP tunneling", "Использовать туннелирование TCP"), ("IP Whitelisting", "Список разрешённых IP-адресов"), ("ID/Relay Server", "ID/Ретранслятор"), ("Import server config", "Импортировать конфигурацию сервера"), @@ -188,9 +188,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Enter Remote ID", "Введите удалённый ID"), ("Enter your password", "Введите пароль"), ("Logging in...", "Вход..."), - ("Enable RDP session sharing", "Включить общий доступ к сеансу RDP"), + ("Enable RDP session sharing", "Использовать общий доступ к сеансу RDP"), ("Auto Login", "Автоматический вход (действителен только если вы установили \"Завершение пользовательского сеанса после завершения удалённого подключения\""), - ("Enable direct IP access", "Включить прямой IP-доступ"), + ("Enable direct IP access", "Использовать прямой IP-доступ"), ("Rename", "Переименовать"), ("Space", "Место"), ("Create desktop shortcut", "Создать ярлык на рабочем столе"), @@ -315,7 +315,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use permanent password", "Использовать постоянный пароль"), ("Use both passwords", "Использовать оба пароля"), ("Set permanent password", "Установить постоянный пароль"), - ("Enable remote restart", "Включить удалённый перезапуск"), + ("Enable remote restart", "Использовать удалённый перезапуск"), ("Restart remote device", "Перезапустить удалённое устройство"), ("Are you sure you want to restart", "Вы уверены, что хотите выполнить перезапуск?"), ("Restarting remote device", "Перезагрузка удалённого устройства"), @@ -581,11 +581,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("2FA code", "Код 2FA"), ("2fa_tip", "Введите код двухфакторной аутентификации из приложения для аутентификации."), ("More", "Ещё"), - ("enable-2fa-title", ""), - ("enable-2fa-desc", ""), - ("wrong-2fa-code", ""), - ("enter-2fa-title", ""), - ("Email verification code must be 6 characters.", ""), - ("2FA code must be 6 digits.", ""), + ("enable-2fa-title", "Использовать двухфакторную аутентификацию"), + ("enable-2fa-desc", "Настройте приложение аутентификации. Используйте, например, Authy, Microsoft или Google Authenticator, на телефоне или компьютере.\n\nОтсканируйте QR-код с помощью приложения аутентификации и введите код, который отобразит это приложение, чтобы включить двухфакторную аутентификацию."), + ("wrong-2fa-code", "Невозможно подтвердить код. Проверьте код и настройки местного времени."), + ("enter-2fa-title", "Двухфакторная аутентификация"), + ("Email verification code must be 6 characters.", "Код подтверждения электронной почты должен состоять из 6 символов."), + ("2FA code must be 6 digits.", "Код двухфакторной аутентификации должен состоять из 6 цифр."), ].iter().cloned().collect(); } From 8679e55f6aa00ee6661186413c052e65d80b0c54 Mon Sep 17 00:00:00 2001 From: Andrzej Rudnik Date: Sun, 21 Jan 2024 08:21:01 +0100 Subject: [PATCH 3/7] Updated Polish translation (#6929) * Update pl.rs * Update pl.rs * Update pl.rs --------- Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com> From 29eefbcc2516b73c3b363366b77c5398bcca3326 Mon Sep 17 00:00:00 2001 From: Kleofass <4000163+Kleofass@users.noreply.github.com> Date: Sun, 21 Jan 2024 09:21:23 +0200 Subject: [PATCH 4/7] Update lv.rs (#6931) --- src/lang/lv.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lang/lv.rs b/src/lang/lv.rs index 4da64b45f1b3..81aea41b84ce 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -581,11 +581,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("2FA code", "2FA kods"), ("2fa_tip", "Lūdzu, ievadiet savu 2FA kodu autentifikācijas lietotnē."), ("More", "Vairāk"), - ("enable-2fa-title", ""), - ("enable-2fa-desc", ""), - ("wrong-2fa-code", ""), - ("enter-2fa-title", ""), - ("Email verification code must be 6 characters.", ""), - ("2FA code must be 6 digits.", ""), + ("enable-2fa-title", "Iespējot divu faktoru autentifikāciju"), + ("enable-2fa-desc", "Lūdzu, iestatiet savu autentifikatoru tūlīt. Tālrunī vai darbvirsmā varat izmantot autentifikācijas lietotni, piemēram, Authy, Microsoft vai Google Authenticator.\n\nIzmantojot lietotni, skenējiet QR kodu un ievadiet lietotnē parādīto kodu, lai iespējotu divu faktoru autentifikāciju."), + ("wrong-2fa-code", "Nevar pārbaudīt kodu. Pārbaudiet, vai kods un vietējā laika iestatījumi ir pareizi"), + ("enter-2fa-title", "Divu faktoru autentifikācija"), + ("Email verification code must be 6 characters.", "E-pasta verifikācijas kodam jābūt ar 6 rakstzīmēm."), + ("2FA code must be 6 digits.", "2FA kodam ir jābūt ar 6 cipariem."), ].iter().cloned().collect(); } From 28f01784c14e8d71e0ec92fe80a7059f332e66fb Mon Sep 17 00:00:00 2001 From: FastAct <93490087+FastAct@users.noreply.github.com> Date: Sun, 21 Jan 2024 08:21:33 +0100 Subject: [PATCH 5/7] Update nl.rs (#6932) --- src/lang/nl.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 1552ac42227a..4f7495a5a9dd 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -581,11 +581,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("2FA code", "2FA-code"), ("2fa_tip", "Geef je 2FA-code op in de verificatie-app."), ("More", "Meer"), - ("enable-2fa-title", ""), - ("enable-2fa-desc", ""), - ("wrong-2fa-code", ""), - ("enter-2fa-title", ""), - ("Email verification code must be 6 characters.", ""), - ("2FA code must be 6 digits.", ""), + ("enable-2fa-title", "activeer-2fa-titel"), + ("enable-2fa-desc", "activeer-2fa-desc"), + ("wrong-2fa-code", "foutieve-2fa-code"), + ("enter-2fa-title", "geef-2fa-titel in"), + ("Email verification code must be 6 characters.", "E-mailverificatiecode moet 6 tekens lang zijn."), + ("2FA code must be 6 digits.", "2FA-code moet 6 cijfers lang zijn."), ].iter().cloned().collect(); } From cb102a5a61747cafce7085c0ec9d0013490af233 Mon Sep 17 00:00:00 2001 From: fufesou Date: Sat, 20 Jan 2024 23:22:05 -0800 Subject: [PATCH 6/7] Refact. Verification code, keyboardType (#6934) Signed-off-by: fufesou --- flutter/lib/common/widgets/dialog.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart index 58db1047cfa5..b7582c3f1d80 100644 --- a/flutter/lib/common/widgets/dialog.dart +++ b/flutter/lib/common/widgets/dialog.dart @@ -363,6 +363,7 @@ class DialogTextField extends StatelessWidget { final Widget? suffixIcon; final TextEditingController controller; final FocusNode? focusNode; + final TextInputType? keyboardType; final List? inputFormatters; static const kUsernameTitle = 'Username'; @@ -379,6 +380,7 @@ class DialogTextField extends StatelessWidget { this.prefixIcon, this.suffixIcon, this.hintText, + this.keyboardType, this.inputFormatters, required this.title, required this.controller}) @@ -404,6 +406,7 @@ class DialogTextField extends StatelessWidget { focusNode: focusNode, autofocus: true, obscureText: obscureText, + keyboardType: keyboardType, inputFormatters: inputFormatters, ), ), @@ -456,6 +459,7 @@ class Dialog2FaField extends ValidationField { readyCallback: readyCallback, helperText: helperText ?? translate('2fa_tip'), onChanged: _onChanged, + keyboardType: TextInputType.number, inputFormatters: [ FilteringTextInputFormatter.allow(RegExp(r'[0-9]')), ], @@ -528,6 +532,7 @@ class DialogEmailCodeField extends ValidationField { readyCallback: readyCallback, helperText: translate('verification_tip'), onChanged: _onChanged, + keyboardType: TextInputType.visiblePassword, ); } @@ -571,6 +576,7 @@ class DialogVerificationCodeField extends StatefulWidget { this.textLength, this.readyCallback, this.onChanged, + this.keyboardType, this.inputFormatters, }) : super(key: key); @@ -585,6 +591,7 @@ class DialogVerificationCodeField extends StatefulWidget { final VoidCallback? readyCallback; final Function(StateSetter setState, SimpleWrapper errText)? onChanged; + final TextInputType? keyboardType; final List? inputFormatters; @override @@ -646,6 +653,7 @@ class _DialogVerificationCodeField extends State { errorText: widget.errorText ?? errorText.value, focusNode: _focusNode, helperText: widget.helperText, + keyboardType: widget.keyboardType, inputFormatters: widget.inputFormatters, ); } From 5770aeee26b97cdf79f9837b86f6b156e43948ef Mon Sep 17 00:00:00 2001 From: Integral Date: Sat, 20 Jan 2024 23:22:32 -0800 Subject: [PATCH 7/7] Update cn.rs (#6935) --- src/lang/cn.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 2182a0b0a506..e7a8e2b0f50e 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -566,7 +566,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Plug out all", "拔出所有"), ("True color (4:4:4)", "真彩模式(4:4:4)"), ("Enable blocking user input", "允许阻止用户输入"), - ("id_input_tip", ""), + ("id_input_tip", "可以输入 ID、直连 IP,或域名和端口号(<域名>:<端口号>)。\n要访问另一台服务器上的设备,请附加服务器地址(@<服务器地址>?key=<密钥>)。比如,\n9123456234@192.168.16.1:21117?key=5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=。\n要访问公共服务器上的设备,请输入 \"@public\", 无需密钥。"), ("privacy_mode_impl_mag_tip", "模式 1"), ("privacy_mode_impl_virtual_display_tip", "模式 2"), ("Enter privacy mode", "进入隐私模式"), @@ -581,11 +581,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("2FA code", "双重认证代码"), ("2fa_tip", "请输入授权 app 中的双重认证代码"), ("More", "更多"), - ("enable-2fa-title", ""), - ("enable-2fa-desc", ""), - ("wrong-2fa-code", ""), - ("enter-2fa-title", ""), + ("enable-2fa-title", "启用双重认证"), + ("enable-2fa-desc", "现在请设置身份验证器。您可以在手机或台式电脑上使用 Authy、Microsoft 或 Google Authenticator 等验证器。用验证器扫描二维码,然后输入显示的验证码以启用双重认证。"), + ("wrong-2fa-code", "无法验证此验证码。请检查验证码和本地时间设置是否正确。"), + ("enter-2fa-title", "双重认证"), ("Email verification code must be 6 characters.", "Email 验证码必须是 6 个字符。"), - ("2FA code must be 6 digits.", "2FA 码必须是6位数字。"), + ("2FA code must be 6 digits.", "双重认证代码必须是 6 位数字。"), ].iter().cloned().collect(); }