diff -r 8733c22969e7 -r 3a8ed301be66 plugins/admin/UserManager.php --- a/plugins/admin/UserManager.php Sat Jul 12 03:55:14 2008 -0400 +++ b/plugins/admin/UserManager.php Sat Jul 12 04:10:04 2008 -0400 @@ -104,6 +104,14 @@ if ( $user_level < USER_LEVEL_MEMBER || $user_level > USER_LEVEL_ADMIN ) $errors[] = 'Invalid user level'; + $user_rank = $_POST['user_rank']; + if ( $user_rank !== 'NULL' ) + { + $user_rank = intval($user_rank); + if ( !$user_rank ) + $errors[] = 'Invalid user rank'; + } + $imaddr_aim = htmlspecialchars($_POST['imaddr_aim']); $imaddr_msn = htmlspecialchars($_POST['imaddr_msn']); $imaddr_yahoo = htmlspecialchars($_POST['imaddr_yahoo']); @@ -160,6 +168,7 @@ } $to_update_users['signature'] = $signature; $to_update_users['user_level'] = $user_level; + $to_update_users['user_rank'] = $user_rank; if ( isset($_POST['account_active']) ) { @@ -430,6 +439,7 @@ $form->real_name = $real_name; $form->signature = $signature; $form->user_level = $user_level; + $form->user_rank = $user_rank; $form->im = array( 'aim' => $imaddr_aim, 'yahoo' => $imaddr_yahoo, @@ -471,7 +481,7 @@ echo 'No username provided'; return false; } - $q = $db->sql_query('SELECT u.user_id AS authoritative_uid, u.username, u.email, u.real_name, u.signature, u.account_active, u.user_level, u.user_has_avatar, u.avatar_type, u.user_registration_ip, x.* FROM '.table_prefix.'users AS u + $q = $db->sql_query('SELECT u.user_id AS authoritative_uid, u.username, u.email, u.real_name, u.signature, u.account_active, u.user_level, u.user_rank, u.user_has_avatar, u.avatar_type, u.user_registration_ip, x.* FROM '.table_prefix.'users AS u LEFT JOIN '.table_prefix.'users_extra AS x ON ( u.user_id = x.user_id OR x.user_id IS NULL ) WHERE ( ' . ENANO_SQLFUNC_LOWERCASE . '(u.username) = \'' . $db->escape(strtolower($username)) . '\' OR u.username = \'' . $db->escape($username) . '\' ) AND u.user_id != 1;'); @@ -493,6 +503,7 @@ $form->real_name = $row['real_name']; $form->signature = $row['signature']; $form->user_level= $row['user_level']; + $form->user_rank = $row['user_rank']; $form->account_active = ( $row['account_active'] == 1 ); $form->email_public = ( $row['email_public'] == 1 ); $form->has_avatar = ( $row['user_has_avatar'] == 1 ); @@ -759,6 +770,13 @@ var $user_level = USER_LEVEL_MEMBER; /** + * User-specific user rank + * @var int + */ + + var $user_rank = NULL; + + /** * Account activated * @var bool */ @@ -1137,6 +1155,18 @@ +