-
Notifications
You must be signed in to change notification settings - Fork 7
/
oswlslapi.php
66 lines (57 loc) · 2.29 KB
/
oswlslapi.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
define('OSW_IN_SYSTEM', true);
require_once('inc/headerless.php');
$t = $osw->Security->make_safe($_GET['t']);
$u = $osw->Security->make_safe($_GET['u']);
if ($t == "usercounts") {
$onlineq = $osw->SQL->query("SELECT * FROM `{$osw->config['robust_db']}`.GridUser WHERE Online = 'TRUE'");
$online = $osw->SQL->num_rows($onlineq);
$totalq = $osw->SQL->query("SELECT * FROM `{$osw->config['robust_db']}`.UserAccounts");
$totalc = $osw->SQL->num_rows($totalq);
$monthago = $now - 2592000;
$latestq = $osw->SQL->query("SELECT * FROM `{$osw->config['robust_db']}`.GridUser WHERE Login > '$monthago'");
$latestc = $osw->SQL->num_rows($latestq);
$regionq = $osw->SQL->query("SELECT * FROM `{$osw->config['robust_db']}`.regions");
$regionc = $osw->SQL->num_rows($regionq);
echo $online."~".$totalc."~".$latestc."~".$regionc;
}
if ($t == "destinations") {
$destecho = array("");
$destq = $osw->SQL->query("SELECT * FROM `{$osw->config['search_db']}`.popularplaces ORDER BY `name` ASC LIMIT 0,10");
while ($destr = $osw->SQL->fetch_array($destq)) {
$destname = $destr['name'];
$destecho .= $destname."~";
}
echo $destecho;
}
if ($t == "profile") {
$userexplode = explode(" ", $u);
$first = $userexplode[0];
$last = $userexplode[1];
if (!$last) {
$last = "Resident";
}
$uq = $osw->SQL->query("SELECT * FROM `{$osw->config['robust_db']}`.UserAccounts WHERE FirstName = '$first' AND LastName = '$last'");
$ur = $osw->SQL->fetch_array($uq);
$uuid = $ur['PrincipalID'];
$profq = $osw->SQL->query("SELECT * FROM `{$osw->config['profile_db']}`.userprofile WHERE useruuid = '$uuid'");
$r = $osw->SQL->fetch_array($profq);
$partner = $r['profilePartner'];
$url = $r['profileURL'];
$want2mask = $r['profileWantToMask'];
$want2text = $r['profileWantToText'];
$skillsmask = $r['profileSkillsMask'];
$skillstext = $r['profileSkillsText'];
$lang = $r['profileLanguages'];
$flpic = $r['profileImage'];
$fakeaboutme = $r['profileAboutText'];
$rlpic = $r['profileFirstImage'];
$realaboutme = $r['profileFirstText'];
$uname = $first." ".$last;
if (!$partner || $partner == "00000000-0000-0000-0000-000000000000") {
$partner = "No one";
}
echo $uuid."~".$flpic."~".$fakeaboutme."~".$rlpic."~".$realaboutme."~".$partner."~".$url."~".$uname;
}
// For examples for this API system please see oswapilsl.lsl included with OSW
?>