[X2Go-Commits] pyhoca-gui.git - twofactorauth (branch) updated: 0.0.34.0-27-gacaeaf5

X2Go dev team git-admin at x2go.org
Sat Sep 14 15:55:04 CEST 2013


The branch, twofactorauth has been updated
       via  acaeaf5df8984dc7e822101e23793f1935c25c2a (commit)
      from  d8d31675fb3ef71effe21b559f937d3ad2c6a2cb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 pyhoca/wxgui/frontend.py       |    1 -
 pyhoca/wxgui/profilemanager.py |   61 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 55 insertions(+), 7 deletions(-)

The diff of changes is:
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index 64a28c6..abede9e 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -179,7 +179,6 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         STILL UNDOCUMENTED
 
         """
-
         # cmd line options
         self.start_on_connect = self.args.start_on_connect
         self.resume_newest_on_connect = self.args.resume_newest_on_connect
diff --git a/pyhoca/wxgui/profilemanager.py b/pyhoca/wxgui/profilemanager.py
index 49dd114..bb1fd3b 100644
--- a/pyhoca/wxgui/profilemanager.py
+++ b/pyhoca/wxgui/profilemanager.py
@@ -270,6 +270,8 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         self.Bind(wx.EVT_BUTTON, self.OnSSHKeyFileBrowse, self.SSHKeyFileBrowseButton)
         self.Bind(wx.EVT_BUTTON, self.OnSSHProxyKeyFileBrowse, self.SSHProxyKeyFileBrowseButton)
         self.Bind(wx.EVT_CHECKBOX, self.OnUseSSHProxy, self.UseSSHProxy)
+        self.Bind(wx.EVT_TEXT, self.OnUpdateSSHProxyTunnelFromHost, self.SSHProxyTunnelFromHost)
+        self.Bind(wx.EVT_TEXT, self.OnUpdateSSHProxyTunnelFromPort, self.SSHProxyTunnelFromPort)
         self.Bind(wx.EVT_RADIOBUTTON, self.OnSetDisplayFullscreen, self.DisplayTypeFullscreen)
         self.Bind(wx.EVT_RADIOBUTTON, self.OnSetDisplayCustom, self.DisplayTypeCustom)
         self.Bind(wx.EVT_CHECKBOX, self.OnSetDisplayDPI, self.SetDisplayDPI)
@@ -709,6 +711,12 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
             self.SSHProxyTunnelBetweenLabel.Enable(True)
             self.SSHProxyTunnelToHost.Enable(True)
             self.SSHProxyTunnelToPort.Enable(True)
+            self.Host.Enable(False)
+            self.HostLabel.Enable(False)
+            self.Host.SetValue(self.SSHProxyTunnelFromHost.GetValue())
+            self.SSHPort.Enable(False)
+            self.SSHPortLabel.Enable(False)
+            self.SSHPort.SetValue(self.SSHProxyTunnelFromPort.GetValue())
         else:
             self.SSHProxyHostLabel.Enable(False)
             self.SSHProxyHost.Enable(False)
@@ -723,6 +731,12 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
             self.SSHProxyTunnelBetweenLabel.Enable(False)
             self.SSHProxyTunnelToHost.Enable(False)
             self.SSHProxyTunnelToPort.Enable(False)
+            self.Host.Enable(True)
+            self.HostLabel.Enable(True)
+            self.Host.SetValue(self.profile_config_bak['host'])
+            self.SSHPort.Enable(True)
+            self.SSHPortLabel.Enable(True)
+            self.SSHPort.SetValue(self.profile_config_bak['sshport'])
 
         _command = self.profile_config['command']
 
@@ -911,14 +925,16 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
     def __update_from_screen(self):
         self.profile_config['name'] = self.ProfileName.GetValue()
         self.profile_config['icon'] = self.IconPath
-        self.profile_config['host'] = self.Host.GetValue()
         self.profile_config['user'] = self.UserName.GetValue()
-        self.profile_config['sshport'] = self.SSHPort.GetValue()
         self.profile_config['key'] = self.SSHKeyFile.GetValue()
         if self.UseSSHProxy.GetValue():
             self.profile_config['usesshproxy'] = True
+            self.profile_config['host'] = self.SSHProxyTunnelFromHost.GetValue()
+            self.profile_config['sshport'] = self.SSHProxyTunnelFromPort.GetValue()
         else:
             self.profile_config['usesshproxy'] = False
+            self.profile_config['host'] = self.Host.GetValue()
+            self.profile_config['sshport'] = self.SSHPort.GetValue()
         self.profile_config['sshproxyhost'] = self.SSHProxyHost.GetValue()
         self.profile_config['sshproxyuser'] = self.SSHProxyUser.GetValue()
         self.profile_config['sshproxytunnel'] = '%s:%s:%s:%s' % (self.SSHProxyTunnelFromHost.GetValue(),
@@ -1045,10 +1061,11 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
 
 
     def disable_DirectRDP(self):
-        self.HostLabel.Enable(True)
-        self.Host.Enable(True)
-        self.SSHPortLabel.Enable(True)
-        self.SSHPort.Enable(True)
+        if not self.UseSSHProxy.GetValue():
+            self.HostLabel.Enable(True)
+            self.Host.Enable(True)
+            self.SSHPortLabel.Enable(True)
+            self.SSHPort.Enable(True)
         self.SSHKeyFileLabel.Enable(True)
         self.SSHKeyFile.Enable(True)
         self.staticbox_LinkSpeed.Enable(True)
@@ -1158,6 +1175,12 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
             self.SSHProxyTunnelFromPort.Enable(True)
             self.SSHProxyTunnelToHost.Enable(True)
             self.SSHProxyTunnelToPort.Enable(True)
+            self.Host.Enable(False)
+            self.HostLabel.Enable(False)
+            self.Host.SetValue(self.SSHProxyTunnelFromHost.GetValue())
+            self.SSHPort.Enable(False)
+            self.SSHPortLabel.Enable(False)
+            self.SSHPort.SetValue(self.SSHProxyTunnelFromPort.GetValue())
         else:
             self.SSHProxyHostLabel.Enable(False)
             self.SSHProxyHost.Enable(False)
@@ -1172,6 +1195,16 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
             self.SSHProxyTunnelBetweenLabel.Enable(False)
             self.SSHProxyTunnelToHost.Enable(False)
             self.SSHProxyTunnelToPort.Enable(False)
+            self.Host.Enable(True)
+            self.HostLabel.Enable(True)
+            self.SSHPort.Enable(True)
+            self.SSHPortLabel.Enable(True)
+
+    def OnUpdateSSHProxyTunnelFromHost(self, event):
+        self.Host.SetValue(self.SSHProxyTunnelFromHost.GetValue())
+
+    def OnUpdateSSHProxyTunnelFromPort(self, event):
+        self.SSHPort.SetValue(self.SSHProxyTunnelFromPort.GetValue())
 
     def OnKeepKeyboard(self, event):
         if self.CurrentKeyBoard.GetValue():
@@ -1340,6 +1373,22 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         elif self.profile_config['name'].strip() != self.profile_config_bak['name'] and self.profile_config['name'] in self.session_profiles.profile_names:
             validateOk = False
             self._PyHocaGUI.notifier.send(title=_(u'Profile Manager'), text=_(u'Profile name %s already exists!!!' % self.profile_config['name'].strip()), icon='profile_error')
+        elif self.profile_config['usesshproxy']:
+            print self.profile_config['sshproxytunnel'].split(':')[0:2]
+            try:
+                (from_host, from_port) = self.profile_config['sshproxytunnel'].split(':')[0:2]
+            except ValueError:
+                self._PyHocaGUI.notifier.send(title=_(u'Profile Manager'), text=_(u'The SSH proxy configuration is incomplete. Try again.'), icon='profile_error')
+            for profile_name in [ p for p in self._PyHocaGUI.profile_names if p != self.profile_config['name'] ]:
+                test_profile_config = self.session_profiles.get_profile_config(profile_name)
+                if test_profile_config['usesshproxy']:
+                    try:
+                        (test_from_host, test_from_port) = test_profile_config['sshproxytunnel'].split(':')[0:2]
+                    except ValueError:
+                        continue
+                    if (from_host, from_port) == (test_from_host, test_from_port):
+                        validateOk = False
+                        self._PyHocaGUI.notifier.send(title=_(u'Profile Manager'), text=_(u'Another session profile (%s) already uses [%s]:%s for binding a local SSH proxy to.\nPlease change the SSH proxy settings accordingly.' % (profile_name.strip(), from_host, from_port)), icon='profile_warning')
         return validateOk
 
     def OnOKButton(self, event):


hooks/post-receive
-- 
pyhoca-gui.git (Python X2Go Client (wxPython GUI))

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "pyhoca-gui.git" (Python X2Go Client (wxPython GUI)).




More information about the x2go-commits mailing list