News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Can someone explain what this code is for?

Started by Joker™, January 26, 2011, 12:30:26 AM

Previous topic - Next topic

Joker™

In SMF 2.0 RC4,

Themes\Default\MessageIndex.template.php
// Finish off the form - again.
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
echo '
<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />


Why the <input> values are being echoed that too as hidden?
I just want to know what is the significance of this code?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Aleksi "Lex" Kilpinen

I believe that is for session checking, so it's a security measure in the quick moderating options, not actually completely sure about that - at least not without seeing the complete code around it...
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Joker™

But I think checking is done in if loop and we are just echoing session i.e not checking it (just my opinion).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Arantor

You have to put the session into the form so when the form is submitted (e.g. when using checkboxes) the session identifier will be able to be checked on receipt of the form.
Holder of controversial views, all of which my own.


Joker™

Quote from: Arantor on January 26, 2011, 05:28:17 AM
You have to put the session into the form so when the form is submitted (e.g. when using checkboxes) the session identifier will be able to be checked on receipt of the form.
Hmm, explains to nice extent, thank you :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: