11 |
require_once ($GLOBAL_ADMIN_INC."forms.php"); |
require_once ($GLOBAL_ADMIN_INC."forms.php"); |
12 |
|
|
13 |
|
|
|
|
|
14 |
// HTML header |
// HTML header |
15 |
printf("<HTML>\n"); |
printf("<HTML>\n"); |
16 |
printf("<HEAD>\n"); |
printf("<HEAD>\n"); |
19 |
printf("</HEAD>\n"); |
printf("</HEAD>\n"); |
20 |
|
|
21 |
|
|
22 |
|
// Default access settings |
23 |
|
$sess_time_human = ""; |
24 |
|
$sess_staff_account = ""; |
25 |
|
$sess_staff_id = 0; |
26 |
|
$sess_access_level = 0; |
27 |
|
$sess_access = ""; |
28 |
|
$sess_last_name = ""; |
29 |
|
$sess_first_name = ""; |
30 |
|
|
31 |
|
|
32 |
// Page header |
// Page header |
33 |
require_once ($GLOBAL_ADMIN_HEADER); |
require_once ($GLOBAL_ADMIN_HEADER); |
34 |
|
|
43 |
// Load user session variables |
// Load user session variables |
44 |
$sess_time_human = $sessionClass->time_human; |
$sess_time_human = $sessionClass->time_human; |
45 |
$sess_staff_account = $sessionClass->staff_account; |
$sess_staff_account = $sessionClass->staff_account; |
46 |
|
$sess_staff_id = $accessClass->staff_id; |
47 |
$sess_access_level = $accessClass->access_level; |
$sess_access_level = $accessClass->access_level; |
48 |
$sess_access = $accessClass->access; |
$sess_access = $accessClass->access; |
49 |
$sess_last_name = $accessClass->last_name; |
$sess_last_name = $accessClass->last_name; |
52 |
} |
} |
53 |
|
|
54 |
|
|
55 |
// If the cookie is set and access level is appropriate |
/******************************************** |
56 |
|
** Functions requiring author level access ** |
57 |
|
********************************************/ |
58 |
if(isset($libsession) && $sess_access_level >= 20) { |
if(isset($libsession) && $sess_access_level >= 20) { |
59 |
|
|
60 |
// Determine which transaction function to call |
// Determine which transaction function to call |
61 |
switch ($transaction){ |
switch ($transaction){ |
62 |
|
|
63 |
// Bridging Assignments |
// Bridging Assignments |
|
case "assignLibunitStaff": |
|
|
assignLibunitStaff($con, $staff_id_array, $libunit_id); |
|
|
break; |
|
64 |
case "assignResFeature": |
case "assignResFeature": |
65 |
assignResFeature($con, $feature_id_array, $resource_id); |
assignResFeature($feature_id_array, $resource_id); |
66 |
break; |
break; |
67 |
case "assignResLoc": |
case "assignResLoc": |
68 |
assignResLoc($con, $location_id_array, $resource_id); |
assignResLoc($location_id_array, $resource_id); |
69 |
break; |
break; |
70 |
case "assignResMastersubject": |
case "assignResMastersubject": |
71 |
assignResMastersubject($con, $mastersubject_id_array, $resource_id); |
assignResMastersubject($mastersubject_id_array, $resource_id); |
|
break; |
|
|
case "assignServLoc": |
|
|
assignServLoc($con, $location_id_array, $service_id); |
|
|
break; |
|
|
case "assignServServtype": |
|
|
assignServServtype($con, $servicetype_id_array, $service_id); |
|
|
break; |
|
|
case "assignStaffLibunit": |
|
|
assignStaffLibunit($con, $libunit_id_array, $staff_id); |
|
|
break; |
|
|
case "assignStaffSub": |
|
|
assignStaffSub($con, $staff_id, $subject_id_array); |
|
72 |
break; |
break; |
73 |
case "assignSubCoursesub": |
case "assignSubCoursesub": |
74 |
assignSubCoursesub($con, $coursesub_id_array, $subject_id); |
if (authSubject($sess_access_level, $sess_staff_id, $subject_id)) |
75 |
break; |
assignSubCoursesub($coursesub_id_array, $subject_id); |
76 |
|
else require_once ($GLOBAL_NO_ACCESS); |
77 |
|
break; |
78 |
case "assignSubLoc": |
case "assignSubLoc": |
79 |
assignSubLoc($con, $location_id_array, $subject_id); |
if (authSubject($sess_access_level, $sess_staff_id, $subject_id)) |
80 |
|
assignSubLoc($location_id_array, $subject_id); |
81 |
|
else require_once ($GLOBAL_NO_ACCESS); |
82 |
break; |
break; |
83 |
case "assignSubMaster": |
case "assignSubMaster": |
84 |
assignSubMaster($con, $mastersubject_id_array, $subject_id); |
if (authSubject($sess_access_level, $sess_staff_id, $subject_id)) |
85 |
break; |
assignSubMaster($mastersubject_id_array, $subject_id); |
86 |
|
else require_once ($GLOBAL_NO_ACCESS); |
87 |
|
break; |
88 |
case "assignSubStaff": |
case "assignSubStaff": |
89 |
assignSubStaff($con, $staff_id_array, $subject_id); |
if (authSubject($sess_access_level, $sess_staff_id, $subject_id)) |
90 |
|
assignSubStaff($staff_id_array, $subject_id); |
91 |
|
else require_once ($GLOBAL_NO_ACCESS); |
92 |
break; |
break; |
|
} |
|
93 |
|
|
94 |
// Link to return to admin console |
} // end author assigns |
95 |
adminReturn($sess_access_level); |
|
96 |
|
|
97 |
|
|
98 |
|
/********************************************* |
99 |
|
** Functions requiring manager level access ** |
100 |
|
*********************************************/ |
101 |
|
if(isset($libsession) && $sess_access_level >= 100) { |
102 |
|
|
103 |
|
// Determine which transaction function to call |
104 |
|
switch ($transaction){ |
105 |
|
|
106 |
|
// Bridging Assignments |
107 |
|
case "assignLibunitStaff": |
108 |
|
assignLibunitStaff($staff_id_array, $libunit_id); |
109 |
|
break; |
110 |
|
case "assignServLoc": |
111 |
|
assignServLoc($location_id_array, $service_id); |
112 |
|
break; |
113 |
|
case "assignServServtype": |
114 |
|
assignServServtype($servicetype_id_array, $service_id); |
115 |
|
break; |
116 |
|
case "assignStaffLibunit": |
117 |
|
assignStaffLibunit($libunit_id_array, $staff_id); |
118 |
|
break; |
119 |
|
case "assignStaffSub": |
120 |
|
assignStaffSub($staff_id, $subject_id_array); |
121 |
|
break; |
122 |
|
} // end manager assigns |
123 |
|
|
124 |
|
} // end manager functions |
125 |
|
|
126 |
|
// Link to return to admin console |
127 |
|
adminReturn($sess_access_level); |
128 |
|
|
129 |
} // logged in |
} // end logged in at author or higher |
130 |
|
|
131 |
// No access |
// No access |
132 |
else require_once ($GLOBAL_NO_ACCESS); |
else require_once ($GLOBAL_NO_ACCESS); |