Permalink
Browse files

gateone.js: Added some logic to GateOne.Utils.runPostInit() that dete…

…cts if a given module is an application and registers it accordingly in GateOne.loadedApplications.

gateone.js:  Renamed the 'NAME' variable that gets attached to all objects created with GateOne.Base.update() to '__name__' to clarify that it is meant to be a special-use variable.
gateone.js:  Renamed the 'parent' variable to '__parent__' for the same reason as above.
gateone.js:  Renamed the 'VERSION' variable to '__version__' for the same reason as above (and consistency).
gateone.js:  Added 'viewBox="0 0 18 18"' to all SVG icons so they will scale-to-fit better in certain situations.
gateone.js:  Fixed a bug where GateOne.Visual.slideLeft() would sometimes slide up too.
gateone.js:  Alphabetized GateOne.prefs defaults at the top of the script because I'm a freak like that.
gateone.js:  Implemented a keepalive mechanism that uses GateOne.Net.ping() to determine if the connection to the Gate One server has been lost.
gateone.js:  Added two new preferences:  GateOne.prefs.pingTimeout and GateOne.prefs.keepaliveInterval.  They're both set in milliseconds and control the new keepalive/ping timeout mechanism.  The defaults are 5000 (5 seconds) and 15000 (15 seconds), respectively.  This should resolve issue #217
gateone.js:  Fixed a bug in GateOne.Utils.isVisible() where it would fail to make a correct determination in certain situations (and sometimes cause an exception).
gateone.js:  Made some changes to GateOne.Utils.getEmDimensions() in order to make it more reliable in certain situations.
gateone.js:  Made some changes to GateOne.Utils.getRowsAndColumns() in order to make it work on elements that are not (currently) visible.
gateone.js:  Fixed a bug in GateOne.Events.off() where it was referencing an undefined variable (self) causing an exception (most commonly happened in conjunction with once()).
terminal.js:  newTerminal() now passes a 'termUndefined' variable when triggering the 'terminal:new_terminal' event so functions attached to that event can tell if this terminal is new or was merely re-created from an existing session (e.g. user reloads the page or reconnects).  e.g. trigger("terminal:new_terminal", term, termUndefined).
Themes:  Just a few tweaks here and there to the new prefs panel stuff.
SSH Plugin:  Fixed the bug where autoConnectURL was not working.  This should close issue #226.
  • Loading branch information...
