https://www.icyphoenix.com/viewtopic.php?f=35&t=6123
-----------------------------------
d16174l4n63l
Sun 19 Jul, 2009 06:00

1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
I just followed the directions for upgrading my installation.  I would like to start off by saying absolutly sexy and I love what is now there, the IP team makes me very happy and I enjoy IP a lot, swear by it in fact.

So, down to business I suppose.

during 1.2.0.27 I had an issue with multiple sub forums and being unable to use advanced permission.  It would always send me back to Group Permissions. 
A fix was made by Hal 9000 which did fix the problem and everything was absolutly awsome.  I had email issues and lost track from there, but I was okay and had directed posts in kind.

So, did my upgrade very excited about the new version.  Follwed everything to the line, everything went swimingly until I had to change advanced permissions again.  It routes me right back to Group Permissions again.

On the logs I get

Today at 22:26	adm/admin_ug_auth.php	    ADMIN	MESSAGE	 	message to the user, code 202 
Today at 22:26	adm/admin_ug_auth.php    ADMIN	ADMIN_USER_AUTH	ghost	ADMIN edited permissions of ghost (user)

Any thoughts, did something not go right that I missed?


-----------------------------------
d16174l4n63l
Mon 20 Jul, 2009 06:18

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
Okay I have done some checking to recreate the circumstances again.

I did a fresh install of 1.3.0.53.  Install went fine, my forum structure is like this.

Catagory 1
Forum 1
Catagory 2
     Forum 2
     Catagory 3
          Forum 3

Each forum is set to Private on all options.

I went to the user I created, it started at simple permissions.  I went to advanced and changed just three permissions.  I then hit submit, and it brought me to the group permissions control page.  This is on a live page with no modifications to the database.

[hr]

Now, I used a default WAMP 5 server package and installed.  Under the came settings I get the following.

[code linenumbers=true]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 ip_auth_access aa, ip_user_group ug, ip_groups g WHERE ug.user_id = 3 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[/code]

So where to go from here, I do not know.  I have found out that there is an issue almost identical with phpbb2 with a couple of mods, but their fix even when adapted did not change anything.


UPDATED 

So, I managed to get the WAMP version to save permissions and bypass the error mind you this is just a temp fix but it works thus far.

[code linenumbers=false]
Open ./adm/admin_ug_auth.php
-------------------------------------------------------------------------------
Find (Around line 280 )
-------------------------------------------------------------------------------
$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;
-------------------------------------------------------------------------------
IN-LINE FIND
-------------------------------------------------------------------------------
if (!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, "Couldn't obtain user/group permissions", "", __LINE__, __FILE__, $sql);
	}
-------------------------------------------------------------------------------
REPLACE WITH
-------------------------------------------------------------------------------
if (!($result = $db->sql_query($sql)))
	/* {
		message_die(GENERAL_ERROR, "Couldn't obtain user/group permissions", "", __LINE__, __FILE__, $sql);
	} */
[/code]

With this change you are able to adjust advanced permissions, in forums styles like mine.  Included is a default file for replacement, it has no other mods than what is listed above.


-----------------------------------
Mighty Gorgon
Wed 22 Jul, 2009 13:36

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
Hi,
thanks for reporting this.

I will test it on my local environment and let you know.

Hal9000 fix has been included into Icy Phoenix 1.3 if I remember well... :roll:


-----------------------------------
d16174l4n63l
Thu 23 Jul, 2009 00:45

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
Hals fix is there.

The behavior change I am noticing is that before there was a hesitation when you hit submit where you would actively see the things you didn't change disappear before it executed in 1.2.0.27.  

Let me know if there is anything I can do to help you out.  Any information you want or otherwise in case I have not been descriptive.


-----------------------------------
Mighty Gorgon
Thu 23 Jul, 2009 12:39

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
I made some tests.

The code in that file is buggy.

Try replacinge the whole ELSE part (around line 263) with this and let me know if everything works fine.

[codeblock] 
			else
			{
				$change_acl_list = array();
				$forums_processed = array();
				for($j = 0; $j < count($forum_auth_fields); $j++)
				{
					$auth_field = $forum_auth_fields[$j];
					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($forums_processed[$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]];
								}
							}
							$forums_processed[$forum_id] = 1;
						}
						// FORUMS AUTH MOVED CODE - END
						$change_acl_list[$forum_id][$auth_field] = $value;
					}
				}
			}[/codeblock]


-----------------------------------
d16174l4n63l
Thu 23 Jul, 2009 13:40

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
[Thu Jul 23 11:31:51 2009] [error] [client 72.66.0.234] File does not exist: /home/mysite/public_html/http:, referer: http://mysite.org/adm/admin_ug_auth.php?sid=7b89ba7401f1531e56d59f8574ec18d5
[Thu Jul 23 11:29:19 2009] [error] [client 72.66.0.234] File does not exist: /home/mysite/public_html/http:, referer: http://mysite.org/adm/admin_ug_auth.php?sid=7b89ba7401f1531e56d59f8574ec18d5

Got this from the server error log, and behaviors hasn't changed.

[b]Update[/b]
My userss are reporting en masse the following


