-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.php
81 lines (72 loc) · 3.66 KB
/
user.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?PHP
require("import/sessionstart.php");
if (!isset($_GET["id"]) || empty($_GET["id"])) {
if (!isset($_SESSION["signed_in"]) || $_SESSION["signed_in"] !== true) {
header("Location: /signin/?continue=https://accounts.assembl.net/user/");
die();
}
else {
header("Location: /user/?id=".$_SESSION["userdata"]["uid"]);
die();
}
}
else {
require("import/assembldb.php");
$connection = AssemblDB::getAccountsConnection();
$sql = "SELECT * FROM `users`.`userdata` WHERE `uid`='".AssemblDB::makeSafe($_GET["id"], $connection)."' LIMIT 1";
$result = mysqli_query($connection, $sql);
if (mysqli_num_rows($result) < 1) {
die("User with AssemblID ".$_GET["id"]." does not exist");
}
$userData = mysqli_fetch_assoc($result);
$sql = "SELECT * FROM `users`.`orcid` WHERE `uid`='".AssemblDB::makeSafe($_GET["id"], $connection)."' LIMIT 1";
$result = mysqli_query($connection, $sql);
$orcidData = mysqli_fetch_assoc($result);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?PHP echo $userData["name"]; ?>'s account - Assembl</title>
<base href="https://accounts.assembl.net/" />
<link rel="stylesheet" href="/loginstyles.css" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="icon" type="image/ico" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#193864" />
</head>
<body>
<div class="signin-table">
<div class="signin-table-cell">
<div class="signin-table-cell-content">
<div style="display: none;" id="loading">
<img class="loading-svg" src="import/loading.svg" />
</div>
<script src="/import/loader.js"></script>
<h1>Assembl</h1>
<h2>User Overview</h2>
<hr />
<label>Assembl ID</label>
<input class="assembl-input" type="text" readonly value="<?PHP echo $userData["uid"]; ?>" />
<label>Name</label>
<input class="assembl-input" type="text" readonly value="<?PHP echo $userData["name"]; ?>" />
<label>Registered on</label>
<input class="assembl-input" type="text" readonly value="<?PHP echo $userData["registered_on"]; ?>" />
<label>Organization Affiliation</label>
<input class="assembl-input" type="text" readonly value="<?PHP echo $userData["org_affiliation"]; ?>" />
<label>ORCID iD</label>
<?PHP if (!empty($orcidData["orcid_id"])) { ?>
<input class="assembl-input" type="text" readonly value="<?PHP echo $orcidData["orcid_id"]; ?>" />
<small style="display: block; text-align: left;"><a href="https://orcid.org/<?PHP echo $orcidData["orcid_id"]; ?>" target="_blank">View ORCID record</a></small>
<?PHP } else { ?>
<input class="assembl-input" type="text" readonly value="not connected with ORCID" />
<?PHP } ?>
<?PHP if (isset($_GET["closebtn"])) { ?>
<input style="margin-top: 32px;" type="button" class="assembl-btn full-width" id="close-win" value="Close" onclick="window.close();" />
<?PHP } ?>
</div>
</div>
</div>
</body>
</html>