mirror of
https://github.com/Ekokumppanit/ystavakylaecard.git
synced 2026-01-26 03:04:00 +00:00
Admins can now delete other admins, but not themselves.
This commit is contained in:
@@ -151,7 +151,7 @@ class Yllapito extends CI_Controller
|
||||
redirect('yllapito/users/'.$redir);
|
||||
break;
|
||||
case 'delete':
|
||||
$this->user->delete($user_id);
|
||||
$this->users->delete($user_id);
|
||||
redirect('yllapito/users');
|
||||
break;
|
||||
case 'save':
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<?php
|
||||
if (empty($userdata)) {
|
||||
$userdata = array();
|
||||
@@ -16,10 +15,10 @@ if (empty($userid)) {
|
||||
<div class="panel">
|
||||
|
||||
<?php
|
||||
if ($user->can_seeusers == "no") {
|
||||
if ($user->can_modusers == "no") {
|
||||
?>
|
||||
<div data-alert class="alert-box error">
|
||||
Sinulla ei ole oikeutta käyttäjien listaamiseen.
|
||||
Sinulla ei ole oikeutta käyttäjien muokkaamiseen.
|
||||
</div>
|
||||
<?php echo lnk("yllapito/users", "Takaisin"); ?>
|
||||
<?php
|
||||
@@ -139,7 +138,28 @@ if ($user->can_seeusers == "no") {
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div clas="large-12 small-12 columns">
|
||||
<div class="panel">
|
||||
<h3>Poista käyttäjä</h3>
|
||||
<div class="row">
|
||||
<div class="large-12 small-12 columns">
|
||||
<?php
|
||||
if ($user->id == $userid) { ?>
|
||||
<strong>Et voi poistaa itseäsi, hassu.</strong>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<a class="deleteuser button medium alert large-12 small-12"
|
||||
href="<?php echo $post_url."/delete/".$userid; ?>">Poista käyttäjä</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -38,6 +38,10 @@ jQuery(document).ready(function($) {
|
||||
}
|
||||
});
|
||||
|
||||
$('.deleteuser').on('click', function () {
|
||||
return confirm('Oletko varma?');
|
||||
});
|
||||
|
||||
// Provide zebra striping to our table
|
||||
$('table tbody tr:odd').addClass("zebra");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user