# --------------------------------------------------------
# $Id: admin_manage_users.php,v 1.11 2002/10/07 02:54:39 vboctor Exp $
# --------------------------------------------------------
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
login_cookie_check();
access_ensure_check_action(ACTION_USERS_MANAGE);
print_html_top();
print_head_top();
print_title($g_window_title);
print_css($g_css_inc_file);
print_head_bottom();
print_body_top();
print_header($g_page_title);
print_top_page($g_top_page_inc);
print_admin_menu();
$t_users_array = user_get_all();
echo '<table class="box" summary="">';
echo '<thead><tr><th>Username</th><th>Email</th><th>Access Level</th><th>Enabled</th><th>Protected</th></tr></thead><tbody>';
$i = 0;
foreach ($t_users_array as $user) {
    extract($user, EXTR_PREFIX_ALL, 'v');
    $v_enabled = $v_enabled ? 'x' : '&nbsp;';
    $v_protected = $v_protected ? 'x' : '&nbsp;';
    $t_class = util_alternate_class($i++);
    $t_access_level = enum_get_element('access_levels', $v_access_level);
    echo "<tr class=\"{$t_class}\"><td><a href=\"{$g_admin_manage_users_edit}?f_user_id={$v_id}\">{$v_username}</a></td><td>{$v_email}</td><td>{$t_access_level}</td><td>{$v_enabled}</td><td>{$v_protected}</td></tr>";
}
echo '</tbody></table>';
echo '<div class="spacer"></div>';
echo link_create($g_admin_manage_users_add_page, 'Add User');
# @@@ LOCALIZE
Exemple #2
0
#
# You should have received a copy of the GNU General Public License
# along with Igoan; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
require_once 'igoan/User.class';
$me = user_get_by_id($_SESSION['id']);
if (!$me) {
    append_error_exit('User ID inexistent.');
}
if (!$me->is_global_admin()) {
    append_error_exit('Permission denied: global admin flag required');
}
?>
<h1>Gestion des users</h1>

<p>
Voici la liste complète des utilisateurs.
</p>

<?php 
$users = user_get_all();
if (!count($users)) {
    echo '<p><em>Il n\'y a pas d\'utilisateur dans la base actuellement.</em></p>';
} else {
    echo '<table><tr><th>id_user</th><th>name_user</th><th>mail</th><th>url</th><th>login</th><th>passwd</th></tr>';
    foreach ($users as $user) {
        echo "<tr><td>{$user->id_user}</td><td>{$user->name_user}</td><td>{$user->mail}</td><td>{$user->url}</td><td>{$user->login}</td><td>{$user->passwd}</td></tr>";
    }
    echo '</table>';
}
$order_by = $s_user_manage_display_options['order_by'];
$order_dir = $s_user_manage_display_options['order_dir'];
$page_number = $s_user_manage_display_options['page_number'];
html_window_title();
html_print_body();
html_page_title($project_name . " - " . lang_get('user_manage_page'));
html_page_header($db, $project_name);
html_print_menu();
admin_user_print($page, $project_id, $user_id);
print "<br>" . NEWLINE;
print "<div align=center>" . NEWLINE;
print "<form method=post action='{$page}'>" . NEWLINE;
print "<table class=hide80>" . NEWLINE;
print "<tr>" . NEWLINE;
print "<td>" . NEWLINE;
$users = user_get_all($order_by, $order_dir, $page_number, '');
print "</td>" . NEWLINE;
print "</tr>" . NEWLINE;
print "</table>" . NEWLINE;
print "</form>" . NEWLINE;
print "<table id='sortabletable' class='sortable' rules=cols>" . NEWLINE;
print "<thead>" . NEWLINE;
print "<tr>" . NEWLINE;
#html_tbl_print_header( lang_get('id'),			USER_ID,	$order_by, $order_dir, $page );
#html_tbl_print_header( lang_get('username'),	USER_UNAME,	$order_by, $order_dir, $page );
#html_tbl_print_header( lang_get('first_name'),	USER_FNAME,	$order_by, $order_dir, $page );
#html_tbl_print_header( lang_get('last_name'),	USER_LNAME, $order_by, $order_dir, $page );
#html_tbl_print_header( lang_get('email'),		USER_EMAIL, $order_by, $order_dir, $page );
#html_tbl_print_header( lang_get('deleted'),	  USER_DELETED, $order_by, $order_dir, $page );
html_tbl_print_header(lang_get('id'));
html_tbl_print_header(lang_get('username'));