Skip to content

Commit

Permalink
Token fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Jul 16, 2018
1 parent 1ad3638 commit bac9652
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions e107_admin/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
*
*/

if(!empty($_POST) && !isset($_POST['e-token']))
{
$_POST['e-token'] = ''; // make sure e-token hasn't been deliberately removed.
}

if (!defined('e107_INIT'))
{
require_once("../class2.php");
Expand Down Expand Up @@ -149,7 +154,7 @@ public function runObservers($run_header = true)
case 'deluser':
if($_POST['userid'])
{
$id = $_POST['userid'];
$id = (int) $_POST['userid'];
$_POST['etrigger_delete'] = array($id => $id);
$user = e107::getDb()->retrieve('user', 'user_email, user_name', 'user_id='.$id);
$rplc_from = array('[x]', '[y]', '[z]');
Expand Down Expand Up @@ -960,7 +965,7 @@ public function AdminPage()
$response->appendBody($frm->open('adminperms'))
->appendBody($prm->renderPermTable('grouped', $sysuser->getValue('perms')))
->appendBody($prm->renderCheckAllButtons())
->appendBody($prm->renderSubmitButtons())
->appendBody($prm->renderSubmitButtons().$frm->token())
->appendBody($frm->close());

$this->addTitle(str_replace(array('[x]', '[y]'), array($sysuser->getName(), $sysuser->getValue('email')), USRLAN_230));
Expand Down
2 changes: 1 addition & 1 deletion e107_handlers/admin_ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -6682,7 +6682,7 @@ public function getConfirmDelete($ids, $ajax = false)
'table_rows' => '', // rows array (<td> tags)
'table_body' => '', // string body - used only if rows empty
'pre_triggers' => '',
'triggers' => array('hidden' => $this->hidden('etrigger_delete['.$ids.']', $ids), 'delete_confirm' => array(LAN_CONFDELETE, 'confirm', $ids), 'cancel' => array(LAN_CANCEL, 'cancel')),
'triggers' => array('hidden' => $this->hidden('etrigger_delete['.$ids.']', $ids) . $this->token(), 'delete_confirm' => array(LAN_CONFDELETE, 'confirm', $ids), 'cancel' => array(LAN_CANCEL, 'cancel')),
);
if($delcount > 1)
{
Expand Down

0 comments on commit bac9652

Please sign in to comment.