This commit is contained in:
rustdesk 2024-04-09 18:34:44 +08:00
parent cf8386aa50
commit 07eca00bd5
44 changed files with 53 additions and 0 deletions

View File

@ -835,6 +835,10 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
...directIp(context),
whitelist(),
...autoDisconnect(context),
if (bind.mainIsInstalled())
_OptionCheckBox(context, 'allow-only-conn-window-open-tip',
'allow-only-conn-window-open',
reverse: false, enabled: enabled),
]);
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "上述的字段為共享且对其他人可见。"),
("Everyone", "所有人"),
("ab_web_console_tip", "打开 Web 控制台以执行更多操作"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "Výše uvedená pole jsou sdílená a viditelná pro ostatní."),
("Everyone", "Každý"),
("ab_web_console_tip", "Více na webové konzoli"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "Die obigen Felder werden geteilt und sind für andere sichtbar."),
("Everyone", "Jeder"),
("ab_web_console_tip", "Mehr über Webkonsole"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -218,5 +218,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("preset_password_warning", "This customized edition comes with a preset password. Anyone knowing this password could gain full control of your device. If you did not expect this, uninstall the software immediately."),
("share_warning_tip", "The fields above are shared and visible to others."),
("ab_web_console_tip", "More on web console"),
("allow-only-conn-window-open-tip", "Only allow connection if RustDesk window is open"),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "Los campos mostrados arriba son compartidos y visibles por otros."),
("Everyone", "Todos"),
("ab_web_console_tip", "Más en consola web"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "فیلدهای بالا به اشتراک گذاشته شده و برای دیگران قابل مشاهده است"),
("Everyone", "هر کس"),
("ab_web_console_tip", "اطلاعات بیشتر در کنسول وب"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "Gornja polja su podijeljena i vidljiva drugima."),
("Everyone", "Svatko"),
("ab_web_console_tip", "Više na web konzoli"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "I campi sopra indicati sono condivisi e visibili ad altri."),
("Everyone", "Everyone"),
("ab_web_console_tip", "Altre info sulla console web"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "Iepriekš minētie lauki ir koplietoti un redzami citiem."),
("Everyone", "Visi"),
("ab_web_console_tip", "Vairāk par tīmekļa konsoli"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "De bovenstaande velden worden gedeeld en zijn zichtbaar voor anderen."),
("Everyone", "Iedereen"),
("ab_web_console_tip", "Meer over de webconsole"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", "Todos"),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "Поля выше являются общими и видны другим."),
("Everyone", "Все"),
("ab_web_console_tip", "Больше в веб-консоли"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "Vyššie uvedené polia sú zdieľané a viditeľné pre ostatných."),
("Everyone", "Každý"),
("ab_web_console_tip", "Viac na webovej konzole"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "上述的欄位為共享且對其他人可見。"),
("Everyone", "所有人"),
("ab_web_console_tip", "打開 Web 控制台以進行更多操作"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", "Поля вище є спільними та видимі для інших."),
("Everyone", "Всі"),
("ab_web_console_tip", "Детальніше про веб-консоль"),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -600,5 +600,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("share_warning_tip", ""),
("Everyone", ""),
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
].iter().cloned().collect();
}

View File

@ -956,6 +956,13 @@ impl Connection {
if !self.check_whitelist(&addr).await {
return false;
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
if crate::is_server() && Config::get_option("allow-only-conn-window-open") == "Y" {
if crate::check_process("", false) {
self.send_login_error("The main window is not open").await;
return false;
}
}
self.ip = addr.ip().to_string();
let mut msg_out = Message::new();
msg_out.set_hash(self.hash.clone());