Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN Upgrade Issues
Author Message
tehw1n
Hangin' Around



Joined: Jul 15, 2008
Posts: 49

PostPosted: Sun Mar 22, 2009 11:47 pm Reply with quote

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.
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Mon Mar 23, 2009 7:20 pm Reply with quote

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.

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Wed Mar 25, 2009 9:13 am Reply with quote

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.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
khaled_dxb
Regular
Regular



Joined: Jan 15, 2007
Posts: 66

PostPosted: Sat Sep 19, 2009 1:30 am Reply with quote

I faced this problem today - cool stuff - where can i access the fixgroup script?

_________________
Khaled 
View user's profile Send private message
Unit1
Worker
Worker



Joined: Oct 26, 2004
Posts: 134
Location: Boston

PostPosted: Sat Sep 19, 2009 5:15 am Reply with quote

khaled_dxb wrote:
I faced this problem today - cool stuff - where can i access the fixgroup script?


here you go Very Happy

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/';
}

define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include('includes/functions_search.'.$phpEx);

// Start session management
$userdata = session_pagestart($user_ip, PAGE_SEARCH, $nukeuser);
init_userprefs($userdata);
// End session management

$sql = "SELECT user_id, username
    FROM " . USERS_TABLE ."
    WHERE user_id > 0";
if ( !($result = $db->sql_query($sql)) )
{
    message_die(GENERAL_ERROR, 'Could not obtain user list', '', __LINE__, __FILE__, $sql);
}

$liste ='';
while ( $row = $db->sql_fetchrow($result) )
{
   $username = $row['username'];
   $user_id = $row['user_id'];
   $usergroup = '';
     
   $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;
          }


   $liste .= ( ( $liste != '' ) ? '<br> ' : '' ) . $username.' <b>'.$usergroup.'</b>';
}

message_die(GENERAL_MESSAGE,'Users:<br>'.$liste);

?>

_________________
* 5 Simple rules to be happy: * Free Your Heart from Hatred * Free Your Mind from Worries * Live Simply * Give More * Expect Less. 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Sep 19, 2009 9:14 am Reply with quote

Within the download

\UtilityFiles\DBFixes\fixgroup.php

I'm sure the one Unit1 posted is fine as well.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
khaled_dxb







PostPosted: Wed Sep 23, 2009 9:52 am Reply with quote

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?

(or am i missing something)

K.
 
montego







PostPosted: Wed Sep 23, 2009 9:48 pm Reply with quote

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.
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Wed Aug 04, 2010 11:55 pm Reply with quote

Deleted spam post...

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN Upgrade Issues

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©