1 parent 4c9613a commit 0833151d7345829cd700d535a129a7464604f396 @liftoff committed Mar 22, 2013
@@ -124,7 +124,7 @@ go.Base.update(go.SSH, {
go.Input.registerShortcut('KEY_D', {'modifiers': {'ctrl': true, 'alt': true, 'meta': false, 'shift': false}, 'action': 'GateOne.SSH.duplicateSession(localStorage[GateOne.prefs.prefix+"selectedTerminal"])'});
}
},
- autoConnect: function() {
+ autoConnect: function(term, termUndefined) {
/**:GateOne.SSH.autoConnect()
Automatically connects to `GateOne.prefs.autoConnectURL` if it set.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -25,13 +25,13 @@
word-wrap: break-word;
white-space: pre-wrap;
display: block;
- width: calc(100% - 2em);
+/* width: calc(100% - 2em); */
}
#{{container}} .terminal span.scrollback {
word-wrap: break-word;
white-space: pre-wrap;
display: block;
- width: calc(100% - 3.5em);
+/* width: calc(100% - 3.5em); */
}
#{{container}} .terminal span.termline {
width: 100%;
@@ -1,8 +1,9 @@
/* Terminal black theme */
#{{container}} .terminal {
line-height: 1;
- position: static;
- float: left;
+ height: 100%; /* NOTE: This is important for the getRowsAndColumns() calculation */
+ width: calc(100% - 2em);
+ position: absolute;
-webkit-transition: -webkit-transform 1s ease-in-out;
-moz-transition: -moz-transform 1s ease-in-out;
-ms-transition: -ms-transform 1s ease-in-out;
@@ -21,10 +22,12 @@
color: #eee;
font-size: 0.9em; /* For some reason when you use a .woff font it seems to show up slightly larger than it would normally */
line-height: 1;
- width: 100%;
+/* width: calc(100% - 2em); */
overflow-y: auto;
overflow-x: hidden;
position: absolute;
+ left: 0;
+ right: 0;
bottom: 0;
margin: 0;
padding: 0;
@@ -1,8 +1,8 @@
/* Terminal dark-black theme */
#{{container}} .terminal {
line-height: 1;
- position: static;
- float: left;
+ height: 100%; /* NOTE: This is important for the getRowsAndColumns() calculation */
+ position: absolute;
-webkit-transition: -webkit-transform 1s ease-in-out;
-moz-transition: -moz-transform 1s ease-in-out;
-ms-transition: -ms-transform 1s ease-in-out;
@@ -21,11 +21,12 @@
color: #fff;
font-size: 0.9em; /* For some reason when you use a .woff font it seems to show up slightly larger than it would normally */
line-height: 1;
- /*height: auto;*/ /* Needs to be 100% when scrollback is enabled */
- width: 100%;
+ width: calc(100% - 2em);
overflow-y: auto;
overflow-x: hidden;
position: absolute;
+ left: 0;
+ right: 0;
bottom: 0;
margin: 0;
padding: 0;
@@ -1,10 +1,10 @@
/* Terminal solarized theme */
#{{container}} .terminal {
line-height: 1;
+ height: 100%; /* NOTE: This is important for the getRowsAndColumns() calculation */
+ position: absolute;
* { color:#839496; }
h1,h2,h3,h4,h5,h6 { color:#93a1a1; border-color: #839496; }
- position: static;
- float: left;
-webkit-transition: -webkit-transform 1s ease-in-out;
-moz-transition: -moz-transform 1s ease-in-out;
-ms-transition: -ms-transform 1s ease-in-out;
@@ -23,10 +23,12 @@
color: #839496;
font-size: 0.9em; /* For some reason when you use a .woff font it seems to show up slightly larger than it would normally */
line-height: 1;
- width: 100%;
+ width: calc(100% - 2em);
overflow-y: auto;
overflow-x: hidden;
position: absolute;
+ left: 0;
+ right: 0;
bottom: 0;
margin: 0;
padding: 0;
@@ -1,8 +1,8 @@
/* Terminal white theme */
#{{container}} .terminal {
line-height: 1;
- position:static;
- float: left;
+ height: 100%; /* NOTE: This is important for the getRowsAndColumns() calculation */
+ position: absolute;
-webkit-transition: -webkit-transform 1s ease-in-out;
-moz-transition: -moz-transform 1s ease-in-out;
-ms-transition: -ms-transform 1s ease-in-out;
@@ -21,10 +21,12 @@
color: #000;
font-size: 0.9em; /* For some reason when you use a .woff font it seems to show up slightly larger than it would normally */
line-height: 1;
- width: 100%;
+ width: calc(100% - 2em);
overflow-y: auto;
overflow-x: hidden;
position: absolute;
+ left: 0;
+ right: 0;
bottom: 0;
margin: 0;
padding: 0;
View
@@ -1470,29 +1470,7 @@ def authenticate(self, settings):
message = {'go:set_username': self.current_user['upn']}
self.write_message(json_encode(message))
# Tell the client which applications are available
- enabled_applications = policy.get('enabled_applications', [])
- if not enabled_applications:
- for app in self.apps: # Use the app's name attribute
- name = str(app)
- if hasattr(app, 'name'):
- name = app.name
- enabled_applications.append(name)
- # I've been using these for testing stuff... Ignore
- #enabled_applications.append("Bookmarks")
- #enabled_applications.append("Terminal: Nethack")
- #enabled_applications.append("Terminal: Login")
- #enabled_applications.append("Admin")
- #enabled_applications.append("IRC")
- #enabled_applications.append("Log Viewer")
- #enabled_applications.append("Help")
- #enabled_applications.append("X11 Desktop")
- #enabled_applications.append("RDP")
- #enabled_applications.append("VNC")
- enabled_applications.sort()
- # Use this user's specific allowed list of applications if possible:
- user_apps = policy.get('user_applications', enabled_applications)
- message = {'go:applications': user_apps}
- self.write_message(json_encode(message))
+ self.list_applications()
# Startup the session watcher if it isn't already running
global SESSION_WATCHER
if not SESSION_WATCHER:
@@ -1530,6 +1508,35 @@ def authenticate(self, settings):
cls.file_watcher.start()
self.trigger('go:authenticate')
+ def list_applications(self):
+ """
+ Sends a message to the client indiciating which applications are
+ available to the user.
+ """
+ policy = applicable_policies("gateone", self.current_user, self.prefs)
+ enabled_applications = policy.get('enabled_applications', [])
+ if not enabled_applications:
+ for app in self.apps: # Use the app's name attribute
+ name = str(app)
+ if hasattr(app, 'name'):
+ name = app.name
+ enabled_applications.append(name)
+ # I've been using these for testing stuff... Ignore
+ enabled_applications.append("Bookmarks")
+ enabled_applications.append("Terminal: Nethack")
+ enabled_applications.append("Terminal: Login")
+ enabled_applications.append("Admin")
+ enabled_applications.append("IRC")
+ enabled_applications.append("Log Viewer")
+ enabled_applications.append("Help")
+ enabled_applications.append("RDP")
+ enabled_applications.append("VNC")
+ enabled_applications.sort()
+ # Use this user's specific allowed list of applications if possible:
+ user_apps = policy.get('user_applications', enabled_applications)
+ message = {'go:applications': user_apps}
+ self.write_message(json_encode(message))
+
def render_style(self, style_path, **kwargs):
"""
Renders the CSS template at *style_path* using *kwargs* and returns the
View
@@ -165,8 +165,9 @@ def auth_negotiate(self, auth_header, callback):
except kerberos.GSSError as e:
logging.error(_("Kerberos Error: %s" % e))
raise tornado.web.HTTPError(500, _("Kerberos Init failed"))
+ finally:
+ kerberos.authGSSServerClean(context)
self.set_header('WWW-Authenticate', "Negotiate %s" % gssstring)
- kerberos.authGSSServerClean(context)
callback(user)
def auth_basic(self, auth_header, callback):
Oops, something went wrong.

0 comments on commit 0833151

Please sign in to comment.