[X2Go-Commits] x2goserver.git - build-main (branch) updated: 3.0.99-2-3-g17f0a8f
X2Go dev team
git-admin at x2go.org
Wed Dec 4 06:17:20 CET 2013
The branch, build-main has been updated
via 17f0a8f6d633ba495a2f22f9fbe0d99ceff212a4 (commit)
from 69ac55d8535d748d4477a99583ab5cf0b762ccda (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 -----------------------------------------------------------------
commit 17f0a8f6d633ba495a2f22f9fbe0d99ceff212a4
Author: Alexander Wuerstlein <arw at arw.name>
Date: Tue Feb 15 13:00:45 2011 +0100
cleanup c&p-code
-----------------------------------------------------------------------
Summary of changes:
x2gosqlitewrapper | 60 +++++++++++++++++------------------------------------
1 file changed, 19 insertions(+), 41 deletions(-)
The diff of changes is:
diff --git a/x2gosqlitewrapper b/x2gosqlitewrapper
index b085cf9..b6a7156 100755
--- a/x2gosqlitewrapper
+++ b/x2gosqlitewrapper
@@ -42,14 +42,7 @@ elsif($cmd eq "listsessionsroot")
strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions
where server='$server' order by status desc");
$sth->execute() or die;
- my @data;
- my $i=0;
- while (@data = $sth->fetchrow_array)
- {
- @strings[$i++]=join('|', at data);
- }
- $sth->finish();
- print join("\n", at strings);
+ fetchrow_printall_array($sth);
}
elsif($cmd eq "listsessionsroot_all")
@@ -64,14 +57,7 @@ elsif($cmd eq "listsessionsroot_all")
strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions
order by status desc");
$sth->execute()or die;
- my @data;
- my $i=0;
- while (@data = $sth->fetchrow_array)
- {
- @strings[$i++]=join('|', at data);
- }
- $sth->finish();
- print join("\n", at strings);
+ fetchrow_printall_array($sth);
}
elsif($cmd eq "getmounts")
@@ -80,15 +66,7 @@ elsif($cmd eq "getmounts")
my @strings;
my $sth=$dbh->prepare("select client, path from mounts where session_id='$sid'");
$sth->execute()or die;
- my @data;
- my $i=0;
- while (@data = $sth->fetchrow_array)
- {
- @strings[$i++]=join("|", at data);
- }
- $sth->finish();
- $dbh->disconnect();
- print join("\n", at strings);
+ fetchrow_printall_array($sth);
}
elsif($cmd eq "deletemount")
@@ -269,14 +247,7 @@ elsif($cmd eq "listsessions")
where status !='F' and server='$server' and uname='$realuser'
and ( session_id not like '%XSHAD%') order by status desc");
$sth->execute()or die;
- my @data;
- my $i=0;
- while (@data = $sth->fetchrow_array)
- {
- @strings[$i++]=join('|', at data);
- }
- $sth->finish();
- print join("\n", at strings);
+ fetchrow_printall_array($sth);
}
elsif($cmd eq "listsessions_all")
@@ -290,14 +261,7 @@ elsif($cmd eq "listsessions_all")
strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions
where status !='F' and uname='$realuser' and ( session_id not like '%XSHAD%') order by status desc");
$sth->execute()or die;
- my @data;
- my $i=0;
- while (@data = $sth->fetchrow_array)
- {
- @strings[$i++]=join('|', at data);
- }
- $sth->finish();
- print join("\n", at strings);
+ fetchrow_printall_array($sth);
}
else
{
@@ -313,3 +277,17 @@ sub checkroot
die "$realuser, you can not do this job";
}
}
+
+sub fetchrow_printall_array
+{
+ # print all arrays separated by the pipe symbol
+ local $, = '|';
+
+ my $sth = shift;
+ my @data;
+ while (@data = $sth->fetchrow_array())
+ {
+ print @data, "\n";
+ }
+ $sth->finish();
+}
hooks/post-receive
--
x2goserver.git (X2Go Server)
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 "x2goserver.git" (X2Go Server).
More information about the x2go-commits
mailing list