[Icy Phoenix Debug] PHP Notice: in file /includes/bbcode.php on line 3621: Missing argument 2 for BBCode::plain_message(), called in /includes/functions_post.php on line 1083 and defined
[Icy Phoenix Debug] PHP Notice: in file /posting.php on line 1324: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2004)
[Icy Phoenix Debug] PHP Notice: in file /includes/functions.php on line 1236: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2004)


-----------------------------------
Mighty Gorgon
Thu 23 Jul, 2009 20:06

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
About permissions that is strange... I have tried on my own testing site and it is working fine, please try to download the file from SVN so you are sure you have the right file.

Regarding BBCodes:
OPEN [b]includes/functions_post.php[/b]
FIND
[codeblock]						$post_text = $bbcode->plain_message($post_text);[/codeblock]
REPLACE WITH
[codeblock]						$post_text = $bbcode->plain_message($post_text, '');[/codeblock]


-----------------------------------
spydie
Thu 23 Jul, 2009 21:11

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
hm 

[spoiler][Icy Phoenix Debug] PHP Notice: in file /posting.php on line 1324: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2004)
[Icy Phoenix Debug] PHP Notice: in file /includes/functions.php on line 1236: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2004)[/spoiler]

that look´s like the cache problem i had with .27

thing is it only turned up on my live site but not on my localserver.

but that issue only turned up in ACP not in forum.
and disapeared after reload off the page . 

hmpf


-----------------------------------
d16174l4n63l
Thu 23 Jul, 2009 21:28

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
Downloaded the SVN file of admin_ug_auth.php, uploaded it and no change to the behavior but the functions_post.php worked smashingly.

As I recall the issue was the size of the data being dealt with.  The fix that Hal 9000 did essentially cached it, checked for a change and only sent the changed ignoring the other data.

I know what you mean Spydee all too well.  Once fixed though whoo hoo.

[b]Update[/b]
Gorgon this is comming up in my server log whenever I try to change the permission now

[Thu Jul 23 21:20:37 2009] [error] [client 72.66.0.234] File does not exist: /home/me/public_html/http:, referer: http://mysite.org/adm/admin_ug_auth.php?sid=8fb2dd9f430e59af992bd753f78d4c05
[Thu Jul 23 20:38:06 2009] [error] [client 72.66.0.234] File does not exist: /home/me/public_html/http:, referer: http://mysite.org/adm/admin_ug_auth.php?sid=8fb2dd9f430e59af992bd753f78d4c05


-----------------------------------
Mighty Gorgon
Fri 24 Jul, 2009 01:06

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
The error should be related to a missing SPACER (due to wrong address)... I should have fixed that as well.

I'll update SVN again.

Permissions are working fine for me now. Please confirm.


-----------------------------------
d16174l4n63l
Fri 24 Jul, 2009 03:42

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
Downloaded admin_ug_auth.php from SVN and uploaded it to my server.  Behavior is still the same, advanced permissions do not update.  I cannot seem to revert to simple mode now as well.

This is the damnedest thing.  

The error [Thu Jul 23 20:38:06 2009] [error] [client 72.66.0.234] File does not exist: /home/me/public_html/http:, referer: http://mysite.org/adm/admin_ug_auth.php?sid=8fb2dd9f430e59af992bd753f78d4c05

seems to have cleared up on a good note.

I also attempted to load del_unchanged_selects.js from ./template/default/overall_inc_header_js.tpl seeing if maybe it was a hierarchy issue, but that did not help either.  I am going to attempt a few things by code comparison tonight, and edit if I come up with any new results.


-----------------------------------
Mighty Gorgon
Fri 24 Jul, 2009 10:41

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
Can you please do this for me?

[list][*]Start with a clean installation and SVN files
[*]Create two users called [b]user1[/b] and [b]user2[/b] use password same as username (also [b]admin[/b] use same password as username)
[*]Create the forum structure you mentioned
[*]Try to apply the permissions you wish and see what happens
[*]If it is not working, please export the full db and attach it here and tell me which permissions you need me to apply, I will test with that configuration[/list]

The problem is that on my local testing environment everything is working fine.


-----------------------------------
d16174l4n63l
Fri 24 Jul, 2009 15:12

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
I did exactly as you instructed, recreated the structure and it works just fine with the SVN fix, so your side is right it does work.  I am going to try a full overwrite of teh files and the svn and see if maybe something didn't copy right.

[b]Updated[/b]
I did a file update using the regular install and added in the svn updates, and the behavior is the same.  When altering the advanced permissions it goes to the group permissions selection page.

Though as I said before the one I created per your instructions works just fine.  Would suphp be an issue, because apparently it is on, and causing a couple of errors regarding memory.


-----------------------------------
d16174l4n63l
Fri 07 Aug, 2009 23:32

Re: 1.2.0.27 To 1.3.0.53 ADV Permissions Issue
-----------------------------------
It turns out, after a long stretch of testing that suPHP is the root cause of my entire issue.  Though the other corrections where awsome as well.

Add in I found out there was a 16mb sql tranfer limit that was secretly imposed.

However after reviewing logs suPHP will nearly kill an IP instillation to a crawl.


