mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 20:13:22 +01:00
A few minor bug fixes in the group control panel.
git-svn-id: file:///svn/phpbb/trunk@1200 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
a290b47ea5
commit
21f99ed016
@ -132,6 +132,9 @@ if( isset($HTTP_POST_VARS['edit']) || isset($HTTP_POST_VARS['new']) )
|
|||||||
"L_GROUP_DELETE_CHECK" => $lang['group_delete_check'],
|
"L_GROUP_DELETE_CHECK" => $lang['group_delete_check'],
|
||||||
"L_SUBMIT" => $lang['submit_group_changes'],
|
"L_SUBMIT" => $lang['submit_group_changes'],
|
||||||
"L_RESET" => $lang['reset_group_changes'],
|
"L_RESET" => $lang['reset_group_changes'],
|
||||||
|
"L_DELETE_MODERATOR" => $lang['delete_group_moderator'],
|
||||||
|
"L_DELETE_MODERATOR_EXPLAIN" => $lang['delete_moderator_explain'],
|
||||||
|
"L_YES" => $lang['Yes'],
|
||||||
|
|
||||||
"S_SELECT_MODERATORS" => $select_list,
|
"S_SELECT_MODERATORS" => $select_list,
|
||||||
"S_GROUP_OPEN_CHECKED" => $group_open,
|
"S_GROUP_OPEN_CHECKED" => $group_open,
|
||||||
@ -161,10 +164,11 @@ else if( isset($HTTP_POST_VARS['group_update']) )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$group_type = isset($HTTP_POST_VARS['group_type']) ? $HTTP_POST_VARS['group_type'] : "";
|
$group_type = isset($HTTP_POST_VARS['group_type']) ? trim(addslashes($HTTP_POST_VARS['group_type'])) : "";
|
||||||
$group_name = isset($HTTP_POST_VARS['group_name']) ? $HTTP_POST_VARS['group_name'] : "";
|
$group_name = isset($HTTP_POST_VARS['group_name']) ? trim(addslashes($HTTP_POST_VARS['group_name'])) : "";
|
||||||
$group_description = isset($HTTP_POST_VARS['group_description']) ? $HTTP_POST_VARS['group_description'] : "";
|
$group_description = isset($HTTP_POST_VARS['group_description']) ? trim(addslashes($HTTP_POST_VARS['group_description'])) : "";
|
||||||
$group_moderator = isset($HTTP_POST_VARS['group_moderator']) ? intval($HTTP_POST_VARS['group_moderator']) : "";
|
$group_moderator = isset($HTTP_POST_VARS['group_moderator']) ? intval($HTTP_POST_VARS['group_moderator']) : "";
|
||||||
|
$delete_old_moderator = isset($HTTP_POST_VARS['delete_old_moderator']) ? intval($HTTP_POST_VARS['delete_old_moderator']) : "";
|
||||||
|
|
||||||
if( $group_name == "" )
|
if( $group_name == "" )
|
||||||
{
|
{
|
||||||
@ -181,8 +185,39 @@ else if( isset($HTTP_POST_VARS['group_update']) )
|
|||||||
|
|
||||||
if( $mode == "editgroup" )
|
if( $mode == "editgroup" )
|
||||||
{
|
{
|
||||||
|
$sql = "SELECT *
|
||||||
|
FROM " . GROUPS_TABLE . "
|
||||||
|
WHERE group_single_user <> " . TRUE . "
|
||||||
|
AND group_id = " . $group_id;
|
||||||
|
if(!$result = $db->sql_query($sql))
|
||||||
|
{
|
||||||
|
message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
if( !$db->sql_numrows($result) )
|
||||||
|
{
|
||||||
|
message_die(GENERAL_MESSAGE, "That user group does not exist");
|
||||||
|
}
|
||||||
|
$group_info = $db->sql_fetchrow($result);
|
||||||
|
|
||||||
echo $sql = "UPDATE " . GROUPS_TABLE . "
|
if ( $group_info['group_moderator'] != $group_moderator )
|
||||||
|
{
|
||||||
|
if ( $delete_old_moderator != "" )
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
|
||||||
|
WHERE user_id = " . $group_info['group_moderator'] . " AND group_id = " . $group_id;
|
||||||
|
if ( !$result = $db->sql_query($sql) )
|
||||||
|
{
|
||||||
|
message_die(GENERAL_ERROR, "Couldn't update group moderator", "", __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
|
||||||
|
VALUES (" . $group_id . ", " . $group_moderator . ", 0)";
|
||||||
|
if ( !$result = $db->sql_query($sql) )
|
||||||
|
{
|
||||||
|
message_die(GENERAL_ERROR, "Couldn't update group moderator", "", __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sql = "UPDATE " . GROUPS_TABLE . "
|
||||||
SET group_type = $group_type, group_name = '" . $group_name . "', group_description = '" . $group_description . "', group_moderator = $group_moderator
|
SET group_type = $group_type, group_name = '" . $group_name . "', group_description = '" . $group_description . "', group_moderator = $group_moderator
|
||||||
WHERE group_id = $group_id";
|
WHERE group_id = $group_id";
|
||||||
if ( !$result = $db->sql_query($sql) )
|
if ( !$result = $db->sql_query($sql) )
|
||||||
@ -196,7 +231,7 @@ else if( isset($HTTP_POST_VARS['group_update']) )
|
|||||||
{
|
{
|
||||||
|
|
||||||
$sql = "INSERT INTO " . GROUPS_TABLE . " (group_type, group_name, group_description, group_moderator, group_single_user)
|
$sql = "INSERT INTO " . GROUPS_TABLE . " (group_type, group_name, group_description, group_moderator, group_single_user)
|
||||||
VALUES ($group_type, '" . $group_name . "', '" . $group_description . "', $group_moderator, '0')";
|
VALUES ('" . $group_type . "', '" . $group_name . "', '" . $group_description . "', '" . $group_moderator . "', '0')";
|
||||||
if ( !$result = $db->sql_query($sql) )
|
if ( !$result = $db->sql_query($sql) )
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, "Couldn't insert new group", "", __LINE__, __FILE__, $sql);
|
message_die(GENERAL_ERROR, "Couldn't insert new group", "", __LINE__, __FILE__, $sql);
|
||||||
|
@ -1005,6 +1005,9 @@ $lang['reset_group_changes'] = "Reset Changes";
|
|||||||
$lang['No_group_name'] = "You must specify a name for this group";
|
$lang['No_group_name'] = "You must specify a name for this group";
|
||||||
$lang['No_group_moderator'] = "You must specify a moderator for this group";
|
$lang['No_group_moderator'] = "You must specify a moderator for this group";
|
||||||
$lang['No_group_mode'] = "You must specify a mode for this group, open or closed";
|
$lang['No_group_mode'] = "You must specify a mode for this group, open or closed";
|
||||||
|
$lang['delete_group_moderator'] = "Delete the old group moderator?";
|
||||||
|
$lang['delete_moderator_explain'] = "If you're changing the group moderator, check this box to remove the old moderator from the group. Otherwise, do not check it, and the user will become a regular member of the group.";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -23,6 +23,12 @@
|
|||||||
<td class="row1" width="38%"><span class="gen">{L_GROUP_MODERATOR}:</span></td>
|
<td class="row1" width="38%"><span class="gen">{L_GROUP_MODERATOR}:</span></td>
|
||||||
<td class="row2">{S_GROUP_MODERATOR}</td>
|
<td class="row2">{S_GROUP_MODERATOR}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="38%"><span class="gen">{L_DELETE_MODERATOR}:</span>
|
||||||
|
<br />
|
||||||
|
<span class="gensmall">{L_DELETE_MODERATOR_EXPLAIN}</span></td>
|
||||||
|
<td class="row2"><input type="checkbox" name="delete_old_moderator" value="1" /> {L_YES}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="38%"><span class="gen">{L_GROUP_STATUS}:</span></td>
|
<td class="row1" width="38%"><span class="gen">{L_GROUP_STATUS}:</span></td>
|
||||||
<td class="row2"><input type="radio" name="group_type" value="1" {S_GROUP_OPEN_CHECKED} />{L_GROUP_OPEN} <input type="radio" name="group_type" value="0" {S_GROUP_CLOSED_CHECKED} /> {L_GROUP_CLOSED}</td>
|
<td class="row2"><input type="radio" name="group_type" value="1" {S_GROUP_OPEN_CHECKED} />{L_GROUP_OPEN} <input type="radio" name="group_type" value="0" {S_GROUP_CLOSED_CHECKED} /> {L_GROUP_CLOSED}</td>
|
||||||
|
@ -24,6 +24,14 @@
|
|||||||
<td class="row1" width="38%"><span class="gen">{L_GROUP_MODERATOR}:</span></td>
|
<td class="row1" width="38%"><span class="gen">{L_GROUP_MODERATOR}:</span></td>
|
||||||
<td class="row2" width="62%">{S_SELECT_MODERATORS}</td>
|
<td class="row2" width="62%">{S_SELECT_MODERATORS}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="38%"><span class="gen">{L_DELETE_MODERATOR}</span>
|
||||||
|
<br />
|
||||||
|
<span class="gensmall">{L_DELETE_MODERATOR_EXPLAIN}</span></td>
|
||||||
|
<td class="row2" width="62%">
|
||||||
|
<input type="checkbox" name="delete_old_moderator" value="1">
|
||||||
|
{L_YES}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="38%"><span class="gen">{L_GROUP_STATUS}:</span></td>
|
<td class="row1" width="38%"><span class="gen">{L_GROUP_STATUS}:</span></td>
|
||||||
<td class="row2" width="62%">
|
<td class="row2" width="62%">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user