Updating a mod, stuck on a permissions error.

Started by kneeki, April 23, 2010, 02:36:26 PM

Previous topic - Next topic

kneeki

Hey all!

I'm running into a bit of a problem while trying to update WoW Characters 1.9.0 for my guild forums. I've managed to get the installation working well with no errors, but when you try to edit your profile to view the options page, your presented with the error:

An Error Has Occurred!
You are not allowed to access this section


I've been looking into what may be causing this, and I think it's around this area here:


<file name="$sourcedir/Profile.php">
<operation>
<search position="before"><![CDATA[
'notification' => array(
'label' => $txt['notification'],
'file' => 'Profile-Modify.php',
'function' => 'notification',
'sc' => 'post',
'permission' => array(
'own' => array('profile_extra_any', 'profile_extra_own'),
'any' => array('profile_extra_any'),
),
),]]></search>
<add><![CDATA[
'wowchar' => array(
'label' => $txt['wowchar'],
'file' => 'Profile-Modify.php',
'function' => 'wowchar',
'sc' => 'post',
'permission' => array(
'own' => array('profile_view_any', 'profile_view_own'),
'any' => array('profile_view_any'),
),
),
]]></add>
</operation>
</file>


If you'd like to see the error in person, simply go here and create a trash account, then visit your profile options. Also, you can download the entire bit of work I've done here. Thanks in advance!

kat

You've done the obvious and checked permissions, yes?


You're second link's giving a 403.

kneeki

Well, the account I'm using is an administrator account, so I didn't think permissions would actually be an issue. Double checking those now.

btw, second working link. Thanks :)

kat

Yeah, you're right. Admins have all permissions.


Maybe some file(s) are read-disabled?

kat

I'm gonna move this to v2.x support.


It'll more likely get responses, there.

kneeki

Quote from: Kat on April 23, 2010, 03:37:45 PM
Yeah, you're right. Admins have all permissions.


Maybe some file(s) are read-disabled?
Hrm, read disabled? The Mod modifies a few files during the install, and it all goes well. The files it modifies are Profile.php, Display.template.php, Profile.template.php, index.template.php, ManageSettings.php, Profile.english.php, Modifications.english.php, and Help.english.php. All of these files seem to be working normally for general use. Unless I've gone and misunderstood you.

kat

Yeah... This is a long-shot, OK?


Go to Admin>Packages>File permissions.


Make sure everything is chmod: 0755.


If they're not, try changing Sources and Themes, to see if it makes any difference.


Even easier, where you see "Change File Permissions", make sure that set to "Standard".

kneeki

Everything is at 0755 except agreement.txt, Settings.php, and Settings.php.bak, which are set to 0644.

edit, also, I've checked the files in \sources\ that the mod changes, they all reflect the proper changes.

kat

Weird...


Out of curiosity, if you remove these lines:
'permission' => array(
'own' => array('profile_view_any', 'profile_view_own'),
'any' => array('profile_view_any'),




Does that cure it? (Keep a copy of the priginal)

kneeki

Removed those lines, now it's doesn't appear in the list at all. The code below is what it looks like without them:


<operation>
<search position="before"><![CDATA[
'notification' => array(
'label' => $txt['notification'],
'file' => 'Profile-Modify.php',
'function' => 'notification',
'sc' => 'post',
'permission' => array(
'own' => array('profile_extra_any', 'profile_extra_own'),
'any' => array('profile_extra_any'),
),
),]]></search>
<add><![CDATA[
'wowchar' => array(
'label' => $txt['wowchar'],
'file' => 'Profile-Modify.php',
'function' => 'wowchar',
'sc' => 'post',
),
]]></add>
</operation>

kat


kneeki

#11
They are still in the 'search' area, yeah. If I remove them from that top section it would break the install since that is all case sensitive. I removed them from the bit that is inserted for the Mod though.

edit: I just tried
               'permission' => array(
                  'own' => array(),
                  'any' => array(),
               ),


Same result. Doesn't show up. I'm beginning to think that this area I've been playing with is strictly for the menu item, not the error page.

kat

#12
So, now, you have this, yes?
'notification' => array(
            'wowchar' => array(
               'label' => $txt['wowchar'],
               'file' => 'Profile-Modify.php',
               'function' => 'wowchar',
               'sc' => 'post',
            ),
               'label' => $txt['notification'],
               'file' => 'Profile-Modify.php',
               'function' => 'notification',
               'sc' => 'post',
               'permission' => array(
                  'own' => array('profile_extra_any', 'profile_extra_own'),
                  'any' => array('profile_extra_any'),
               ),



I'm wondering if it shouldn't be:



'notification' => array(
               'wowchar' => array(
               'label' => $txt['wowchar'],
               'file' => 'Profile-Modify.php',
               'function' => 'wowchar',
               'sc' => 'post',
               'label' => $txt['notification'],
               'file' => 'Profile-Modify.php',
               'function' => 'notification',
               'sc' => 'post',
               'permission' => array(
               'own' => array('profile_extra_any', 'profile_extra_own'),
               'any' => array('profile_extra_any'),
               ),

kneeki

Just updated with what you just gave me, and it overwrites the 'Notifications' entry in the list.


<operation>
<search position="before"><![CDATA[
'notification' => array(
'label' => $txt['notification'],
'file' => 'Profile-Modify.php',
'function' => 'notification',
'sc' => 'post',
'permission' => array(
'own' => array('profile_extra_any', 'profile_extra_own'),
'any' => array('profile_extra_any'),
),
),]]></search>
<add><![CDATA[
'notification' => array(
'wowchar' => array(
   'label' => $txt['wowchar'],
   'file' => 'Profile-Modify.php',
   'function' => 'wowchar',
   'sc' => 'post',
),
               'label' => $txt['notification'],
               'file' => 'Profile-Modify.php',
               'function' => 'notification',
               'sc' => 'post',
               'permission' => array(
                  'own' => array('profile_extra_any', 'profile_extra_own'),
                  'any' => array('profile_extra_any'),
               ),]]></add>
</operation>


Also, clicking on the item takes me to the Notifications options config =p

kat

Oh, Poo!


Let me sleep on it. (It's getting late, here in England).


If someone who knows better pops in, all well and good, eh?

kneeki

I got it! :D


<operation>
<search position="before"><![CDATA[
'notification' => array(
'label' => $txt['notification'],
'file' => 'Profile-Modify.php',
'function' => 'notification',
'sc' => 'post',
'permission' => array(
'own' => array('profile_extra_any', 'profile_extra_own'),
'any' => array('profile_extra_any'),
),
),]]></search>
<add><![CDATA[
'wowcharacters' => array(
'label' => $txt['wowchar'],
'file' => 'Profile-Modify.php',
'function' => 'wowchar',
'sc' => 'post',
'permission' => array(
'own' => array('profile_extra_any', 'profile_extra_own'),
'any' => array('profile_extra_any'),
),
),
]]></add>
</operation>


!!! Thanks for all your help :D

kat

Aha! Yeah! That makes sense, ay?


I'd call that "Teamwork"!


Well done, kneeki!

Advertisement: