blob: f0c4997c5dea3c98a0f54e1cffe42c4580a38d8a (
plain)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
<?php
/*
Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License v2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*!
@header Show Users (admin section)
*/
$web_path = conf('web_path');
$total_items = $view->total_items;
$admin_menu = "admin/";
?>
<?php show_box_top(); ?>
<table class="tabledata" cellpadding="0" cellspacing="0" border="0">
<tr class="table-header" align="center">
<td colspan="11">
<?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?>
</td>
</tr>
<tr class="table-header">
<td align="center">
<a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=fullname&sort_order=0">
<b><?php echo _("Fullname"); ?></b>
</a>
<a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=username&sort_order=0">
<b>(<?php echo _("Username"); ?>)</b>
</a>
</td>
<td align="center">
<a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=last_seen&sort_order=0">
<b><?php echo _('Last Seen'); ?></b>
</a>
</td>
<td align="center">
<a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=create_date&sort_order=0">
<b><?php echo _('Registration Date'); ?></b>
</a>
</td>
<td align="center">
<b><?php echo _('Activity'); ?></b>
</td>
<td align="center">
<b><?php echo _('Last Ip'); ?></b>
</td>
<td colspan="5"> </td>
<td align="center">
<b><?php echo _('On-line'); ?></b>
</td>
</tr>
<?php
while ($results = mysql_fetch_object($db_result)) {
$user = new User($results->username);
$last_seen = date("m\/d\/Y - H:i",$user->last_seen);
if (!$user->last_seen) { $last_seen = "Never"; }
$create_date = date("m\/d\/Y - H:i",$user->create_date);
$user->format_user();
if (!$user->create_date) { $create_date = "Unknown"; }
?>
<tr class="<?php echo flip_class(); ?>" align="center">
<td align="left">
<a href="<?php echo $web_path; ?>/admin/users.php?action=edit&user=<?php echo $user->id; ?>">
<?php echo $user->fullname; ?> (<?php echo $user->username; ?>)
</a>
</td>
<td>
<?php echo $last_seen; ?>
</td>
<td>
<?php echo $create_date; ?>
</td>
<td>
<?php echo $user->f_useage; ?>
</td>
<td>
<a href="<?php echo $web_path; ?>/admin/users.php?action=show_ip_history&user_id=<?php echo $user->id; ?>">
<?php echo $user->ip_history; ?>
</a>
</td>
<td>
<a href="<?php echo $web_path; ?>/admin/users.php?action=edit&user=<?php echo $user->username; ?>">
<?php echo get_user_icon('edit'); ?>
</a>
</td>
<td>
<a href="<?php echo $web_path; ?>/admin/preferences.php?action=user&user_id=<?php echo $user->username; ?>">
<?php echo get_user_icon('preferences'); ?>
</a>
</td>
<td>
<a href="<?php echo $web_path; ?>/stats.php?user_id=<?php echo $user->username; ?>">
<?php echo get_user_icon('statistics'); ?>
</a>
</td>
<?php
//FIXME: Fix this for the extra permission levels
if ($user->disabled == '1') {
echo "<td><a href=\"".$web_path."/admin/users.php?action=update&user=$user->username&level=enabled\">" . get_user_icon('enable') . "</a></td>";
}
else {
echo "<td><a href=\"".$web_path."/admin/users.php?action=update&user=$user->username&level=disabled\">" . get_user_icon('disable') ."</a></td>";
}
?>
<td>
<a href="<?php echo $web_path; ?>/admin/users.php?action=delete&user=<?php echo $user->username; ?>">
<?php echo get_user_icon('delete'); ?>
</a>
</td>
<?php
if (($user->is_logged_in()) and ($user->is_online())) {
echo "<td class=\"user_online\"> </td>";
} elseif ($user->disabled == 1) {
echo "<td class=\"user_disabled\"> </td>";
} else {
echo "<td class=\"user_offline\"> </td>";
}
?>
</tr>
<?php } //end while ($results = mysql_fetch_object($db_result)) ?>
</table>
<?php show_box_bottom(); ?>
|