|
Page 1 of 2
|
ganesh 
Joined: August 2006
Posts: 221
Location:  Somewhere... over the Rainbow...
|
 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.
|
#1 Fri 30 Sep, 2011 09:52 |
|
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
mort 
 Spam Basher

Joined: August 2010
Posts: 998
Location:  Up a tree
|
 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?
|
#2 Fri 30 Sep, 2011 11:43 |
|
ganesh 
Joined: August 2006
Posts: 221
Location:  Somewhere... over the Rainbow...
|
 Re: Can't Change Permission
Yes, I did clean the cache, and no, I didn't clear any table.
|
#3 Fri 30 Sep, 2011 11:44 |
|
mort 
 Spam Basher

Joined: August 2010
Posts: 998
Location:  Up a tree
|
 Re: Can't Change Permission
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.
|
#4 Fri 30 Sep, 2011 12:32 |
|
ganesh 
Joined: August 2006
Posts: 221
Location:  Somewhere... over the Rainbow...
|
 Re: Can't Change Permission
Oh... You meant that. Ok, I did it, nothing changes.
|
#5 Fri 30 Sep, 2011 12:37 |
|
Informpro 
Joined: October 2008
Posts: 1110
Location:
|
 Re: Can't Change Permission
Hi.
- 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°)
|
#6 Fri 30 Sep, 2011 17:33 |
|
ganesh 
Joined: August 2006
Posts: 221
Location:  Somewhere... over the Rainbow...
|
 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.
Description: |
|
 Download |
Filename: |
admin_ug_auth.php.zip |
Filesize: |
8.22 KB |
Downloaded: |
238 Time(s) |
|
#7 Fri 30 Sep, 2011 19:10 |
|
Informpro 
Joined: October 2008
Posts: 1110
Location:
|
 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.
|
#8 Fri 30 Sep, 2011 19:28 |
|
ganesh 
Joined: August 2006
Posts: 221
Location:  Somewhere... over the Rainbow...
|
 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.
|
#9 Fri 30 Sep, 2011 19:33 |
|
mort 
 Spam Basher

Joined: August 2010
Posts: 998
Location:  Up a tree
|
 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.
|
#10 Sat 01 Oct, 2011 00:25 |
|
Informpro 
Joined: October 2008
Posts: 1110
Location:
|
 Re: Can't Change Permission
Well, I talked about it with Mighty Gorgon and he thinks your table is corrupted. AFAI Can See - while(list($forum_id, $value) = @each($_POST['private_' . $auth_field]))
- {
- $change_acl_list[$forum_id][$auth_field] = $value;
- }
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.
|
#11 Sat 01 Oct, 2011 17:56 |
|
ganesh 
Joined: August 2006
Posts: 221
Location:  Somewhere... over the Rainbow...
|
 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.
|
#12 Sat 01 Oct, 2011 18:28 |
|
Informpro 
Joined: October 2008
Posts: 1110
Location:
|
 Re: Can't Change Permission
Sftp is okay, give me these infos through MP and I'll look ASAICan.
|
#13 Sat 01 Oct, 2011 18:42 |
|
Mighty Gorgon 
Luca Libralato
Joined: August 2006
Posts: 7192
Location:  Borgo San Michele
|
 Re: Can't Change Permission
Hi my friend, I hope you are fine.
You can try this:
OPEN adm/admin_ug_auth.php
FIND
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
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
|
#14 Sun 02 Oct, 2011 01:21 |
|
ganesh 
Joined: August 2006
Posts: 221
Location:  Somewhere... over the Rainbow...
|
 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.
|
#15 Sun 02 Oct, 2011 11:59 |
|
|
Page 1 of 2
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
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
|
|
|
|