aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/perl/lib/OpenSim/UserServer/UserManager.pm
diff options
context:
space:
mode:
authorAdam Frisby2008-03-25 16:29:54 +0000
committerAdam Frisby2008-03-25 16:29:54 +0000
commit8c05b81d6860d8e0da4098cc6f59f630d7c53037 (patch)
tree3325e09660ee8ad5a12cc19c8da6c4bd8bff5c21 /share/perl/lib/OpenSim/UserServer/UserManager.pm
parent* On Ray casting. Now returning the face normal of the collision face. (diff)
downloadopensim-SC-8c05b81d6860d8e0da4098cc6f59f630d7c53037.zip
opensim-SC-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.gz
opensim-SC-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.bz2
opensim-SC-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.xz
* Committing Lulurun's Cgi/Perl implementation of the UGAI servers.
* I love you long time.
Diffstat (limited to 'share/perl/lib/OpenSim/UserServer/UserManager.pm')
-rw-r--r--share/perl/lib/OpenSim/UserServer/UserManager.pm49
1 files changed, 49 insertions, 0 deletions
diff --git a/share/perl/lib/OpenSim/UserServer/UserManager.pm b/share/perl/lib/OpenSim/UserServer/UserManager.pm
new file mode 100644
index 0000000..ce35329
--- /dev/null
+++ b/share/perl/lib/OpenSim/UserServer/UserManager.pm
@@ -0,0 +1,49 @@
1package OpenSim::UserServer::UserManager;
2
3use strict;
4use Carp;
5use OpenSim::Utility;
6use OpenSim::UserServer::Config;
7
8sub getUserByName {
9 my ($first, $last) = @_;
10 my $res = &OpenSim::Utility::getSimpleResult($OpenSim::UserServer::Config::SYS_SQL{select_user_by_name}, $first, $last);
11 my $count = @$res;
12 my %user = ();
13 if ($count == 1) {
14 my $user_row = $res->[0];
15 foreach (@OpenSim::UserServer::Config::USERS_COLUMNS) {
16 $user{$_} = $user_row->{$_} || "";
17 }
18 } else {
19 Carp::croak("user not found");
20 }
21 return \%user;
22}
23
24sub getUserByUUID {
25 my ($uuid) = @_;
26 my $res = &OpenSim::Utility::getSimpleResult($OpenSim::UserServer::Config::SYS_SQL{select_user_by_uuid}, $uuid);
27 my $count = @$res;
28 my %user = ();
29 if ($count == 1) {
30 my $user_row = $res->[0];
31 foreach (@OpenSim::UserServer::Config::USERS_COLUMNS) {
32 $user{$_} = $user_row->{$_} || "";
33 }
34 } else {
35 Carp::croak("user not found");
36 }
37 return \%user;
38}
39
40sub createUser {
41 my $user = shift;
42 my @params = ();
43 foreach (@OpenSim::UserServer::Config::USERS_COLUMNS) {
44 push @params, $user->{$_};
45 }
46 my $res = &OpenSim::Utility::getSimpleResult($OpenSim::UserServer::Config::SYS_SQL{create_user}, @params);
47}
48
491;