Lavalair How Can User Edit Their Own Posts

Started on the old forum in November 2008 · view the original in the archive · old links redirect here

40 replies · 2,322 views · started 18 years ago · 1 min read

TL;DR · summary of 40 replies
  • - The fix was found by removing the ismod function, allowing all users to edit their own posts.
  • - A solution was proposed to create a custom BB code that includes the session ID in the URL instead of hardcoding it directly into links, enhancing security without requiring extensive modifications to the script.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

5 participants
monk77 Junior · 30 posts #21

QUOTE (inca @ Nov 24 2008, 11:02 PM) <{POST_SNAPBACK}>

yeah whole script would need editing i take it you want to link anywhere into your site and not give your session id away?

this is what i want. lol

something else Fellow · 2,296 posts #22

Like what iv got on my site 😛 just create a new bb code eg [internal=index.php?action=main]home [/internal] but then include session id in core rather than in the link 🙂 but bewarned you have to do it right otherwize you could end up with a hacking problem 🙂

eg: mysite.com/imGoingToStealYourSessionId.php?sid=$sid

🙂

monk77 Junior · 30 posts #23

QUOTE (inca @ Nov 24 2008, 11:17 PM) <{POST_SNAPBACK}>

Like what iv got on my site 😛 just create a new bb code eg [internal=index.php?action=main]home [/internal] but then include session id in core rather than in the link 🙂 but bewarned you have to do it right otherwize you could end up with a hacking problem 🙂

eg: mysite.com/imGoingToStealYourSessionId.php?sid=$sid

:)

Is it possible to explain that a little bit more laugh, because I don't want that someone hack me. How safe is the modified lavalair-version wapdesire. I used wapdesire. Today I read a lot here in the forum and a few people mean that lavalair is mighty crap, because it can be hacked by somebody. My problem is: I can read php code, but not writelaugh. I have play with wordpress a long time ago and so I learn a bit of php.

something else Fellow · 2,296 posts #24

just copy the url bb in core.php but change it to have session id in it 🙂 I cant code everything for you as that way you would never learn 🙂 (all the codes are in this topic you need)

wapdesire has got more security problems than lavalair. im not going to say where and how because it will just lead to more hacking. The main thing to do not to be hacked is not to piss other sites off by spamming or taking there contents... pics etc from there sites..... Most Hackers dont normally go around looking for sites to hack. They just hack the people who piss them off.

monk77 Junior · 30 posts #25

Is there a way to hide sessionid with mod rewrite?

RewriteEngine On
RewriteBase /portal/web/

Rewrite Rule ^main/sessionid /index.php?action=main&sid=$1 [QSA]
something else Fellow · 2,296 posts #26

lts a lot of work for what a simple bb code could sort out 😛

monk77 Junior · 30 posts #27

QUOTE (inca @ Nov 25 2008, 08:04 PM) <{POST_SNAPBACK}>

lts a lot of work for what a simple bb code could sort out :P

LOL. Inca, your way is another, because the session-id is only hidden by posting url with this bbcode. If a user post a complete link directly from browser, then the complete code will be shown. Mod rewrite should hide the sessionID at the beginning, so the user himself doesn't see it.

The Problem is the rewrite rules. At the moment I try a lot, but nothing would do the job. smile

something else Fellow · 2,296 posts #28

not if you use preg_replace to change sid=(.*?) into nothing 🙂

monk77 Junior · 30 posts #29
$text = preg_replace ("=sid(.*?)","",$text);

This way? 😉

something else Fellow · 2,296 posts #30

nearly 🙂 you need an ending postion as that will delete everything after sid

need 2 codes first 1 to end at the & symbol and the other for ]
because not all of the bookmarks end in sid= 🙂

monk77 Junior · 30 posts #31

QUOTE (inca @ Nov 26 2008, 12:52 AM) <{POST_SNAPBACK}>

nearly 🙂 you need an ending postion as that will delete everything after sid

need 2 codes first 1 to end at the & symbol and the other for ]
because not all of the bookmarks end in sid= :)

Can you give me an example code?

something else Fellow · 2,296 posts #32

i havent tested this as my url bb code is totaly different because i use an external links page.

if(substr_count($text,"[url=")>0){
$text = preg_replace("/&sid=(.*?)&/is","&",$text);
$text = preg_replace("/&sid=(.*?)\]/is","]",$text);
}
if((substr_count($text,"http://yoursite.com")>0)&&(substr_count($text,"@")<1)&&(substr_count($text,"http://")<2)){
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1&sid=$sid\">$2</a>",$text);
}else{
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);
}

it might need a little more work for security but most of it is here 🙂

something else Fellow · 2,296 posts #33

you may have to create a second bb code function in core.php to work in input boxes so mods cant get session id 😛

monk77 Junior · 30 posts #34

Thanks Inca.

I will try it, but if the method isn't safe, then I won't use it any longer after my test. I for myself don't know so much of PHP and SQL, that I could make this code safe. 🙄

something else Fellow · 2,296 posts #35
function deletesid($text){
$text = preg_replace("/&sid=(.*?)&/is","&",$text);
$text = preg_replace("/&sid=(.*?)\]/is","]",$text);
return $text;
}

usage:

$text = deletesid($text); echo "<input value="$text" name="post"/>";

the other codes you might need to add is to protect against other https:// or maybe ftp or mail and any other links you can think of 🙂 sorry my brains not functioning 100% today

monk77 Junior · 30 posts #36

QUOTE (inca @ Nov 26 2008, 12:41 PM) <{POST_SNAPBACK}>

function deletesid($text){
$text = preg_replace("/&sid=(.*?)&/is","&",$text);
$text = preg_replace("/&sid=(.*?)\]/is","]",$text);
return $text;
}

usage:

$text = deletesid($text); echo "<input value="$text" name="post"/>";

the other codes you might need to add is to protect against other https:// or maybe ftp or mail and any other links you can think of 🙂 sorry my brains not functioning 100% today

Hi Inca,

in other words:

I must add these two codes zu my bbcodes:

code1:

if(substr_count($text,"[url=")>0){
$text = preg_replace("/&sid=(.*?)&/is","&",$text);
$text = preg_replace("/&sid=(.*?)\]/is","]",$text);
}
if((substr_count($text,"http://yoursite.com")>0)&&(substr_count($text,"@")<1)&&(substr_count($text,"http://")<2)){
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1&sid=$sid\">$2</a>",$text);
}else{
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);
}

code2:

function deletesid($text){
$text = preg_replace("/&sid=(.*?)&/is","&",$text);
$text = preg_replace("/&sid=(.*?)\]/is","]",$text);
return $text;
}

Last but not least I must add this function before every inputfield? $text = deletesid($text);

something else Fellow · 2,296 posts #37

yeah add the 1 code to your bb codes (probably best at bottom of bb codes 🙂 2nd code add anywhere in core.php as long as its not inside any other function and the 3rd before inputs on the edit posts 🙂 you may need to change the strings name.... $text to the appropriate stings name that is already inside the value of the input boxes 🙂

something else Fellow · 2,296 posts #38

just been looking at my codes and it will fail if someone enters 2 url bb codes in 1 post 🙁 but it has to be there to prevent any external links containg session id 🙂

Guest #39

code for this have on rukiya`s forum and works fine 😉

metulj Super moderator Principal · 1,726 posts #40

QUOTE (dacha987 @ Nov 26 2008, 06:40 PM) <{POST_SNAPBACK}>

code for this have on rukiya`s forum and works fine ;)

i've posted that code... but seems to me, some ppl are blind here...

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close