/
access_template.php
65 lines (48 loc) · 1.42 KB
/
access_template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
*
* access change template, allows the site to see access properties for the template
*
* @author Patrick Lockley
* @version 1.0
* @copyright Copyright (c) 2008,2009 University of Nottingham
* @package
*/
require_once(dirname(__FILE__) . "/../../../config.php");
include "../template_status.php";
include "../user_library.php";
include "properties_library.php";
/**
*
* Function template share status
* This function checks the current access setting against a string
* @param string $string - string to check against the database
* @return bool True or False if two params match
* @version 1.0
* @author Patrick Lockley
*/
function template_share_status($string){
global $row_access;
if($row_access['access_to_whom']==$string){
return true;
}else{
if(strcmp(substr($row_access['access_to_whom'],0,5),$string)==0){
return true;
}else{
return false;
}
}
}
$database_connect_id = database_connect("Access template database connect success","Access template database connect failed");
/*
* only creator can set access
*/
if(is_numeric($_POST['template_id'])){
if(has_rights_to_this_template($_POST['template_id'],$_SESSION['toolkits_logon_id'])||is_user_admin()){
access_display($xerte_toolkits_site);
}else{
access_display_fail();
}
}else{
echo "<p>Sorry only the creator can set the access settings</p>";
}