[svn r17077] minor - changes in logic - will added Security::check_token()

skala
Isaac Flores 17 years ago
parent da8cfa8952
commit f5f3696d64
  1. 22
      main/forum/forumfunction.inc.php

@ -158,9 +158,16 @@ function show_add_forumcategory_form($inputvalues=array()) {
// The validation or display // The validation or display
if ( $form->validate() ) { if ( $form->validate() ) {
$check = Security::check_token('post');
if ($check) {
$values = $form->exportValues(); $values = $form->exportValues();
store_forumcategory($values); store_forumcategory($values);
}
Security::clear_token();
} else { } else {
$token = Security::get_token();
$form->addElement('hidden','sec_token');
$form->setConstants(array('sec_token' => $token));
$form->display(); $form->display();
} }
} }
@ -328,9 +335,16 @@ function show_add_forum_form($inputvalues=array()) {
$form->setDefaults($defaults); $form->setDefaults($defaults);
// The validation or display // The validation or display
if( $form->validate() ) { if( $form->validate() ) {
$check = Security::check_token('post');
if ($check) {
$values = $form->exportValues(); $values = $form->exportValues();
store_forum($values); store_forum($values);
}
Security::clear_token();
} else { } else {
$token = Security::get_token();
$form->addElement('hidden','sec_token');
$form->setConstants(array('sec_token' => $token));
$form->display(); $form->display();
} }
} }
@ -1839,9 +1853,17 @@ function show_add_post_form($action='', $id='', $form_values='') {
// The validation or display // The validation or display
if( $form->validate() ) { if( $form->validate() ) {
$check = Security::check_token('post');
if ($check) {
$values = $form->exportValues(); $values = $form->exportValues();
Security::clear_token();
return $values; return $values;
}
} else { } else {
$token = Security::get_token();
$form->addElement('hidden','sec_token');
$form->setConstants(array('sec_token' => $token));
$form->display(); $form->display();
echo '<br />'; echo '<br />';
if ($forum_setting['show_thread_iframe_on_reply'] and $action<>'newthread') { if ($forum_setting['show_thread_iframe_on_reply'] and $action<>'newthread') {

Loading…
Cancel
Save