[X2Go-Commits] [x2goserver] 01/02: Make it possible to change the state of shadow sessions.
git-admin at x2go.org
git-admin at x2go.org
Thu Feb 5 10:49:42 CET 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2goserver.
commit e4aa0850c984cab1c003f319c728ee33acec99d6
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Thu Feb 5 10:21:42 2015 +0100
Make it possible to change the state of shadow sessions.
---
X2Go/Server/DB/SQLite3.pm | 9 ++++++++-
debian/changelog | 1 +
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/X2Go/Server/DB/SQLite3.pm b/X2Go/Server/DB/SQLite3.pm
index 5e73e56..2acb0b6 100644
--- a/X2Go/Server/DB/SQLite3.pm
+++ b/X2Go/Server/DB/SQLite3.pm
@@ -395,9 +395,16 @@ sub db_changestatus
my $sid=shift or die "argument \"session_id\" missed";
$sid = sanitizer('x2gosid', $sid) or die "argument \"session_id\" malformed";
check_user($sid);
+
+ # we need to be able to change the state of normal sessions ($realuser == $effective_user)
+ # _and_ desktop sharing session ($realuser != $effective_user). Thus, extracting the effective
+ # username from the session ID...
+ my $effective_user = $sid;
+ $effective_user =~ s/\-[0-9]+\-[0-9]{10}_.*//;
+
my $sth=$dbh->prepare("update sessions set last_time=datetime('now','localtime'),
status=? where session_id = ? and uname=?");
- $sth->execute($status, $sid, $realuser);
+ $sth->execute($status, $sid, $effective_user);
if ($sth->err())
{
syslog('error', "changestatus (SQLite3 session db backend) failed with exitcode: $sth->err()");
diff --git a/debian/changelog b/debian/changelog
index 3268e3c..6c6582a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -63,6 +63,7 @@ x2goserver (4.1.0.0-0x2go1.1) UNRELEASED; urgency=low
parentheses.
- Make sure to return "1" in X2Go::Server::DB Perl functions that don't
return anything by default.
+ - Make it possible to change the state of shadow sessions.
* debian/control:
+ Package X2Go::Log in separate package: libx2go-log-perl.
+ Package X2Go::Server::DB in separate package: libx2go-server-db-perl.
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
More information about the x2go-commits
mailing list