-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImbaMe.php
More file actions
28 lines (23 loc) · 776 Bytes
/
ImbaMe.php
File metadata and controls
28 lines (23 loc) · 776 Bytes
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
<?php
/**
* If a request comes from any of our portals, tell them the current logged in
* username
*/
require_once 'Controller/Include.php';
require_once 'Shared/Include.php';
session_start();
$ref = ImbaSharedFunctions::getDomain($_SERVER["HTTP_REFERER"]);
$ref = str_replace("http://", "", $ref);
$ref = str_replace("https://", "", $ref);
$portalAliases = ImbaManagerPortal::getInstance()->getAllAliases();
if (in_array($ref, $portalAliases) || $_SERVER["HTTP_HOST"] = "localhost") {
if (ImbaUserContext::getLoggedIn()) {
$username = ImbaManagerUser::getInstance()->selectById(ImbaUserContext::getUserId())->getNickname();
echo $username;
} else {
echo "Not logged in.";
}
} else {
echo "Portal unknown, or no referer.";
}
?>