From ad6fee422a519c738269f62650ff2d00e73ee7bd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 May 2013 16:36:51 -0400 Subject: [PATCH] fix warning --- Assistant/WebApp/Configurators/Ssh.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Assistant/WebApp/Configurators/Ssh.hs b/Assistant/WebApp/Configurators/Ssh.hs index c3edbd3912..dbc27c643e 100644 --- a/Assistant/WebApp/Configurators/Ssh.hs +++ b/Assistant/WebApp/Configurators/Ssh.hs @@ -65,7 +65,13 @@ sshInputAForm hostnamefield def = SshInput <*> aopt textField "Directory" (Just $ Just $ fromMaybe (T.pack gitAnnexAssistantDefaultDir) $ inputDirectory def) <*> areq intField "Port" (Just $ inputPort def) where + check_username = checkBool (all (`notElem` "/:@ \t") . T.unpack) + bad_username textField + #ifndef __ANDROID__ + bad_hostname = "cannot resolve host name" :: Text + bad_username = "bad user name" :: Text + check_hostname = checkM (liftIO . checkdns) hostnamefield checkdns t = do let h = T.unpack t @@ -83,12 +89,6 @@ sshInputAForm hostnamefield def = SshInput check_hostname = hostnamefield -- unchecked #endif - check_username = checkBool (all (`notElem` "/:@ \t") . T.unpack) - bad_username textField - - bad_hostname = "cannot resolve host name" :: Text - bad_username = "bad user name" :: Text - data ServerStatus = UntestedServer | UnusableServer Text -- reason why it's not usable