From d86dcf1dfeea3ae424eff033112bc17f8cd8e418 Mon Sep 17 00:00:00 2001 From: aschwarz Date: Tue, 19 Sep 2023 13:21:36 +0200 Subject: [PATCH] Rollenkonzept verbessert --- config.inc.php | 8 ++++++++ dashboard/create_member.php | 3 ++- dashboard/edit_member.php | 1 + dashboard/edit_noten.php | 1 + dashboard/notenbuch.php | 1 + dashboard/notenbuchzuordnung.php | 2 +- dashboard/notenupload.php | 2 +- dashboard/notenuserzuordnung.php | 2 +- dashboard/survey_edit.php | 1 + templates/modern/dashboard/create_member.html | 4 ++++ templates/modern/dashboard/edit_member.html | 2 ++ templates/modern/dashboard/edit_noten.html | 2 ++ templates/modern/dashboard/notenbuch.html | 2 ++ templates/modern/dashboard/notenupload.html | 4 ++++ templates/modern/dashboard/survey_edit.html | 2 ++ 15 files changed, 33 insertions(+), 4 deletions(-) diff --git a/config.inc.php b/config.inc.php index 848998a..6a6f80a 100644 --- a/config.inc.php +++ b/config.inc.php @@ -45,5 +45,13 @@ function rechte($curpage, $uid){ } } +function rolle($uid){ + $db = dbconnect(); + $result_rolle = $db->query("SELECT rid + FROM jumi_admin_rollen_user_zuord + WHERE uid = $uid"); + $row_rolle = $result_rolle->fetch_array(); + return $row_rolle['rid']; +} #--------------------------------------------------------------------------------------------------------------------------------------- ?> \ No newline at end of file diff --git a/dashboard/create_member.php b/dashboard/create_member.php index 63df830..debf9de 100644 --- a/dashboard/create_member.php +++ b/dashboard/create_member.php @@ -52,7 +52,8 @@ if($action == ''){ $smarty->assign('member_anlegen_einw_socialmedia', $row0['einw_socialmedia']); $smarty->assign('member_anlegen_alter16', $row0['alter16']); $smarty->assign('member_anlegen_selfreg_date_form', $row0['selfreg_date_form']); - + $smarty->assign('admin_rolle', rolle($uid)); + $query = "SELECT id, filename, originalname, date_format(datum, '%d.%m.%y - %H:%i') uploaddatum FROM jumi_chor_saenger_uploads WHERE csid='$csid' ORDER BY datum DESC"; $result = $db->query( $query) or die ("Cannot execute query1"); diff --git a/dashboard/edit_member.php b/dashboard/edit_member.php index 131e4b3..3273fbc 100644 --- a/dashboard/edit_member.php +++ b/dashboard/edit_member.php @@ -51,6 +51,7 @@ if($action == ''){ $value[] = $row; } $smarty->assign('table_data', $value); + $smarty->assign('admin_rolle', rolle($uid)); } diff --git a/dashboard/edit_noten.php b/dashboard/edit_noten.php index de63213..5017398 100644 --- a/dashboard/edit_noten.php +++ b/dashboard/edit_noten.php @@ -91,6 +91,7 @@ require_once "../language/german.inc.php"; $value[] = $row; } $smarty->assign('table_data', $value); + $smarty->assign('admin_rolle', rolle($uid)); diff --git a/dashboard/notenbuch.php b/dashboard/notenbuch.php index c9f3660..aedff73 100644 --- a/dashboard/notenbuch.php +++ b/dashboard/notenbuch.php @@ -48,6 +48,7 @@ if ($action == '') { $table_data[] = $row; } $smarty->assign('table_data', $table_data); + $smarty->assign('admin_rolle', rolle($uid)); } diff --git a/dashboard/notenbuchzuordnung.php b/dashboard/notenbuchzuordnung.php index eb6f034..0887d8c 100644 --- a/dashboard/notenbuchzuordnung.php +++ b/dashboard/notenbuchzuordnung.php @@ -6,7 +6,7 @@ include_once '../classes/TestProjektSmarty.class_subdir.php'; require_once("../config.inc.php"); $templatename = substr(basename($_SERVER['PHP_SELF']), 0, -3) . "html"; $smarty = new SmartyAdmin(); -if(!rechte('rollen.php', $uid)){ +if(!rechte('notenbuch.php', $uid)){ echo ""; exit; } diff --git a/dashboard/notenupload.php b/dashboard/notenupload.php index 6c4e334..646a640 100644 --- a/dashboard/notenupload.php +++ b/dashboard/notenupload.php @@ -13,7 +13,7 @@ if(!rechte('__noright__', $uid)){ } $templatename = substr(basename($_SERVER['PHP_SELF']), 0, -3) . "html"; require_once "../language/german.inc.php"; - + $smarty->assign('admin_rolle', rolle($uid)); if(isset($_GET['editjndid']) and $_GET['editjndid'] != ''){ # Aus externer Seite edit_user.php #echo "







