Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Sep 19, 2009 5:48 pm Reply with quote

There is a bug with public/private custom fields that may allow a registered user see another private fields.

Find line 105 of /modules/Your_Account/public/userinfo.php
Code:


if (is_admin($admin) OR (is_user($user) AND $usrinfo['username'] == $username)) {

Change to:
Code:


if (is_admin($admin) OR (is_user($user) AND $usrinfo['username'] == $userinfo['username'])) {

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan.

Last edited by Palbin on Mon Oct 26, 2009 2:03 pm; edited 1 time in total 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Sun Sep 20, 2009 7:42 am Reply with quote

Under which conditions was this a problem (i.e. when is $username != $userinfo['username'])?

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
gazj
Worker
Worker



Joined: Apr 28, 2006
Posts: 152
Location: doncaster england

PostPosted: Sun Sep 20, 2009 7:46 am Reply with quote

does'nt the YA use define('MY_PROFILE') wont it be easier to change it to

Code:
if (is_admin($admin) OR (defined('MY_PROFILE'))) { 
 
View user's profile Send private message Visit poster's website
Palbin







PostPosted: Sun Sep 20, 2009 9:43 am Reply with quote

kguske wrote:
Under which conditions was this a problem (i.e. when is $username != $userinfo['username'])?


It was not a problem when "!=". It was a problem when "==" when a person is viewing another users profile because $username is the name in the URI and $usrinfo['username'] (not $userinfo['username']) is based on $username.

So insteead of comparing the person your searching for ($username & $usrinfo['username']) with itself you need to compare the perason you are searching for with yourself ( $username & $userinfo['username']) .

@gazj
Yes gazj after making this post and doing a more indepth solution I did change all instances like this to use the constant. I can't remerber the name of the constant. Its not MY_PROFILE. The reason I used the constant is becuase if you don't you have to worry about doing a strtolower() for everything.
 
gazj







PostPosted: Sun Sep 20, 2009 10:34 am Reply with quote

yeah i know its not MY_PROFILE but i thought you would get what i meant lol i only mentioned it as i remember from when i was looking at the userinfo file when i did something for kguske

i use MY_PROFILE in my YA thats where i got MY_PROFILE from
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©