aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2014-11-02 20:45:23 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2014-11-02 20:45:23 +0100
commitd8d094ddbe0fb9ab86ecd33f6cdd056d8b1ce9f2 (patch)
treea5c9a598350664e0734fd145e7a0db5d35875caf /src
parentb9ad4d789d0ed95cda227e753a7927ad9a4340cc (diff)
downloadremote-logon-service-d8d094ddbe0fb9ab86ecd33f6cdd056d8b1ce9f2.tar.gz
remote-logon-service-d8d094ddbe0fb9ab86ecd33f6cdd056d8b1ce9f2.tar.bz2
remote-logon-service-d8d094ddbe0fb9ab86ecd33f6cdd056d8b1ce9f2.zip
upload to ppa:x2go/stable+ppa (ubuntu/1.0.0-0ubuntu3+x2go1~0ubuntu14.04.1)
* Non-maintainer upload. * Add SERVER_NAME env var support. * Add X2Go support to RLS. * Provide via ppa:x2go/ppa and ppa:x2go/stable on Launchpad.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/com.canonical.RemoteLogin.xml12
-rw-r--r--src/defines.h3
-rw-r--r--src/main.c3
-rw-r--r--src/server.c6
-rw-r--r--src/uccs-server.c7
6 files changed, 28 insertions, 5 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a402870..b5f5d5b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,6 +36,8 @@ libservers_la_SOURCES = \
citrix-server.h \
rdp-server.c \
rdp-server.h \
+ x2go-server.c \
+ x2go-server.h \
uccs-server.c \
uccs-server.h \
defines.h \
diff --git a/src/com.canonical.RemoteLogin.xml b/src/com.canonical.RemoteLogin.xml
index 0fec355..f0d8cb1 100644
--- a/src/com.canonical.RemoteLogin.xml
+++ b/src/com.canonical.RemoteLogin.xml
@@ -2,19 +2,21 @@
<node name="/">
<interface name="com.canonical.RemoteLogin">
<!-- SERVER LIST DOCS - it's in a few places :-)
- s: server type: "ica", "freerdp", "uccs"
+ s: server type: "ica", "freerdp", "x2go", "uccs"
s: server name
s: server uri
b: last used server
a(sbva{sv}): properties for the server
- s: type: "username", "password", "domain", "email"
+ s: type: "username", "password", "domain", "email", "sessiontype"
b: required
v: default value
- a{sv}: properties for the value, currently only used for domains
- that have a list of possible domains
+ a{sv}: properties for the value
+ for value 'domain': a list of possible domains (ica, freerdp)
"domains": a(s)
- and domains that are read only
+ for value 'domain': a list of domains that are read only
"read-only": b
+ for value 'sessiontype': TODO -> a subset of session profile parameters...
+ "nothing-yet": s
a(si): applications pinned for the server
s: ID of the application (desktop file)
i: position the application is pinned in
diff --git a/src/defines.h b/src/defines.h
index e815ca5..e205d2c 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -34,6 +34,7 @@
#define CONFIG_SERVER_TYPE "Type"
#define CONFIG_SERVER_TYPE_RDP "RDP"
#define CONFIG_SERVER_TYPE_ICA "ICA"
+#define CONFIG_SERVER_TYPE_X2GO "X2GO"
#define CONFIG_SERVER_TYPE_UCCS "UCCS"
#define JSON_PROTOCOL "Protocol"
@@ -43,5 +44,7 @@
#define JSON_PASSWORD "Password"
#define JSON_DOMAIN_REQ "DomainRequired"
#define JSON_DOMAIN "WindowsDomain"
+#define JSON_SESSIONTYPE "SessionType"
+#define JSON_SESSIONTYPE_REQ "SessionTypeRequired"
#endif /* __DEFINES_H__ */
diff --git a/src/main.c b/src/main.c
index b6d56d4..74e09e0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,6 +33,7 @@
#include "rdp-server.h"
#include "citrix-server.h"
#include "uccs-server.h"
+#include "x2go-server.h"
#include "crypt.h"
gint server_list_to_array (GVariantBuilder * builder, GList * items);
@@ -387,8 +388,10 @@ main (int argc, char * argv[])
{
GError * error = NULL;
+#if !GLIB_CHECK_VERSION (2, 35, 1)
/* Init the GTypes */
g_type_init();
+#endif
/* Setup i18n */
setlocale (LC_ALL, "");
diff --git a/src/server.c b/src/server.c
index 2f36898..551aa99 100644
--- a/src/server.c
+++ b/src/server.c
@@ -25,6 +25,7 @@
#include "citrix-server.h"
#include "rdp-server.h"
#include "uccs-server.h"
+#include "x2go-server.h"
static void server_class_init (ServerClass *klass);
static void server_init (Server *self);
@@ -162,6 +163,9 @@ server_new_from_json (JsonObject * object)
else if (g_strcmp0(proto, "freerdp") == 0 || g_strcmp0(proto, "rdp") == 0 || g_strcmp0(proto, "RDP") == 0 || g_strcmp0(proto, "FreeRDP") == 0) {
newserver = rdp_server_new_from_json(object);
}
+ else if (g_strcmp0(proto, "x2go") == 0 || g_strcmp0(proto, "X2go") == 0 || g_strcmp0(proto, "X2Go") == 0 || g_strcmp0(proto, "X2GO") == 0 || g_strcmp0(proto, "x2GO") == 0 || g_strcmp0(proto, "x2gO") == 0) {
+ newserver = x2go_server_new_from_json(object);
+ }
return newserver;
}
@@ -184,6 +188,8 @@ server_get_variant (Server * server)
g_variant_builder_add_value(&tuple, g_variant_new_string("freerdp"));
} else if (IS_UCCS_SERVER(server)) {
g_variant_builder_add_value(&tuple, g_variant_new_string("uccs"));
+ } else if (IS_X2GO_SERVER(server)) {
+ g_variant_builder_add_value(&tuple, g_variant_new_string("x2go"));
} else {
g_assert_not_reached();
}
diff --git a/src/uccs-server.c b/src/uccs-server.c
index c17cf38..52fc301 100644
--- a/src/uccs-server.c
+++ b/src/uccs-server.c
@@ -20,6 +20,7 @@
#include "config.h"
#endif
+#include <glib.h>
#include <glib/gi18n.h>
#include <json-glib/json-glib.h>
@@ -466,6 +467,10 @@ uccs_server_new_from_keyfile (GKeyFile * keyfile, const gchar * groupname)
static gboolean
parse_rds_array (UccsServer * server, JsonArray * array)
{
+ // Got a new set of servers, delete the old one
+ g_list_free_full(server->subservers, g_object_unref);
+ server->subservers = NULL;
+
int i;
for (i = 0; i < json_array_get_length(array); i++) {
JsonNode * node = json_array_get_element(array, i);
@@ -730,6 +735,8 @@ uccs_server_unlock (UccsServer * server, const gchar * address, const gchar * us
argv[1] = server->username;
argv[2] = NULL;
+ g_setenv("SERVER_ROOT", server->parent.uri, TRUE);
+
g_spawn_async_with_pipes(NULL, /* pwd */
(gchar **)argv,
NULL, /* env */