mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-05 12:48:00 +02:00
#158 deleting users - fixed by Oleg Gatseluk
This commit is contained in:
@@ -185,7 +185,7 @@ class UsersAdmin extends Backend
|
||||
// -------------------------------------
|
||||
case "delete":
|
||||
|
||||
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) {
|
||||
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin')) && (int)$_SESSION['user_id'] != (int)Request::get('user_id')) {
|
||||
|
||||
if (Security::check(Request::get('token'))) {
|
||||
|
||||
|
@@ -44,9 +44,12 @@
|
||||
<td>
|
||||
<div class="pull-right">
|
||||
<?php echo Html::anchor(__('Edit', 'users'), 'index.php?id=users&action=edit&user_id='.$user['id'], array('class' => 'btn btn-small')); ?>
|
||||
<?php echo Html::anchor(__('Delete', 'users'),
|
||||
<?php
|
||||
if ((int)$user['id'] != (int)$_SESSION['user_id']) {
|
||||
echo Html::anchor(__('Delete', 'users'),
|
||||
'index.php?id=users&action=delete&user_id='.$user['id'].'&token='.Security::token(),
|
||||
array('class' => 'btn btn-small', 'onclick' => "return confirmDelete('".__('Delete user: :user', 'users', array(':user' => Html::toText($user['login'])))."')"));
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user