I just upgraded my site to 2.3.01 and tried to delete some test users i created via the Forums ACP. I check the box to delete the user and hit submit and get the following error:
Code:
Could not delete group for this user
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2
DELETE FROM nuke_bbgroups WHERE group_id =
Line : 140
File : admin_users.php
So far as i know, the user should not be in ANY groups, as its a brand new account i created to test an Invalid Session error we're seeing with new users only (since about the time i did the upgrade).
The user actually was deleted. but the error message should be investigated im sure.
Actually they are - every user as a "Personal Group" which they are assigned and used for permissions. Next time, run the fixgroup script should create all those personal groups.
Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
Posted:
Wed Mar 25, 2009 9:13 am
BTW, RN users should ONLY be created using the Your Account ("Edit Users") module and not the forums. In turn, you would use the same admin module to also deactivate and then delete.
I faced this problem today - cool stuff - where can i access the fixgroup script?
here you go
Code:
<?php
//** After applying the above new users should get a group assigned to them but users that had registered before might now have one, to correct this save the following to a file, name it fixgroup.php upload it to your Forum's folder and point your browser to: http://your_site.com/modules.php?name=Forums&file=fixgroup Delete the file once done. ***//
//***** check users and user groups ****//
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
if ($popup != "1"){
$module_name = basename(dirname(__FILE__));
require("modules/".$module_name."/nukebb.php");
}
else
{
$phpbb_root_path = 'modules/Forums/';
}
$sql1 = "SELECT ug.group_id
FROM " . USER_GROUP_TABLE ." ug, ". GROUPS_TABLE. " g
WHERE ug.user_id = $user_id
AND ug.group_id = g.group_id
AND g.group_single_user = 1
";
if ( ($result1 = $db->sql_query($sql1)) )
{
$row1 = $db->sql_fetchrow($result1);
$usergroup =( ( $row1['group_id'] != '' ) ? $row1['group_id'] : 'User has no user group'.$row1 );
}
if (!($row1['group_id'] != ''))
{
$sql2 = "SELECT MAX(group_id) AS total
FROM " . GROUPS_TABLE;
if ( !($result2 = $db->sql_query($sql2)) )
{
message_die(GENERAL_ERROR, 'Could not obtain next group_id information', '', __LINE__, __FILE__, $sq2l);
}
if ( !($row2 = $db->sql_fetchrow($result2)) )
{
message_die(GENERAL_ERROR, 'Could not obtain next group_id information', '', __LINE__, __FILE__, $sql2);
}
$group_id = $row2['total'] + 1;
$sql3 = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_description, group_single_user, group_moderator)
VALUES ($group_id, '', 'Personal User', 1, 0)";
if ( !($result3 = $db->sql_query($sql3, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql3);
}
$sql4 = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
VALUES ($user_id, $group_id, 0)";
if( !($result4 = $db->sql_query($sql4, END_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into user_group table', '', __LINE__, __FILE__, $sql4);
}
$usergroup = $usergroup.', adding user group '.$group_id;
}
Just had an additional observation.
When i use the RNYA to deactivate a user and then delete them, all their posts remain behind!! - with user of Anonymous...
While if using the delete user option within the Forum Admin section, the user and all their posts are deleted!
Is there a reason that wasnt implemented in the RNYA edit user module?
Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
Posted:
Wed Sep 23, 2009 9:48 pm
User administration is not supposed to be done via the Forums admin. Period. We are working on stripping it out or blocking it completely some how. The logic within the RNYA module is the logic that has been in nukes YA module for quite some time.
I never like just deleting forum posts. There could be valuable data there from previous posting history. The reasons for deleting a user are many, so we shy on the conservative side: leave the posts and let the admin decide which to keep vs. which to remove.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum