示例#1
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);
?>

<?php 
require "template.php";
require_once 'api.php';
$users = api_user_list();
$result = "";
if (api_user_delete($_GET["id"])) {
    $result = "User was successfully deleted!";
} else {
    $result = "Something went wrong!";
}
$content = '
      <div class="container" style="text-align: center">
        <h3>' . $result . '</h3>
      </div>';
output($result, $content);
示例#2
0
function user() {
	global $user_actions, $colors, $auth_realms;

	html_start_box("<strong>" . _("User Management") . "</strong>", "98%", $colors["header_background"], "3", "center", "user_admin.php?action=user_edit");

	html_header_checkbox(array(_("User Name"), _("Full Name"), _("Status"),_("Realm"), _("Default Graph Policy"), _("Last Login"), _("Last Login From"),_("Last Password Change")));

	$user_list = api_user_list( array( "1" => "username" ) );

	$i = 0;
	if (sizeof($user_list) > 0) {
	foreach ($user_list as $user_list_values) {
		$user = api_user_info( array( "id" => $user_list_values["id"] ) );
		form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i);
			?>
			<td>
				<a class="linkEditMain" href="user_admin.php?action=user_edit&id=<?php print $user["id"];?>"><?php print $user["username"];?></a>
			</td>
			<td>
				<?php print $user["full_name"];?>
			</td>
			<td>
				<?php if ($user["enabled"] == "1") { print _("Enabled"); }else{ print _("Disabled"); }?>
			</td>
			<td>
				<?php print $auth_realms[$user["realm"]];?>
			</td>
			<td>
				<?php if ($user["policy_graphs"] == "1") { print _("ALLOW"); }else{ print _("DENY"); }?>
			</td>
			<td>
				<?php print $user["last_login_formatted"];?>
			</td>
			<td>
				<?php print $user["last_login_ip"];?>
			</td>
			<td>
				<?php
				if ($user["realm"] != "0") {
					print _("N/A");
				}else{
					if ($user["password_change_last"] == "0000-00-00 00:00:00") {
						print _("Never");
					}else{
						print $user["password_change_last_formatted"];
					}
				} ?>
			</td>


			<td style="<?php print get_checkbox_style();?>" width="1%" align="right">
				<input type='checkbox' style='margin: 0px;' name='chk_<?php print $user["id"];?>' title="<?php print $user["username"];?>">
			</td>
		</tr>
	<?php
	$i++;
	}
	}
	html_end_box(false);

	/* draw the dropdown containing a list of available actions for this form */
	draw_actions_dropdown($user_actions);

}