Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 2
Goto page 1, 2  Next
 
Reply with quote Download Post 
Post Can't Change Permission 
 
Hi all,

One moderator of mine left, so I removed him from moderators group and so on...
Now, he IS a normal registered user but still appears as a Moderator under a specific forum.
That's because when I try to change his permissions and I choose "is not moderator" the ACP keeps saying:

Quote:
Couldn't obtain user/group permissions

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 'AND g.group_single_user = 1' at line 1

SELECT aa.*, g.group_single_user FROM phpbb_auth_access aa, phpbb_user_group ug, phpbb_groups g WHERE ug.user_id = 18 AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND aa.forum_id = AND g.group_single_user = 1

Line : 280
File : admin_ug_auth.php


Any ideas? Thanks in advance.
 




____________
Megabass
 
ganeshSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Did you clear the cache after you made the changes?

You also have Db Maintenance in the ACP to clean tables - did you try that?
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Yes, I did clean the cache, and no, I didn't clear any table.
 




____________
Megabass
 
ganeshSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
ganesh wrote: [View Post]
I didn't clear any table.


Db Maintenance doesn't clear tables, it's a repair tool to fix many errors that develop in the DB from time to time.

A word of advice - Only use the parts of it you fully understand or you can get into problems with it. And better still - Do a full backup of your DB before you start.


 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Oh... You meant that. Ok, I did it, nothing changes.
 




____________
Megabass
 
ganeshSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Hi.

Code: [Download] [Hide]
  1. SELECT aa.*, g.group_single_user FROM phpbb_auth_access aa, phpbb_user_group ug, phpbb_groups g WHERE ug.user_id = 18 AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND aa.forum_id = AND g.group_single_user = 1 
The problem is "AND aa.forum_id = AND". The forum ID is missing.

It looks like you're not running the last version, so could you please
1) try with the latest github version
2) give me the lines around 280 (5 lines I.E., saying which is the 280°)
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Informpro, thank you very much.

The version is 1.3.0.53b.
I cannot try github versions, upgrades are a pain for my forum.

Anyway, here's the entire file if you want. Keep in mind that the problem is not related to all users, but to this specific one.

admin_ug_auth.php.zip
Description:  
Download
Filename: admin_ug_auth.php.zip
Filesize: 8.22 KB
Downloaded: 212 Time(s)

 




____________
Megabass
 
ganeshSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
If this works with other members, it's strange. Would you please try moidifying permissions of a different user (same forum), and different forum (same user). Also try in Adv. mode. I'll try to installed IP 1.3b ASAICan to find out what's happening.
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Different user (same forum), everything's fine.
Different forum (same user), same error.

And for this user I only can see Adv. Mode, no way to see it simple. It's very strange, indeed.
 




____________
Megabass
 
ganeshSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
If you google those sql strings you'll see that Nuke and phpBB has similar problems. And from what I can make out - it has something to do with downgrading the user at the very same time he's posting something.

I didn't read into it too much - I'll leave that to you and informpro.
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Well, I talked about it with Mighty Gorgon and he thinks your table is corrupted. AFAI Can See
Code: [Download] [Hide]
  1.                     while(list($forum_id, $value) = @each($_POST['private_' . $auth_field])) 
  2.                     { 
  3.                         $change_acl_list[$forum_id][$auth_field] = $value; 
  4.                     } 
I think this problem may cause another problem(s) later, so if you can lend me an admin account (to change permissions) + ftp account (to edit the file) I'd like to try to solve the problem - no problem if you can't.
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Informpro, I'd be glad.
No problem for the admin account. But I don't have any ftp account. I make everything through sftp from my Mac in Milan. But I can access files only from there.
If you want, I can give you the files anyway.
 




____________
Megabass
 
ganeshSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Sftp is okay, give me these infos through MP and I'll look ASAICan.
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Hi my friend, I hope you are fine.

You can try this:

OPEN adm/admin_ug_auth.php

FIND
Code: [Download] [Hide] [Select]
                    while(list($forum_id, $value) = @each($_POST['private_' . $auth_field]))
                    {
                        $change_acl_list[$forum_id][$auth_field] = $value;
                    }

                    if (!isset($used_forums[$forum_id]))
                    {
                        $sql = ($mode == 'user') ? ("SELECT aa.*, g.group_single_user FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE. " g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND aa.forum_id = $forum_id AND g.group_single_user = 1") : ("SELECT * FROM " . AUTH_ACCESS_TABLE . " WHERE group_id = $group_id AND forum_id = $forum_id");
                        if (!($result = $db->sql_query($sql)))
                        {
                            message_die(GENERAL_ERROR, "Couldn't obtain user/group permissions", "", __LINE__, __FILE__, $sql);
                        }
                        if ($row = $db->sql_fetchrow($result))
                        {
                            for ($k = 0; $k < count($forum_auth_fields); $k++)
                            {
                                $change_acl_list[$forum_id][$forum_auth_fields[$k]] = $row[$forum_auth_fields[$k]];
                            }
                        }
                        $used_forums[$forum_id] = 1;
                    }


REPLACE WITH
Code: [Download] [Hide] [Select]
                    while(list($forum_id, $value) = @each($_POST['private_' . $auth_field]))
                    {
                        // Mighty Gorgon: I have moved this part of code in this cycle to be able to use $forum_id var, otherwhise it was not assigned...
                        // FORUMS AUTH MOVED CODE - BEGIN
                        if (!isset($used_forums[$forum_id]))
                        {
                            $sql = ($mode == 'user') ? ("SELECT aa.*, g.group_single_user FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE. " g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND aa.forum_id = $forum_id AND g.group_single_user = 1") : ("SELECT * FROM " . AUTH_ACCESS_TABLE . " WHERE group_id = $group_id AND forum_id = $forum_id");
                            $result = $db->sql_query($sql);

                            if ($row = $db->sql_fetchrow($result))
                            {
                                for ($k = 0; $k < sizeof($forum_auth_fields); $k++)
                                {
                                    $change_acl_list[$forum_id][$forum_auth_fields[$k]] = $row[$forum_auth_fields[$k]];
                                }
                            }
                            $used_forums[$forum_id] = 1;
                        }
                        /*
                        */
                        // FORUMS AUTH MOVED CODE - END
                        $change_acl_list[$forum_id][$auth_field] = $value;
                    }



Let me know if it works for you.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Can't Change Permission 
 
Hi Luca, glad to hear from you.
Your patch worked flawlessly, thank you very much.
Everything now seems to work fine.

What I have to do now? I keep the patched file or do I restore the old one?

Thank you so much, as usual.
 




____________
Megabass
 
ganeshSend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 2
Goto page 1, 2  Next


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events