-----------------------------------------------hier"; diff --git a/dashboard/notenuserzuordnung.php b/dashboard/notenuserzuordnung.php index 751b2fe..98a9e7b 100644 --- a/dashboard/notenuserzuordnung.php +++ b/dashboard/notenuserzuordnung.php @@ -6,7 +6,7 @@ include_once '../classes/TestProjektSmarty.class_subdir.php'; require_once("../config.inc.php"); $templatename = substr(basename($_SERVER['PHP_SELF']), 0, -3) . "html"; $smarty = new SmartyAdmin(); -if(!rechte('rollen.php', $uid)){ +if(!rechte('notenbuch.php', $uid)){ echo ""; exit; } diff --git a/dashboard/survey_edit.php b/dashboard/survey_edit.php index 64c750d..7476988 100644 --- a/dashboard/survey_edit.php +++ b/dashboard/survey_edit.php @@ -33,6 +33,7 @@ if ($action == '') { $table_data1[] = $row1; } $smarty->assign('table_data1', $table_data1); + $smarty->assign('admin_rolle', rolle($uid)); } diff --git a/templates/modern/dashboard/create_member.html b/templates/modern/dashboard/create_member.html index a1792db..e8dde85 100644 --- a/templates/modern/dashboard/create_member.html +++ b/templates/modern/dashboard/create_member.html @@ -134,7 +134,9 @@ Datei Uploaddatum + {if $admin_rolle == 1} Aktion + {/if} @@ -148,7 +150,9 @@ {/if} {$table_data[table_data].uploaddatum} + {if $admin_rolle == 1} + {/if} {/section} diff --git a/templates/modern/dashboard/edit_member.html b/templates/modern/dashboard/edit_member.html index 73f8fb8..7fee2c2 100644 --- a/templates/modern/dashboard/edit_member.html +++ b/templates/modern/dashboard/edit_member.html @@ -75,8 +75,10 @@ {$table_data[table_data].singstimme} + {if $admin_rolle == 1}   + {/if} {/section} diff --git a/templates/modern/dashboard/edit_noten.html b/templates/modern/dashboard/edit_noten.html index 9d39de7..d9a0d0a 100644 --- a/templates/modern/dashboard/edit_noten.html +++ b/templates/modern/dashboard/edit_noten.html @@ -97,8 +97,10 @@ {$table_data[table_data].streamlizenz_vorh} + {if $admin_rolle == 1}   + {/if} {/section} diff --git a/templates/modern/dashboard/notenbuch.html b/templates/modern/dashboard/notenbuch.html index 0ef3676..3462969 100644 --- a/templates/modern/dashboard/notenbuch.html +++ b/templates/modern/dashboard/notenbuch.html @@ -112,7 +112,9 @@ $(document).ready(function(){ + {if $admin_rolle == 1} + {/if} {/section} diff --git a/templates/modern/dashboard/notenupload.html b/templates/modern/dashboard/notenupload.html index 995891b..2f10245 100644 --- a/templates/modern/dashboard/notenupload.html +++ b/templates/modern/dashboard/notenupload.html @@ -128,7 +128,9 @@ Datei Uploaddatum + {if $admin_rolle == 1} Aktion + {/if} @@ -142,7 +144,9 @@ {/if} {$table_data[table_data].uploaddatum} + {if $admin_rolle == 1} + {/if} {/section} diff --git a/templates/modern/dashboard/survey_edit.html b/templates/modern/dashboard/survey_edit.html index 8cbaa3b..ef4d7ce 100644 --- a/templates/modern/dashboard/survey_edit.html +++ b/templates/modern/dashboard/survey_edit.html @@ -64,7 +64,9 @@
+ {if $admin_rolle == 1} + {/if}
{/section}