po/src/admin.user.del.php

78 lines
3.3 KiB
PHP

<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2013 Solomon Peachy (pizza@shaftnet.org)
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
// 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/admin.php";
include_once "include/site.php";
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_ADMIN);
site_header($strings['generic_admin'] ." : ". $strings['admin_delete_user']);
site_navigator(9);
site_navigator_status(emit_a("admin.php", $strings['generic_admin'])." : ". $strings['admin_delete_user'], "");
theme_display_navigator_box_top($admin_data['users_n_clients']['idx'], $admin_data, "100%");
$user_id = $_REQUEST['user'];
$user_data = pg_fetch_row(pg_query($database, "select users.identifier, last_name, first_name, member_since from users where users.identifier=$user_id"));
$user_preferences = pg_fetch_row(pg_query($database, "select get_user_pref($user_id, 'bulk_upload_enable'), get_user_pref($user_id, 'last_updated')"));
if (($user_preferences[1] == null) || ($user_preferences[1] == ''))
$user_preferences[1] = $user_data[3];
print "<table class=\"admin\">\n";
print "<tr>\n";
print emit_th($strings['generic_name'], "width=\"30%\" align=\"left\"");
print emit_th($strings['generic_photos'], "width=\"8%\"");
print emit_th($strings['generic_folders'], "width=\"8%\"");
print emit_th($strings['generic_albums'], "width=\"8%\"");
print emit_th($strings['generic_bulk_upload'], "width=\"8%\"");
print emit_th($strings['generic_member_since'], "width=\"8%\"");
print emit_th($strings['generic_last_login'], "width=\"10%\"");
print "</tr>\n";
$photos_by_user = pg_fetch_row(pg_query($database, "select count_photos_by_user($user_data[0])"));
$folders_by_user = pg_fetch_row(pg_query($database, "select count_folders_by_user($user_data[0])"));
$albums_by_user = pg_fetch_row(pg_query($database, "select count_albums_by_user($user_data[0])"));
print "<tr>";
print emit_td(emit_a(generate_link('user', $user_data[0]), "$user_data[1], $user_data[2]"), "align=\"left\"");
print emit_td($photos_by_user[0]);
print emit_td($folders_by_user[0] - 1);
print emit_td($albums_by_user[0] - 1);
print emit_td(emit_enable_disable_text($user_preferences[0]));
print emit_td(emit_date_html($user_data[3], 'date'));
print emit_td(emit_date_html($user_preferences[1], 'date'));
print "</tr>";
print "</table>\n";
print "<form method=\"post\" action=\"admin.user.del.2.php\" accept-charset=\"".$strings['formats_encoding']."\">";
print "<input type=\"hidden\" name=\"user\" value=\"$user_id\"/>";
print $thm_elem['button.confirm.delete'];
print $thm_elem['button.cancel'];
print "</form>";
theme_display_navigator_box_bottom("100%");
site_footer($database);
site_epilog($database);
?>