diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-04 07:40:06 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-04 07:40:06 +0000 |
commit | 7743d70c68444fc2e20a6a4aa2f9a980203b999e (patch) | |
tree | 32d7c68ba195e429bde67e00c73ae6679159e82d /templates | |
parent | 19276f57a9eeacae7829629baa35fcb28d77419f (diff) | |
download | ampache-7743d70c68444fc2e20a6a4aa2f9a980203b999e.tar.gz ampache-7743d70c68444fc2e20a6a4aa2f9a980203b999e.tar.bz2 ampache-7743d70c68444fc2e20a6a4aa2f9a980203b999e.zip |
fixed browse users, add user, edit user
Diffstat (limited to 'templates')
-rw-r--r-- | templates/show_add_user.inc.php | 9 | ||||
-rw-r--r-- | templates/show_edit_user.inc.php | 18 | ||||
-rw-r--r-- | templates/show_users.inc.php | 92 | ||||
-rw-r--r-- | templates/sidebar_admin.inc.php | 4 |
4 files changed, 40 insertions, 83 deletions
diff --git a/templates/show_add_user.inc.php b/templates/show_add_user.inc.php index bbb79671..ed9ac236 100644 --- a/templates/show_add_user.inc.php +++ b/templates/show_add_user.inc.php @@ -21,8 +21,8 @@ */ ?> <?php show_box_top(_('Adding a New User')); ?> -<?php $GLOBALS['error']->print_error('general'); ?> -<form name="add_user" enctype="multpart/form-data" method="post" action="<?php echo conf('web_path') . "/admin/users.php"; ?>"> +<?php Error::display('general'); ?> +<form name="add_user" enctype="multpart/form-data" method="post" action="<?php echo Config::get('web_path') . "/admin/users.php?action=add_user"; ?>"> <table class="tabledata" cellspacing="0" cellpadding="0" border="0"> <tr> <td> @@ -30,7 +30,7 @@ </td> <td> <input type="text" name="username" size="30" maxlength="128" value="<?php echo scrub_out($_POST['username']); ?>" /> - <?php $GLOBALS['error']->print_error('username'); ?> + <?php Error::display('username'); ?> </td> </tr> <tr> @@ -53,7 +53,7 @@ </td> <td> <input type="password" name="password_1" size="30" value="" /> - <?php $GLOBALS['error']->print_error('password'); ?> + <?php Error::display('password'); ?> </td> </tr> <tr> @@ -79,7 +79,6 @@ </tr> <td colspan="2"> <input type="submit" value="<?php echo _('Add User'); ?>" /> - <input type="hidden" name="action" value="add_user" /> </td> </tr> </table> diff --git a/templates/show_edit_user.inc.php b/templates/show_edit_user.inc.php index a2779938..1c227cca 100644 --- a/templates/show_edit_user.inc.php +++ b/templates/show_edit_user.inc.php @@ -21,22 +21,22 @@ */ ?> <?php show_box_top(_('Editing existing User')); ?> -<?php $GLOBALS['error']->print_error('general'); ?> -<form name="update_user" enctype="multipart/form-data" method="post" action="<?php echo conf('web_path') . "/admin/users.php"; ?>"> +<?php Error::display('general'); ?> +<form name="update_user" enctype="multipart/form-data" method="post" action="<?php echo Config::get('web_path') . "/admin/users.php"; ?>"> <table class="tabledata" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <?php echo _('Username'); ?>: </td> <td> - <input type="text" name="username" size="30" maxlength="128" value="<?php echo scrub_out($working_user->username); ?>" /> - <?php $GLOBALS['error']->print_error('username'); ?> + <input type="text" name="username" size="30" maxlength="128" value="<?php echo scrub_out($client->username); ?>" /> + <?php Error::display('username'); ?> </td> </tr> <tr> <td><?php echo _('Full Name'); ?>:</td> <td> - <input type="text" name="fullname" size="30" value="<?php echo scrub_out($working_user->fullname); ?>" /> + <input type="text" name="fullname" size="30" value="<?php echo scrub_out($client->fullname); ?>" /> </td> </tr> <tr> @@ -44,7 +44,7 @@ <?php echo _('E-mail'); ?>: </td> <td> - <input type="text" name="email" size="30" value="<?php echo scrub_out($working_user->email); ?>" /> + <input type="text" name="email" size="30" value="<?php echo scrub_out($client->email); ?>" /> </td> </tr> <tr> @@ -53,7 +53,7 @@ </td> <td> <input type="password" name="password_1" size="30" value="" /> - <?php $GLOBALS['error']->print_error('password'); ?> + <?php Error::display('password'); ?> </td> </tr> <tr> @@ -69,7 +69,7 @@ <?php echo _('User Access Level'); ?>: </td> <td> - <?php $var_name = "on_" . $working_user->access; ${$var_name} = 'selected="selected"'; ?> + <?php $var_name = "on_" . $client->access; ${$var_name} = 'selected="selected"'; ?> <select name="access"> <option value="5" <?php echo $on_5; ?>><?php echo _('Guest'); ?></option> <option value="25" <?php echo $on_25; ?>><?php echo _('User'); ?></option> @@ -81,7 +81,7 @@ <td colspan="2"> <input type="hidden" name="action" value="update_user" /> <input type="submit" value="<?php echo _('Update User'); ?>" /> - <input type="hidden" name="user_id" value="<?php echo $working_user->id; ?>" /> + <input type="hidden" name="user_id" value="<?php echo $client->id; ?>" /> </td> </tr> </table> diff --git a/templates/show_users.inc.php b/templates/show_users.inc.php index 3bb1abd4..640978c7 100644 --- a/templates/show_users.inc.php +++ b/templates/show_users.inc.php @@ -19,46 +19,13 @@ */ -$web_path = conf('web_path'); -$total_items = $view->total_items; -$admin_menu = "admin/"; +$web_path = Config::get('web_path'); -show_box_top(_('Manage Users')); ?> -<table class="tabledata" cellpadding="0" cellspacing="10" border="0"> -<tr> -<td> -<?php - echo get_user_icon('add_user') . ' '; - echo '<a href="' . $web_path . '/admin/users.php?action=show_add_user">' . _('Add a new user') . '</a>'; - if (isset ($_REQUEST['action']) && $_REQUEST['action'] == "show_inactive"){ - ?> -</td> -</tr> -<form name="show_inactive" enctype="multipart/form-data" method="request" action="<?php echo conf('web_path') . "/admin/users.php"; ?>"> -<tr align="center"> - <td> - Inactive users for <input type=text name="days" size="4" value="<?php if (isset ($_REQUEST['days'])){ echo $_REQUEST['days'];}?>" /> days - </td> -</tr> -<tr> - <td> - <input type="hidden" name="action" value="show_inactive" /> - <input type="Submit" /> - </td> -</tr> -</form> - <?php - }?> -</table> -<?php -show_box_bottom(); -?> -<?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"); } ?> + <?php if ($view->offset_limit) { require Config::get('prefix') . '/templates/list_header.inc'; } ?> </td> </tr> <tr class="table-header"> @@ -83,28 +50,27 @@ show_box_bottom(); <td align="center"> <b><?php echo _('Activity'); ?></b> </td> - <?php if (conf('track_user_ip')) { ?> + <?php if (Config::get('track_user_ip')) { ?> <td align="center"> <b><?php echo _('Last Ip'); ?></b> </td> <?php } ?> - <td colspan="5"> </td> + <td align="center"><strong><?php echo _('Action'); ?></strong></td> <td align="center"> <b><?php echo _('On-line'); ?></b> </td> </tr> <?php -foreach ($users as $working_user) { - $working_user->format_user(); - $last_seen = date("m\/d\/Y - H:i",$working_user->last_seen); - if (!$working_user->last_seen) { $last_seen = _('Never'); } - $create_date = date("m\/d\/Y - H:i",$working_user->create_date); - if (!$working_user->create_date) { $create_date = _('Unknown'); } +foreach ($object_ids as $user_id) { + $client = new User($user_id); + $client->format(); + $last_seen = $client->last_seen ? date("m\/d\/Y - H:i",$client->last_seen) : _('Never'); + $create_date = $client->create_date ? date("m\/d\/Y - H:i",$client->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_id=<?php echo $working_user->id; ?>"> - <?php echo $working_user->fullname; ?> (<?php echo $working_user->username; ?>) + <a href="<?php echo $web_path; ?>/admin/users.php?action=edit&user_id=<?php echo $client->id; ?>"> + <?php echo $client->fullname; ?> (<?php echo $client->username; ?>) </a> </td> <td> @@ -115,48 +81,37 @@ foreach ($users as $working_user) { </td> <td> - <?php echo $working_user->f_useage; ?> + <?php echo $client->f_useage; ?> </td> - <?php if (conf('track_user_ip')) { ?> - <td> - <a href="<?php echo $web_path; ?>/admin/users.php?action=show_ip_history&user_id=<?php echo $working_user->id; ?>"> - <?php echo $working_user->ip_history; ?> + <td> + <?php if (Config::get('track_user_ip')) { ?> + <a href="<?php echo $web_path; ?>/admin/users.php?action=show_ip_history&user_id=<?php echo $client->id; ?>"> + <?php echo $client->ip_history; ?> </a> - </td> <?php } ?> - <td> - <a href="<?php echo $web_path; ?>/admin/users.php?action=edit&user_id=<?php echo $working_user->id; ?>"> + <a href="<?php echo $web_path; ?>/admin/users.php?action=show_edit&user_id=<?php echo $client->id; ?>"> <?php echo get_user_icon('edit'); ?> </a> - </td> - <td> - <a href="<?php echo $web_path; ?>/admin/preferences.php?action=user&user_id=<?php echo $working_user->id; ?>"> + <a href="<?php echo $web_path; ?>/admin/preferences.php?action=user&user_id=<?php echo $client->id; ?>"> <?php echo get_user_icon('preferences'); ?> </a> - </td> - <td> - <a href="<?php echo $web_path; ?>/stats.php?action=user_stats&user_id=<?php echo $working_user->id; ?>"> - <?php echo get_user_icon('statistics'); ?> - </a> - </td> <?php //FIXME: Fix this for the extra permission levels if ($working_user->disabled == '1') { - echo "<td><a href=\"".$web_path."/admin/users.php?action=enable&user_id=$working_user->id\">" . get_user_icon('enable') . "</a></td>"; + echo "<a href=\"".$web_path."/admin/users.php?action=enable&user_id=$client->id\">" . get_user_icon('enable') . "</a>"; } else { - echo "<td><a href=\"".$web_path."/admin/users.php?action=disable&user_id=$working_user->id\">" . get_user_icon('disable') ."</a></td>"; + echo "<a href=\"".$web_path."/admin/users.php?action=disable&user_id=$client->id\">" . get_user_icon('disable') ."</a>"; } ?> - <td> - <a href="<?php echo $web_path; ?>/admin/users.php?action=delete&user_id=<?php echo $working_user->id; ?>"> + <a href="<?php echo $web_path; ?>/admin/users.php?action=delete&user_id=<?php echo $client->id; ?>"> <?php echo get_user_icon('delete'); ?> </a> </td> <?php - if (($working_user->is_logged_in()) and ($working_user->is_online())) { + if (($client->is_logged_in()) AND ($client->is_online())) { echo "<td class=\"user_online\"> </td>"; - } elseif ($working_user->disabled == 1) { + } elseif ($client->disabled == 1) { echo "<td class=\"user_disabled\"> </td>"; } else { echo "<td class=\"user_offline\"> </td>"; @@ -165,4 +120,3 @@ foreach ($users as $working_user) { </tr> <?php } //end foreach users ?> </table> -<?php show_box_bottom(); ?> diff --git a/templates/sidebar_admin.inc.php b/templates/sidebar_admin.inc.php index a7e91364..e35d1d98 100644 --- a/templates/sidebar_admin.inc.php +++ b/templates/sidebar_admin.inc.php @@ -14,6 +14,10 @@ | <a href="<?php echo $web_path; ?>/admin/catalog.php?action=clean_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Clean'); ?></a> <?php } ?> <hr /> +<h4><?php echo _('User Tools'); ?></h4> +<span><a href="<?php echo $web_path; ?>/admin/users.php?action=show_add_user"><?php echo _('Add User'); ?></a></span> +<span><a href="<?php echo $web_path; ?>/admin/users.php"><?php echo _('Browse Users'); ?></a></span> +<hr /> <h4><?php echo _('Other Tools'); ?></h4> <span><a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_now_playing"><?php echo _('Clear Now Playing'); ?></a></span> <span><a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_stats"><?php echo _('Clear Catalog Stats'); ?></a></span> |