-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathusers.php
127 lines (111 loc) · 2.84 KB
/
users.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?
include("common.php");
include_once("session.php");
include("permission_functions.php");
$ou = fixString($_GET['ou']);
$role = fixString($_GET['role']);
$page = fixString($_GET['p']);
$offset = 0;
if(!$page){
$page = 1;
}
$limit = 50;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?echo strip_tags($site_title);?> </title>
<?
echo $common_js;
?>
<script type='text/javascript'>
$(document).ready(function() {
<?echo $common_jquery;?>
$("#search").focus();
$("#search").keyup( function(){
var search = $(this).val();
if(search.length >= 3){
var term = $("#term").val();
var url = "indexed_search.php?q=" + search;
$.getJSON(url, function(data){
$("#ajax").html("");
$.each(data, function(index, objValue) {
$("#ajax").append("<a href=\"add_user.php?ou=<?echo $ou;?>&role=<?echo $role;?>&id=" + objValue.id + "\">" + objValue.first + " " + objValue.middle + " " + objValue.last + "</a><br />");
});
});
}
});
});
</script>
<?
echo $common_css;
?>
</head>
<body>
<div class="container">
<div class="content main">
<?
drawHeader($id);
?>
</div>
<div class="row">
<div class="span12">
<ul class="breadcrumb">
<li><a href="profile.php">Profile</a> / </li>
<li><a href="profile.php#admin">Admin</a> / </li>
<li>Users</li>
</ul>
</div>
</div>
<div class="row">
<div class="span3">
<div class="well">
Helpful info
</div>
</div>
<div class="span5 well">
<?
//echo "Add a <span class=\"label label-info\">$role</span> to <span class=\"label label-info\">$ou</span><br /><br />";
?>
<form id="form">
<input type="text" name="search" id="search" class="search-query" autocomplete="off"/>
<br />
<br />
</form>
<div id="error" class="span4"></div>
<div class="span5" id="spinner" style="display:none;">
<img src="images/ajax-loader.gif">
</div>
<div class="span5" id="ajax">
</div>
</div>
</div>
<div class="row">
<div class="span3">
</div>
<div class="span5">
<h3>Current Users</h3>
<?
echo "<table class=\"table table-bordered table-striped\">\n";
echo "<thead><tr><th>ID</th><th>First</th><th>Last</th></thead>";
echo "<tbody>";
$users_list = listUsersInRole($ou, $role, $limit, $offset);
foreach($users_list as $user){
$this_id = $user['id'];
echo "<tr>";
echo "<td><a href=\"#\" title=\"User details\">$this_id</a></td>";
echo "<td>".$user['firstname']."</td>";
echo "<td>".$user['lastname']."</td>";
echo "</tr>\n";
}
echo "</tbody>";
echo "</table>\n";
?>
</div>
</div>
</div>
</div>
</body>
</html>