# HG changeset patch
# User Dan
# Date 1215852570 14400
# Node ID f4f4146d8b6c8b4bd2da75fee0b0fd1a8403262b
# Parent 3a8ed301be666d2b083d393fd77788998039c469
Added group_rank option in admin group manager and user_title option in admin user manager
diff -r 3a8ed301be66 -r f4f4146d8b6c language/english/admin.json
--- a/language/english/admin.json Sat Jul 12 04:10:04 2008 -0400
+++ b/language/english/admin.json Sat Jul 12 04:49:30 2008 -0400
@@ -805,6 +805,9 @@
field_signature: 'Signature:',
+ field_usertitle: 'User title:',
+ field_usertitle_hint: 'Displayed below the avatar or username, and above the rank.',
+
heading_imcontact: 'Instant messenger contact information',
field_aim: 'AIM handle:',
@@ -856,13 +859,14 @@
btn_edit_stage1: 'Edit group',
heading_create_new: 'Create a new group',
field_group_name: 'Group name:',
+ field_group_rank: 'Assigned rank:',
btn_create_stage1: 'Continue',
// Edit form
- heading_edit_name: 'Edit group name',
+ heading_edit_name: 'Edit group basics',
btn_cant_delete: 'Can\'t delete system group',
btn_delete_group: 'Delete this group',
- btn_save_name: 'Save name',
+ btn_save_name: 'Save changes',
heading_edit_members: 'Edit group members',
msg_no_members: 'This group has no members.',
lbl_member_mod: 'Mod',
@@ -888,7 +892,7 @@
// More editor bits, validation messages
err_nodelete_system_group: 'The group "%g_name%" could not be deleted because it is a system group required for site functionality.',
msg_delete_success: 'The group "%g_name%" has been deleted. Return to the group manager.',
- msg_name_update_success: 'The group name has been updated.',
+ msg_name_update_success: 'The group name and rank have been updated.',
msg_user_added: 'The user "%username%" has been added to this usergroup.',
err_username_not_exist: 'The user "%username%" could not be added.
This username does not exist.',
},
diff -r 3a8ed301be66 -r f4f4146d8b6c plugins/admin/GroupManager.php
--- a/plugins/admin/GroupManager.php Sat Jul 12 04:10:04 2008 -0400
+++ b/plugins/admin/GroupManager.php Sat Jul 12 04:49:30 2008 -0400
@@ -130,7 +130,7 @@
if(isset($_POST['do_edit']) || isset($_POST['edit_do']))
{
// Fetch the group name
- $q = $db->sql_query('SELECT group_name,system_group FROM '.table_prefix.'groups WHERE group_id='.intval($_POST['group_edit_id']).';');
+ $q = $db->sql_query('SELECT group_name,system_group,group_rank FROM '.table_prefix.'groups WHERE group_id='.intval($_POST['group_edit_id']).';');
if(!$q)
{
echo $db->get_error();
@@ -176,7 +176,19 @@
echo '
' . $lang->get('acpug_err_group_name_invalid') . '
'; return; } - $q = $db->sql_query('UPDATE '.table_prefix.'groups SET group_name=\''.$db->escape($_POST['group_name']).'\' + // determine rank + $group_rank =& $_POST['group_rank']; + if ( $_POST['group_rank'] !== 'NULL' ) + { + $group_rank = intval($group_rank); + if ( empty($group_rank) ) + { + echo 'Hacked rank ID
'; + return; + } + } + $row['group_rank'] = $group_rank; + $q = $db->sql_query('UPDATE '.table_prefix.'groups SET group_name=\''.$db->escape($_POST['group_name']).'\',group_rank = ' . $group_rank . ' WHERE group_id='.intval($_POST['group_edit_id']).';'); if(!$q) { @@ -201,11 +213,11 @@ } if($db->numrows() > 0) { - while($row = $db->fetchrow($q)) + while($delrow = $db->fetchrow($q)) { - if(isset($_POST['edit_do']['del_' . $row['member_id']])) + if(isset($_POST['edit_do']['del_' . $delrow['member_id']])) { - $e = $db->sql_query('DELETE FROM '.table_prefix.'group_members WHERE member_id='.$row['member_id']); + $e = $db->sql_query('DELETE FROM '.table_prefix.'group_members WHERE member_id='.$delrow['member_id']); if(!$e) { echo $db->get_error(); @@ -250,6 +262,17 @@ $sg_disabled = ( $row['system_group'] == 1 ) ? ' value="' . $lang->get('acpug_btn_cant_delete') . '" disabled="disabled" style="color: #FF9773" ' : ' value="' . $lang->get('acpug_btn_delete_group') . '" style="color: #FF3713" '; + + // build rank list + $q = $db->sql_query('SELECT rank_id, rank_title FROM ' . table_prefix . 'ranks'); + if ( !$q ) + $db->_die(); + $rank_list = '' . "\n"; + while ( $rank_row = $db->fetchrow() ) + { + $rank_list .= '' . "\n"; + } + echo '