A permissions problem - link keeps giving members redirect to profile

Started by wynnyelle, January 30, 2015, 01:34:49 PM

Previous topic - Next topic

wynnyelle

We have an added feature page that appears on every member's account area. I added a link into the mini profile and main profile that lets members click the button and go directly to this page.

The links work fine for me, but all of my members are instead being redirected to the main profile page. I'm trying to figure out the cause of this and was informed it is a "permissions" problem. How would I go about fixing this? All I want it to do is stop redirecting members to the profile and instead, take them where the link is supposed to.

Kindred

well, what is this new link?

You really should know this by now...   DETAILS... SPECIFIC and CONCRETE DETAILS are the onyl way we can actually provide you with any assistance.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

Besides the link, the code of that page would be nice to have. IF there is a permissions issue then the code would probably give us the answer.

Without any of this, we can only guess ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

wynnyelle

Absolutely, here is all of it:

an example page:

http://xanje.com/index.php?topic=136339.0

This thread's actually one of the member complaints about the problem that alerted us.

The link it's supposed to be sending you to:

http://xanje.com/index.php?action=profile;area=view_pets;u=1 {1 being the member ID; it varies depending on whose membership it is}.

It is instead redirecting all members who click it, to the user's main profile instead. The pet game's an add-on.

I added the link to Display.template.php {Attaching file}.

I apologise. I should know this by now.

Kindred

OK...

So -- how is that pets page generated?

It would seem that the URL is correctly generated in display.template.php
it would also seem that attempting to go to the noted sub-page (defined by area=)is rejected and thus send you to main profile page (quite correctly)

this is possibly related to one of two things
a- that URL is wrong and the "area=pets" command is incorrect or not defined.
b- the pets area of the profile is under permission access control

Since this is not a standard feature in SMF, I would suggest that you ask the mod author...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wynnyelle

He's no longer available.

The link works for me, when I'm logged in, so it isn't option A.

Where is "permission access control" so that I can find it and start having a look at it? Would you know? There is no reason why members shouldn't have access to this page. It's just a page letting people view the pets owned by someone else. And we need this ability in order to develop the game because a huge part of the game is buying, selling, and trading these virtual pets and people need to be able to look at each other's pets in order to do this.

This may be a mod, but the original SMF permissions control would probably be using original SMF. That's why I decided to try looking here for some answers.

Kindred

no.... this is a mod.
SMF permissions do not have anything to do with access to these mod specific pages.

obviously there is some sort of permissions related to it -- which means that the mod added more permissions.  You really will have to ask the mod author, since only someone who has coded or run that mod would have ANY idea what the author did...

You can always check that standard smf permissions section in admin...   that's where permissiosn SHOULD have been added...  if they are not there, then we have no idea where the author added them.

And, if there is a permissions gate on the page, then -- very obviously -- there *IS* a reason why members do not have access to it.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wynnyelle

Thank you for your reply.

Is there a place where I can get support for a mod and its coding? The original author of this mod signed off on it last year and he is no longer available for support. I'm trying to troubleshoot it on my own and getting nowhere.

margarett

Then you need to give us the mod... It's impossible to debug such a problem without looking at the code...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

you do this a lot...

you get custom work done and then expect us to support you when the author of that work abandons it....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wynnyelle

Look, I just need to know what resources I have and if I don't have any here, I'll leave. All I wanted was for anyone to just point me in the right direction. It's not like I don't want to be able to do it myself. But SMF has about 100 million coding files and when the file I altered to produce the link isn't giving me any clues to where the problem is originating, I don't know where to go.

You replied to this so I assumed you would be willing to point me to some other site or place if you knew of any where I could get help for this. I really am doing my best here. I understand that this is a mod, but SMF DOES have a mod section so I didn't think that it would be too far out there to at the very least, just ask. This IS a support forum, and my site is an SMF forum. I posted here because although it's a mod, I was thinking that the problem was originating fro a conflict between the mod and SMF's original permissions coding. The worst thing that would happen, I assumed, was that I'd be told you can't do anything and there's nothing more that can be said here to help me.  I try to be nothing but polite and cordial to you.

Please. I just ask that people replying to this be polite to me. That's all. If you don't have any further help to offer me, you can just say you're sorry but this is outside of the support that this forum can provide. I'll understand and close the thread.

Margarett: I could get the 3 or 4 files that are from the mod, but only if you really would want to take a look at it. Those are not SMF files though they are written to work with SMF.

