mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-01 05:44:41 +03:00
Implement additional CSRF checks
This commit is contained in:
parent
7b5caf0e8d
commit
a4449482e3
@ -22,6 +22,7 @@ require_once(dirname(dirname(__FILE__)).'/libs/pagination.php');
|
|||||||
require_once(dirname(dirname(__FILE__)).'/libs/classes/thread.php');
|
require_once(dirname(dirname(__FILE__)).'/libs/classes/thread.php');
|
||||||
|
|
||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
|
csrfchecktoken();
|
||||||
$page = array('banId' => '');
|
$page = array('banId' => '');
|
||||||
$page['saved'] = false;
|
$page['saved'] = false;
|
||||||
$page['thread'] = '';
|
$page['thread'] = '';
|
||||||
|
@ -21,6 +21,8 @@ require_once(dirname(dirname(__FILE__)).'/libs/operator.php');
|
|||||||
require_once(dirname(dirname(__FILE__)).'/libs/pagination.php');
|
require_once(dirname(dirname(__FILE__)).'/libs/pagination.php');
|
||||||
|
|
||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
|
csrfchecktoken();
|
||||||
|
|
||||||
$page = array();
|
$page = array();
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ require_once(dirname(dirname(__FILE__)).'/libs/operator.php');
|
|||||||
require_once(dirname(dirname(__FILE__)).'/libs/groups.php');
|
require_once(dirname(dirname(__FILE__)).'/libs/groups.php');
|
||||||
|
|
||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
|
csrfchecktoken();
|
||||||
|
|
||||||
$page = array('grid' => '');
|
$page = array('grid' => '');
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
@ -20,6 +20,7 @@ require_once(dirname(dirname(__FILE__)).'/libs/operator.php');
|
|||||||
require_once(dirname(dirname(__FILE__)).'/libs/groups.php');
|
require_once(dirname(dirname(__FILE__)).'/libs/groups.php');
|
||||||
|
|
||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
|
csrfchecktoken();
|
||||||
|
|
||||||
function get_group_members($groupid)
|
function get_group_members($groupid)
|
||||||
{
|
{
|
||||||
|
@ -19,6 +19,7 @@ require_once(dirname(dirname(__FILE__)).'/libs/init.php');
|
|||||||
require_once(dirname(dirname(__FILE__)).'/libs/operator.php');
|
require_once(dirname(dirname(__FILE__)).'/libs/operator.php');
|
||||||
|
|
||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
|
csrfchecktoken();
|
||||||
|
|
||||||
if (isset($_GET['act']) && $_GET['act'] == 'del') {
|
if (isset($_GET['act']) && $_GET['act'] == 'del') {
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ require_once(dirname(dirname(__FILE__)).'/libs/operator.php');
|
|||||||
require_once(dirname(dirname(__FILE__)).'/libs/operator_settings.php');
|
require_once(dirname(dirname(__FILE__)).'/libs/operator_settings.php');
|
||||||
|
|
||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
|
csrfchecktoken();
|
||||||
|
|
||||||
function update_operator_groups($operatorid, $newvalue)
|
function update_operator_groups($operatorid, $newvalue)
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@ function tpl_content() { global $page, $mibewroot, $errors;
|
|||||||
<?php echo getlocal("page_ban.intro") ?>
|
<?php echo getlocal("page_ban.intro") ?>
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<?php
|
<?php
|
||||||
require_once(dirname(__FILE__).'/inc_errors.php');
|
require_once(dirname(__FILE__).'/inc_errors.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -42,6 +42,7 @@ require_once(dirname(__FILE__).'/inc_errors.php');
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<form name="banForm" method="post" action="<?php echo $mibewroot ?>/operator/ban.php">
|
<form name="banForm" method="post" action="<?php echo $mibewroot ?>/operator/ban.php">
|
||||||
|
<?php print_csrf_token_input() ?>
|
||||||
<input type="hidden" name="banId" value="<?php echo $page['banId'] ?>"/>
|
<input type="hidden" name="banId" value="<?php echo $page['banId'] ?>"/>
|
||||||
<?php if( $page['threadid'] ) { ?>
|
<?php if( $page['threadid'] ) { ?>
|
||||||
<input type="hidden" name="threadid" value="<?php echo $page['threadid'] ?>"/>
|
<input type="hidden" name="threadid" value="<?php echo $page['threadid'] ?>"/>
|
||||||
|
@ -82,7 +82,7 @@ if( $page['pagination.items'] ) {
|
|||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="removelink" id="i<?php echo $b['banid'] ?>" href="<?php echo $mibewroot ?>/operator/blocked.php?act=del&id=<?php echo $b['banid'] ?>">
|
<a class="removelink" id="i<?php echo $b['banid'] ?>" href="<?php echo $mibewroot ?>/operator/blocked.php?act=del&id=<?php echo $b['banid'] ?><?php print_csrf_token_in_url() ?>">
|
||||||
<?php echo getlocal("remove.item") ?></a>,
|
<?php echo getlocal("remove.item") ?></a>,
|
||||||
<a href="<?php echo $mibewroot ?>/operator/ban.php?id=<?php echo $b['banid'] ?>">
|
<a href="<?php echo $mibewroot ?>/operator/ban.php?id=<?php echo $b['banid'] ?>">
|
||||||
<?php echo getlocal("edit.item") ?></a>
|
<?php echo getlocal("edit.item") ?></a>
|
||||||
|
@ -63,6 +63,7 @@ require_once(dirname(__FILE__).'/inc_errors.php');
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<form name="groupForm" method="post" action="<?php echo $mibewroot ?>/operator/group.php">
|
<form name="groupForm" method="post" action="<?php echo $mibewroot ?>/operator/group.php">
|
||||||
|
<?php print_csrf_token_input() ?>
|
||||||
<input type="hidden" name="gid" value="<?php echo $page['grid'] ?>"/>
|
<input type="hidden" name="gid" value="<?php echo $page['grid'] ?>"/>
|
||||||
<div>
|
<div>
|
||||||
<?php print_tabbar(); ?>
|
<?php print_tabbar(); ?>
|
||||||
|
@ -35,6 +35,7 @@ require_once(dirname(__FILE__).'/inc_errors.php');
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<form name="membersForm" method="post" action="<?php echo $mibewroot ?>/operator/groupmembers.php">
|
<form name="membersForm" method="post" action="<?php echo $mibewroot ?>/operator/groupmembers.php">
|
||||||
|
<?php print_csrf_token_input() ?>
|
||||||
<input type="hidden" name="gid" value="<?php echo $page['groupid'] ?>"/>
|
<input type="hidden" name="gid" value="<?php echo $page['groupid'] ?>"/>
|
||||||
<div>
|
<div>
|
||||||
<?php print_tabbar(); ?>
|
<?php print_tabbar(); ?>
|
||||||
|
@ -122,7 +122,7 @@ if(count($page['groups']) > 0) {
|
|||||||
</td>
|
</td>
|
||||||
<?php if($page['canmodify']) { ?>
|
<?php if($page['canmodify']) { ?>
|
||||||
<td>
|
<td>
|
||||||
<a href="<?php echo $mibewroot ?>/operator/groups.php?act=del&gid=<?php echo $grp['groupid'] ?>" id="i<?php echo $grp['groupid'] ?>" class="removelink">
|
<a href="<?php echo $mibewroot ?>/operator/groups.php?act=del&gid=<?php echo $grp['groupid'] ?><?php print_csrf_token_in_url() ?>" id="i<?php echo $grp['groupid'] ?>" class="removelink">
|
||||||
<?php echo getlocal("remove.item") ?>
|
<?php echo getlocal("remove.item") ?>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -35,6 +35,7 @@ require_once(dirname(__FILE__).'/inc_errors.php');
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<form name="opgroupsForm" method="post" action="<?php echo $mibewroot ?>/operator/opgroups.php">
|
<form name="opgroupsForm" method="post" action="<?php echo $mibewroot ?>/operator/opgroups.php">
|
||||||
|
<?php print_csrf_token_input() ?>
|
||||||
<input type="hidden" name="op" value="<?php echo $page['opid'] ?>"/>
|
<input type="hidden" name="op" value="<?php echo $page['opid'] ?>"/>
|
||||||
<div>
|
<div>
|
||||||
<?php print_tabbar(); ?>
|
<?php print_tabbar(); ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user