Skip to content

Commit

Permalink
admin in mogelijkheden in management.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mussaf committed May 6, 2022
1 parent 5e41f0a commit 400dd09
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 16 deletions.
3 changes: 2 additions & 1 deletion properties.php
Expand Up @@ -302,10 +302,11 @@
<i class="fas fa-users xerte-icon"></i><?PHP echo PROPERTIES_TAB_GROUP_SHARED; ?>
</p>
</div>
-->
<?php
}
?>
-->

<div class="tab_spacer">
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion website_code/php/properties/gift_template.php
Expand Up @@ -40,7 +40,7 @@
* show a different view if you are the file creator
*/

if(is_user_creator_or_coauthor($_POST['template_id'])){
if(is_user_creator_or_coauthor($_POST['template_id']) || is_user_admin()){

echo "<div>";
echo "<p class=\"header\"><span>" . PROPERTIES_TAB_GIVE . "</span></p>";
Expand Down
1 change: 1 addition & 0 deletions website_code/php/properties/name_select_gift_template.php
Expand Up @@ -28,6 +28,7 @@

require_once("../../../config.php");
include "../template_status.php";
include "../user_library.php";

_load_language_file("/website_code/php/properties/name_select_gift_template.inc");

Expand Down
3 changes: 2 additions & 1 deletion website_code/php/properties/name_select_template.php
Expand Up @@ -29,6 +29,7 @@

require_once("../../../config.php");
include "../template_status.php";
include "../user_library.php";

_load_language_file("/website_code/php/properties/name_select_template.inc");
$prefix = $xerte_toolkits_site->database_table_prefix;
Expand All @@ -39,7 +40,7 @@
die("Session is invalid or expired");
}

if(is_numeric($_POST['template_id'])){
if(is_numeric($_POST['template_id'])||is_user_admin()){
if(is_user_creator_or_coauthor($_POST['template_id'])||is_user_admin()){
$search = $_POST['search_string'];

Expand Down
2 changes: 1 addition & 1 deletion website_code/php/properties/properties_library.php
Expand Up @@ -87,7 +87,7 @@ function properties_display($xerte_toolkits_site,$tutorial_id,$change,$msgtype){

$_POST['template_id'] = (int) $_POST['template_id'];

if(is_user_creator_or_coauthor($_POST['template_id'])){
if(is_user_creator_or_coauthor($_POST['template_id']) || is_user_admin()){

$query_for_template_name = "select template_name from {$prefix}templatedetails where template_id= ?";
$params = array($_POST['template_id']);
Expand Down
1 change: 1 addition & 0 deletions website_code/php/properties/rename_template.php
Expand Up @@ -33,6 +33,7 @@
include "../screen_size_library.php";
include "../url_library.php";
include "properties_library.php";
include "../user_library.php";

if (!isset($_SESSION['toolkits_logon_username']))
{
Expand Down
3 changes: 2 additions & 1 deletion website_code/php/properties/set_sharing_rights_template.php
Expand Up @@ -29,9 +29,10 @@

require_once("../../../config.php");
include "../template_status.php";
include "../user_library.php";

$prefix = $xerte_toolkits_site->database_table_prefix;
if(is_numeric($_POST['id'])&&is_numeric($_POST['template_id'])){
if(is_numeric($_POST['id'])&&is_numeric($_POST['template_id'])||is_user_admin()){

if(is_user_creator_or_coauthor($_POST['template_id'])||is_user_admin()) {
$new_role = $_POST['role'];
Expand Down
3 changes: 2 additions & 1 deletion website_code/php/properties/share_this_template.php
Expand Up @@ -28,11 +28,12 @@

require_once("../../../config.php");
require_once("../template_status.php");
include "../user_library.php";
_load_language_file("/website_code/php/properties/share_this_template.inc");


$prefix = $xerte_toolkits_site->database_table_prefix;
if(is_numeric($_POST['id'])&&is_numeric($_POST['template_id'])){
if(is_numeric($_POST['id'])&&is_numeric($_POST['template_id'])||is_user_admin()){

if(is_user_creator_or_coauthor($_POST['template_id'])||is_user_admin()) {
$id = $_POST['id'];
Expand Down
12 changes: 6 additions & 6 deletions website_code/php/properties/sharing_status_template.php
Expand Up @@ -49,7 +49,7 @@
* show a different view if you are the file creator
*/

if(is_user_creator_or_coauthor((int) $template_id)){
if(is_user_creator_or_coauthor((int) $template_id) || is_user_admin()){

echo "<div>";
echo "<p class=\"header\"><span>" . PROPERTIES_TAB_SHARED . "</span></p>";
Expand Down Expand Up @@ -77,7 +77,7 @@

$sql = "SELECT template_id, user_id, firstname, surname, username, role FROM " .
" {$xerte_toolkits_site->database_table_prefix}templaterights, {$xerte_toolkits_site->database_table_prefix}logindetails WHERE " .
" {$xerte_toolkits_site->database_table_prefix}logindetails.login_id = {$xerte_toolkits_site->database_table_prefix}templaterights.user_id and template_id= ? AND user_id != ?";
" {$xerte_toolkits_site->database_table_prefix}logindetails.login_id = {$xerte_toolkits_site->database_table_prefix}templaterights.user_id and template_id= ? AND user_id != ? ";

$query_sharing_rows = db_query($sql, array($template_id, $_SESSION['toolkits_logon_id']));

Expand All @@ -95,7 +95,7 @@
echo "<p class=\"share_intro_p\"><span>" . SHARING_CURRENT . "</span></p>";


if(is_user_creator_or_coauthor($template_id)){
if(is_user_creator_or_coauthor($template_id)|| is_user_admin()){
foreach($query_sharing_rows_group as $row) {
echo "<p class=\"share_files_paragraph\"><span>" . $row['group_name'] . " - (" . $row['role'] . ")</span></p>";

Expand All @@ -120,9 +120,9 @@

echo "<p class=\"share_files_paragraph\"><span>" . $row['firstname'] . " " . $row['surname'] . " (" . $row['username'] .") - (" . $row['role'] . ")</span></p>";

if($row['role']!="creator") {
//or is user admin hieronder
if (is_user_creator_or_coauthor($template_id)) {
if($row['role']!="creator"|| is_user_admin()) {

if (is_user_creator_or_coauthor($template_id)|| is_user_admin()) {

echo '<p class=\"share_files_paragraph\">' .
'<input type="radio" name="role' . $row['user_id'] . '" value="co-author" ' . ($row['role'] == 'co-author' ? "checked" : "") . ' onclick="javascript:set_sharing_rights_template(\'co-author\', \'' . $template_id . '\',\'' . $row['user_id'] . '\')">' .
Expand Down
8 changes: 4 additions & 4 deletions website_code/scripts/properties_tab.js
Expand Up @@ -199,7 +199,7 @@ var after_sharing_deleted = false;


function delete_sharing_template(template_id,id,who_deleted_flag, group=false){

debugger
var answer = confirm(SHARING_CONFIRM);
if(answer){
if(who_deleted_flag){
Expand All @@ -213,7 +213,7 @@ function delete_sharing_template(template_id,id,who_deleted_flag, group=false){
url: "website_code/php/properties/remove_sharing_template.php",
data: {
template_id: template_id,
user_id: user_id,
id: id,
user_deleting_self: who_deleted_flag
}
})
Expand Down Expand Up @@ -1056,7 +1056,7 @@ function gift_this_template(tutorial_id, user_id, action){
*/

function name_select_gift_template(){

debugger;
if(setup_ajax()!=false){

search_string = document.getElementById('share_form').childNodes[0].value;
Expand Down Expand Up @@ -1093,7 +1093,7 @@ function name_select_gift_template(){
*/

function name_select_template(){

debugger
if(setup_ajax()!=false){

search_string = document.getElementById('share_form').childNodes[0].value;
Expand Down

0 comments on commit 400dd09

Please sign in to comment.