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
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Thu Aug 19, 2010 9:07 am Reply with quote

I think I did this once before on the other server, but nonetheless I need to be able to disable anonymous users from being able to email content entries to friends, etc. Only reg'd users to have the ability or disable it altogether.

Jon?

Cheers
 
View user's profile Send private message
Palbin
Site Admin



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

PostPosted: Thu Aug 19, 2010 10:18 am Reply with quote

You need to find the appropriate section of code and wrap it in
Code:
 if (is_user($user))) {


}

_________________
"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. 
View user's profile Send private message
dad7732







PostPosted: Thu Aug 19, 2010 10:54 am Reply with quote

Ok, I have three lines referring to mailing to "friend":

Code:
case 'share_page': include('modules/'.$module_name.'/var/friend.php'); break;


The other two lines just echo an output to screen.

Wrap just this line above, like?:

Code:


if (is_user($user))) {
case 'share_page': include('modules/'.$module_name.'/var/friend.php'); break;
}


What about just commenting out the line instead?

Thanks
 
dad7732







PostPosted: Thu Aug 19, 2010 10:58 am Reply with quote

Commenting out the line works, when clicking on the envelope to mail to a friend, it just brings back the content index page. But I don't know if this is the RIGHT way to do it, re:, ill effects?? Don't see any .. yet. Wink
 
Palbin







PostPosted: Thu Aug 19, 2010 11:05 am Reply with quote

Try this.
Code:


case 'share_page':
   if (is_user($user))) {
      include('modules/' . $module_name . '/var/friend.php');
   } else {
      header('Location: ../../modules.php?name=' . $module_name);
      die();
   }
   break;


I would still wrap the echo statements in:
Code:


 if (is_user($user))) {

}
 
jestrella
Moderator



Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic

PostPosted: Thu Aug 19, 2010 10:04 pm Reply with quote

Will work the way you proposed! But links will still be shown to anonymous users.

BTW it sure need to be a registered only function, So I'll address this for next release...

_________________
"For those whom have not reach the sky... Every mountain seems high"

Best Regards
Jonathan Estrella [ Only registered users can see links on this board! Get registered or login! ] 
View user's profile Send private message Visit poster's website
dad7732







PostPosted: Fri Aug 20, 2010 6:09 am Reply with quote

jestrella wrote:
Will work the way you proposed! But links will still be shown to anonymous users.

BTW it sure need to be a registered only function, So I'll address this for next release...


I made it so that te envelope icon doesn't show and therefore neither does the link .. Smile

Cheers
 
jestrella







PostPosted: Fri Aug 20, 2010 7:57 am Reply with quote

Great, anyways I'll be working on this for next release...
 
dad7732







PostPosted: Fri Aug 20, 2010 8:42 am Reply with quote

Thanks for your attention. I can fix problems with bandaids, just can't do it programmatically. Sad

Cheers
 
dad7732







PostPosted: Thu Oct 28, 2010 11:28 am Reply with quote

Somehow or another, the problem returned, I think by re-uploading the distro when I changed servers. Ok tho, I disabled the "friend email" for the time being until a future release.

Cheers
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Oct 30, 2010 9:42 am Reply with quote

Guys, it is one thing to not show a link and an entirely different thing if you also do not disable that function altogether. Once the "attack vector" is known, ie., the op=FriendSend, you have to disable that function altogether.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
dad7732







PostPosted: Sat Oct 30, 2010 9:50 am Reply with quote

Very true, but mine is "disabled", url does not work, just brings up the Content again.

Cheers
 
montego







PostPosted: Sat Oct 30, 2010 10:08 am Reply with quote

Sorry, meant op=SendPage. Just remember that the attacker doesn't have to link into the FriendSend page to do this. I can create a form on my own site with a post to the SendPage op with all the fields filled in (or just send the post from a program). You really need to disable to SendPage function for anonymous if you really want to stop this.
 
dad7732







PostPosted: Sat Oct 30, 2010 10:54 am Reply with quote

That doesn't work either but I don't remember disabling it anywhere.
 
montego







PostPosted: Sat Oct 30, 2010 11:11 am Reply with quote

dad7732, if you want me to try, PM me your site link.
 
dad7732







PostPosted: Sat Oct 30, 2010 11:16 am Reply with quote

Better yet, PM me the URL to try.
 
montego







PostPosted: Sat Oct 30, 2010 5:31 pm Reply with quote

dad7732, I can't just give you a link because that would be a GET request and the code is looking for a POST. You may want to try to see if you can get to the content page using:
[ Only registered users can see links on this board! Get registered or login! ] (change the content id to whatever you have that is available)

Beyond this, I do not want to disclose any more than this. The rest of what we do should be via PM or just send me an email (since my email address hasn't changed since being on the RN Team Wink ) and we can work through this off-line.
 
montego







PostPosted: Sun Oct 31, 2010 8:51 am Reply with quote

jestrella wrote:
BTW it sure need to be a registered only function, So I'll address this for next release...


Any way you can maybe make that configurable? News and some blog sites allow you to "share article" type capability and these are anonymous. Someone might still want this capability. However, if I allow anonymous on my site, I would want the RN captcha protecting the final send of that form (again configurable in rnconfig.php with the other module-level captcha settings).
 
dad7732







PostPosted: Sun Oct 31, 2010 9:46 am Reply with quote

It works on a site where friend is not disabled but does not work on one that is.

Cheers
 
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 ©