CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#4952] Alias changes if user has no permission "Manage All Content"

avatar
Created By: Georg Busch (nan)
Date Submitted: Tue May 18 11:52:02 -0400 2010

Assigned To:
Version: 1.7.1
CMSMS Version: None
Severity: Major
Resolution: Fixed
State: Closed
Summary:
Alias changes if user has no permission "Manage All Content"
Detailed Description:
If user has no permission "Manage All Content" and edits a page and saves
without doing any changes the alias becomes [OLD ALIAS]-2.
If he changes the menutext the alias changes to the new menutext.

This only happens if auto alias is on.
If auto alias is off editors without permission "Manage All Content" are not
able to change the page content because it always results in the error message
"Alias must be all letters and numbers".

This is because users without the permission "Manage All Content" don't see the
options tab when editing a page.
This means that there is no alias given since the input field of the alias is
missed now.
And that means - if auto alias is on - the menutext will be taken as alias.
The system now only checks if the alias is already in use but not if this is its
initial alias.
That means if you don't change the menutext a "-2" will always be appended to
the original alias since there already exists a page with that alias (what
actually is the same page).
And if you change the menutext you change the alias completely to the new menu
text.

In brief: if there is no param for the the alias the old alias should be used.
Otherwise it will change accidently. I don't need to mention what a frequent
changing alias may cause ...

Here is a code snippet that will fix this:

In the file lib/classes/class.content.inc.php in line 1470 before
$this->SetAlias($tmp); just insert this lines:

// added by NaN (bugfix to prevent changing alias if user has no permission)
	else
		$tmp = $this->mOldAlias;

So this means if no alias is given, the old one will be used.


History

Comments
avatar
Date: 2010-05-18 14:33
Posted By: Ronny Krijt (ronnyk)

Reproduced on SVN version: 6297.

When an user belongs to a group without Manage-All-Content, saving an exisiting
page, regenerates the alias to alias-2, saving again makes the alias-2 to alias
again... Every submit, toggles the alias.
      
avatar
Date: 2010-05-28 13:56
Posted By: Ronny Krijt (ronnyk)

Fixed in SVN.
      
avatar
Date: 2010-05-28 13:57
Posted By: Ronny Krijt (ronnyk)

sorry, wrong tracker...
      
avatar
Date: 2010-05-31 14:55
Posted By: Rolf (rolf1)

Fixed in SVN Rev. 6339
      
avatar
Date: 2010-07-06 14:31
Posted By: Rolf (rolf1)

1.8 is released
      
Updates

Updated: 2010-07-06 14:31
state: Open => Closed

Updated: 2010-05-31 14:55
resolution_id: 6 => 7

Updated: 2010-05-28 13:57
resolution_id: 7 => 6

Updated: 2010-05-28 13:56
resolution_id: 6 => 7

Updated: 2010-05-18 14:14
resolution_id: => 6