[X2Go-Commits] [x2gobroker] 01/01: Session profiles with marker user=BROKER_USER will now auto-fill-in the broker username into the session profile's 'user' option.

git-admin at x2go.org git-admin at x2go.org
Mon Mar 17 13:15:25 CET 2014


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gobroker.

commit bb399c5aca41d61d030603aad73415e6598c2e13
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Mar 17 13:14:13 2014 +0100

    Session profiles with marker user=BROKER_USER will now auto-fill-in the broker username into the session profile's 'user' option.
---
 debian/changelog                           |    2 ++
 etc/broker/x2gobroker-sessionprofiles.conf |    3 +--
 x2gobroker/brokers/base_broker.py          |    2 ++
 x2gobroker/defaults.py                     |    2 +-
 x2gobroker/web/plain.py                    |    2 --
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b9eb459..38fcf0c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -96,6 +96,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low
     - Store cookies in /var/lib/x2gobroker (path is more appropriate than
       previously suggested path /var/log/x2gobroker).
     - Handle selectsessions calls with a non-existent profile ID gracefully.
+    - Session profiles with marker user=BROKER_USER will now auto-fill-in the broker
+      username into the session profile's 'user' option.
   * debian/control:
     + Replace LDAP support with session brokerage support in LONG_DESCRIPTION.
     + Fix SYNOPSIS texts.
diff --git a/etc/broker/x2gobroker-sessionprofiles.conf b/etc/broker/x2gobroker-sessionprofiles.conf
index 227a5ca..522e917 100644
--- a/etc/broker/x2gobroker-sessionprofiles.conf
+++ b/etc/broker/x2gobroker-sessionprofiles.conf
@@ -61,16 +61,15 @@ sshport=22
 setdpi=0
 pack=16m-jpeg
 directrdp=false
+user=BROKER_USER
 
 [localhost-kde]
 name=KDE - localhost
-user=
 host=localhost
 command=KDE
 
 [localhost-mate]
 name=MATE - localhost
-user=
 host=localhost
 command=MATE
 
diff --git a/x2gobroker/brokers/base_broker.py b/x2gobroker/brokers/base_broker.py
index c3383f5..ad49ef7 100644
--- a/x2gobroker/brokers/base_broker.py
+++ b/x2gobroker/brokers/base_broker.py
@@ -909,6 +909,8 @@ class X2GoBroker(object):
             for key in profile.keys():
                 if key.startswith('host='):
                     del profile[key]
+                if key == 'user' and profile[key] == 'BROKER_USER':
+                    profile[key] = username
 
             if self.get_session_autologin(profile_id):
                 profile['autologin'] = True
diff --git a/x2gobroker/defaults.py b/x2gobroker/defaults.py
index a652837..0cdc323 100644
--- a/x2gobroker/defaults.py
+++ b/x2gobroker/defaults.py
@@ -277,7 +277,7 @@ X2GOBROKER_SESSIONPROFILE_DEFAULTS = {
         u'sshport': 22,
         u'setdpi': 0,
         u'pack': u'16m-jpeg',
-        u'user': '',
+        u'user': 'BROKER_USER',
         u'host': [ u'localhost', ],
         u'directrdp': False,
         u'acl-users-allow': [],
diff --git a/x2gobroker/web/plain.py b/x2gobroker/web/plain.py
index dcf853b..f9e8531 100644
--- a/x2gobroker/web/plain.py
+++ b/x2gobroker/web/plain.py
@@ -174,8 +174,6 @@ class X2GoBrokerWeb(_RequestHandler):
                     for profile_id in profile_ids:
                         output += "[{profile_id}]\n".format(profile_id=profile_id)
                         for key in profiles[profile_id].keys():
-                            if key == u'user' and not profiles[profile_id][key]:
-                                profiles[profile_id][key] = username
                             if type(profiles[profile_id][key]) in (types.UnicodeType, types.StringType):
                                 output += "{key}={value}".format(key=key, value=unicode(profiles[profile_id][key]))
                             elif type(profiles[profile_id][key]) in (types.ListType, types.TupleType):

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git



More information about the x2go-commits mailing list