I am not sure how many hooks there are in my site in other files that relate to it. This was not written with standard mod protocol.

Kindred

ummm.... wow.

Well, I did try to help you...  I told you that there were two likely causes.
You are correct...  my statement a is likely not the cause, if it works for you as admin.
However that pretty much proves that my statement b is almost certainly correct...

but without admin access or the actual mod package, we really can't go any further than telling you "it is a permissions problem"
as to WHERE those permissions were added? that would be related to how the mod author coded it... if he coded it properly, the permissions are listed with the rest of them under the permissions tab... if he coded it incorrectly, they could be anywhere...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wynnyelle

I know you tried to help me, and I thanked you for it and thank you again.

Here's what I and my friend are proposing to try: changing the array on profile.php:


'permission' => array(
'own' => 'profile_view_own',
'any' => 'profile_view_any',
)



This was not done via a standard SMF mod protocol. There's no package and install thing for it like with those mods, unfortunately. I don't think that looking at this is within the scope of the support that you would be willing to look at, what I was just hoping for was to be pointed in the right direction so I'd be able to trouble shoot it on my own...I did not want to be trouble. I'm scared when I post asking for help on this forum, it was a last resort for me.

I'm nervous about changing that array in case it gives members some power over the game that I didn't intend. {I am trying to test it, but our testing environment isn't working properly. It was supposed to be refreshed but something broke completely and we spent the past 2 days trying to get it fixed just to where it would display the forum at all.}

I can dig up the files in question and post them here for you to take a look at at your leisure if you'd like--again they are not SMF files at all. I'll do what I can to see if I can get a full list of ALL coding files that have been altered by the mod so I can start trying to build a completed puzzle of what this mod does and where.

Thank you again.

Kindred

Where do you see that?   Because that is a standard smf permission and - if that was the permission used to determine access to the pets section, then it would be working... Because if you can't view the profile, you would not be seeing ANY part of the profile... Not the pets page and not the main profile page... Trying to view the profile would kick you back out to the index...

Additionally... To the bets of my knowledge, which could be wrong, but to the best of my knowledge, that code does not belong in profile.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wynnyelle

It is in profiles.php, yes.

The fix was applied but it only works part way. Members could now land on the proper page, but when they try to browse one of the sub-rooms, they are redirected to their OWN pet rooms {not their profile this time}.

I'm attaching 5 files from this mod. Nobody has to take a look at them, if you don't want to I totally understand.

Also attaching profile.php before this change was applied, since you have the code I showed you for after it was applied.

Kindred

Why do all of your files always have the excess number in the file name?  Those are not valid web files...

And I told you, that code does not belong in profile.php... But changing it would be unlikely to have the effect you were looking for anyway.

Next time someone does an edit for you, you really, really need to have them package it up as a mod. What would happen if you had to rebuild your site or if there is a conflict with something else?

I can't look tonight... Maybe tomorrow if I get to a real machine.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wynnyelle

I apologise for the numbers, they are not in the original files. It happens because when I download the files, it adds a number automatically if there's already a file with that name. It doesn't give me an option to download it to another place on my computer. I can only download it to the Downloads folder. But the real files have the same names, just not with the (2) thing on the end.

What's been happening is that I have had to spend a respectable 4 figures recently just to get the code on the site straightened out to where the site is not crashing. Now I'm trying to make the site viable with new members, and that means fixing all these small but very obstacle-creating glitches that it still has. I'm going through them one by one trying to first fix them myself, and if that doesn't work, I then look up online tutorials and such and try to glean something from that, and if that doesn't work I then begin asking people that I know and may have worked with in the past. When they can't provide any help, I wind up taking it here.

Where does that code actually belong? I'm wondering how and why it was moved to that file at all. There may have been a reason, but I don't know what that would be. Nor do I have any idea when it was done.

Thank you again.

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

wynnyelle


live627

I think found it...

'pets' => array(
'title' => $txt['profile_pet_button'],
'areas' => array(
'view_pets' => array(
'label' => $txt['view_pets'],
'file' => 'Pets.php',
'function' => 'petsController',
'permission' => array(
'own' => 'profile_view_own',
'any' => 'profile_view_admin',
),
),
),
),

I'm guessing

'any' => 'profile_view_admin',

should be

'any' => 'profile_view_any',

Advertisement: