Rollen/Rechte
This commit is contained in:
parent
0b55c7d5cb
commit
797310c5ff
@ -106,20 +106,26 @@ if ($function == 'deluser') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
if ($function == 'delete') {
|
if ($function == 'delRole') {
|
||||||
$tabelle = $_POST['tabelle'];
|
if (isset($_POST['rid'])) {
|
||||||
$spalte = $_POST['spalte'];
|
$rid = $_POST['rid'];
|
||||||
$id = $_POST['id'];
|
}
|
||||||
$stmt = $db->query("DELETE FROM $tabelle WHERE $spalte = $id");
|
|
||||||
if ($stmt) {
|
$stmt1 = $db->query("DELETE FROM jumi_admin_rollen_rechte_zuord WHERE rid= $rid");
|
||||||
echo "success: DELETE FROM $tabelle WHERE $spalte = $id";
|
$stmt2 = $db->query("DELETE FROM jumi_admin_rollen_user_zuord WHERE rid= $rid");
|
||||||
|
$stmt3 = $db->query("DELETE FROM jumi_admin_rolle WHERE rid= $rid");
|
||||||
|
if ($stmt1 AND $stmt2 AND $stmt3) {
|
||||||
|
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Die Rolle wurde gelöscht!</div>|***|success';
|
||||||
|
exit;
|
||||||
} else {
|
} else {
|
||||||
echo "error: DELETE FROM $tabelle WHERE $spalte = $id";
|
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-thumbs-down"></i> Die Rolle wurde nicht gelöscht: DELETE Fehler Datenbank.</div>|***|error';
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
if ($function == 'deleteQuestion') {
|
if ($function == 'deleteQuestion') {
|
||||||
|
|
||||||
$id2 = $_POST['id2'];
|
$id2 = $_POST['id2'];
|
||||||
|
@ -90,7 +90,7 @@ function delzuordnung(val) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('#msg').show().delay(20000).fadeOut(500);
|
$('#msg').show().delay(10000).fadeOut(500);
|
||||||
$('#msg').html(a[0]);
|
$('#msg').html(a[0]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -165,7 +165,7 @@ function deluser(val) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('#msg').show().delay(20000).fadeOut(500);
|
$('#msg').show().delay(10000).fadeOut(500);
|
||||||
$('#msg').html(a[0]);
|
$('#msg').html(a[0]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -176,26 +176,28 @@ function deluser(val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
function onClickDelete(id) {
|
function delRole(rid) {
|
||||||
|
r = confirm('Rolle löschen? Benutzer sind dann unzugeordnet!');
|
||||||
document.getElementById("antwort").value = "";
|
|
||||||
r = confirm('Antwort löschen?');
|
|
||||||
if (r) {
|
if (r) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '../controller/admin_erfassen.php',
|
url: '../controller/admin_rollen.php',
|
||||||
data: {
|
data: {
|
||||||
'function': 'delete',
|
'function': 'delRole',
|
||||||
'tabelle': 'jumi_umfragen_antworten',
|
'rid': rid
|
||||||
'spalte': 'uaid',
|
|
||||||
'id': id
|
|
||||||
},
|
},
|
||||||
success: function(result) { //we got the response
|
success: function(result) { //we got the response
|
||||||
$(document).ajaxStop(function(){
|
if(result!=''){
|
||||||
window.location = "?action=fragen&erfassen=1";
|
var a = result.split('|***|');
|
||||||
});
|
if(a[1]=="success"){
|
||||||
|
$(document).ajaxStop(function(){
|
||||||
|
window.location = "?";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$('#msg').show().delay(10000).fadeOut(500);
|
||||||
|
$('#msg').html(a[0]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function(xhr, status, exception) {
|
error: function(xhr, status, exception) {
|
||||||
console.log(xhr);
|
console.log(xhr);
|
||||||
@ -203,27 +205,3 @@ function onClickDelete(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickDeleteQuestion(id2) {
|
|
||||||
document.getElementById("frage").value = "";
|
|
||||||
document.getElementById("antwort").value = "";
|
|
||||||
r = confirm('Gesamte Frage löschen?');
|
|
||||||
if (r) {
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url: '../controller/admin_erfassen.php',
|
|
||||||
data: {
|
|
||||||
'function': 'deleteQuestion',
|
|
||||||
'id2': id2
|
|
||||||
},
|
|
||||||
success: function(result) {
|
|
||||||
// document.getElementById("del").innerHTML = "<strong>entfernt</strong>";
|
|
||||||
//Text einblenden geht nicht, da ein Refresh gemacht wird. Dann sieht man den Text nicht
|
|
||||||
$(document).ajaxStop(function(){
|
|
||||||
window.location = "?action=fragen&erfassen=1";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
@ -102,6 +102,7 @@ $(document).ready(function(){
|
|||||||
<div class="col-4 col-md-2">
|
<div class="col-4 col-md-2">
|
||||||
<a class="btn btn-success btn-rounded btn-icon btn-sm" data-bs-toggle="modal" value="{$table_data[table_data].rid}|rollenzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-eye" style="width:18px;"></i></a>
|
<a class="btn btn-success btn-rounded btn-icon btn-sm" data-bs-toggle="modal" value="{$table_data[table_data].rid}|rollenzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-eye" style="width:18px;"></i></a>
|
||||||
<a class="btn btn-success btn-rounded btn-icon btn-sm" data-bs-toggle="modal" value="{$table_data[table_data].rid}|userzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-user" style="width:18px;"></i></a>
|
<a class="btn btn-success btn-rounded btn-icon btn-sm" data-bs-toggle="modal" value="{$table_data[table_data].rid}|userzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-user" style="width:18px;"></i></a>
|
||||||
|
<a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="delRole({$table_data[table_data].rid})"><i class="fa fa-trash" style="width:18px;"></i></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Smarty version 3.1.39, created on 2023-03-28 12:49:38
|
/* Smarty version 3.1.39, created on 2023-03-28 13:28:55
|
||||||
from 'F:\git\survey\templates\modern\dashboard\rollen.html' */
|
from 'F:\git\survey\templates\modern\dashboard\rollen.html' */
|
||||||
|
|
||||||
/* @var Smarty_Internal_Template $_smarty_tpl */
|
/* @var Smarty_Internal_Template $_smarty_tpl */
|
||||||
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
|
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
|
||||||
'version' => '3.1.39',
|
'version' => '3.1.39',
|
||||||
'unifunc' => 'content_6422c6426320c9_55428832',
|
'unifunc' => 'content_6422cf77bc2191_44742864',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'5e39749cb1a64f7b81c95621b910340c1aee6ae0' =>
|
'5e39749cb1a64f7b81c95621b910340c1aee6ae0' =>
|
||||||
array (
|
array (
|
||||||
0 => 'F:\\git\\survey\\templates\\modern\\dashboard\\rollen.html',
|
0 => 'F:\\git\\survey\\templates\\modern\\dashboard\\rollen.html',
|
||||||
1 => 1680000576,
|
1 => 1680002934,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -20,7 +20,7 @@ if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
|
|||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
),false)) {
|
),false)) {
|
||||||
function content_6422c6426320c9_55428832 (Smarty_Internal_Template $_smarty_tpl) {
|
function content_6422cf77bc2191_44742864 (Smarty_Internal_Template $_smarty_tpl) {
|
||||||
if ($_smarty_tpl->tpl_vars['action']->value == '') {?>
|
if ($_smarty_tpl->tpl_vars['action']->value == '') {?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
@ -154,6 +154,8 @@ for ($__section_table_data_0_iteration = 1, $_smarty_tpl->tpl_vars['__smarty_sec
|
|||||||
|rollenzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-eye" style="width:18px;"></i></a>
|
|rollenzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-eye" style="width:18px;"></i></a>
|
||||||
<a class="btn btn-success btn-rounded btn-icon btn-sm" data-bs-toggle="modal" value="<?php echo $_smarty_tpl->tpl_vars['table_data']->value[(isset($_smarty_tpl->tpl_vars['__smarty_section_table_data']->value['index']) ? $_smarty_tpl->tpl_vars['__smarty_section_table_data']->value['index'] : null)]['rid'];?>
|
<a class="btn btn-success btn-rounded btn-icon btn-sm" data-bs-toggle="modal" value="<?php echo $_smarty_tpl->tpl_vars['table_data']->value[(isset($_smarty_tpl->tpl_vars['__smarty_section_table_data']->value['index']) ? $_smarty_tpl->tpl_vars['__smarty_section_table_data']->value['index'] : null)]['rid'];?>
|
||||||
|userzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-user" style="width:18px;"></i></a>
|
|userzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-user" style="width:18px;"></i></a>
|
||||||
|
<a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="delRole(<?php echo $_smarty_tpl->tpl_vars['table_data']->value[(isset($_smarty_tpl->tpl_vars['__smarty_section_table_data']->value['index']) ? $_smarty_tpl->tpl_vars['__smarty_section_table_data']->value['index'] : null)]['rid'];?>
|
||||||
|
)"><i class="fa fa-trash" style="width:18px;"></i></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
3
todo.txt
3
todo.txt
@ -5,8 +5,9 @@ todo
|
|||||||
-- Menü in Datenbank übernommen
|
-- Menü in Datenbank übernommen
|
||||||
-- unlock im Login berücksichtigen
|
-- unlock im Login berücksichtigen
|
||||||
-- Rechte einbauen
|
-- Rechte einbauen
|
||||||
|
-- Rechteverwaltung
|
||||||
|
|
||||||
Rechteverwaltung
|
Rolle löschen Erfolgstext zu schnell
|
||||||
Kacheln Startseite
|
Kacheln Startseite
|
||||||
Passwortvorschau
|
Passwortvorschau
|
||||||
Fragen erfassen Probleme
|
Fragen erfassen Probleme
|
||||||
|
Loading…
x
Reference in New Issue
Block a user