--- branches/paul/admin/insert.phtml 2004/03/07 19:15:27 66 +++ branches/paul/admin/insert.phtml 2004/03/18 19:24:54 67 @@ -11,7 +11,6 @@ require_once ($GLOBAL_ADMIN_INC."forms.php"); - // HTML header printf("\n"); printf("\n"); @@ -20,6 +19,16 @@ printf("\n"); +// Default access settings +$sess_time_human = ""; +$sess_staff_account = ""; +$sess_staff_id = 0; +$sess_access_level = 0; +$sess_access = ""; +$sess_last_name = ""; +$sess_first_name = ""; + + // Page header require_once ($GLOBAL_ADMIN_HEADER); @@ -43,60 +52,81 @@ } -// If the cookie is set and access level is appropriate +/******************************************** +** Functions requiring author level access ** +********************************************/ if(isset($libsession) && $sess_access_level >= 20) { // Determine which transaction function to call switch ($transaction){ // Insert - case "insertCoursesub": - insertCoursesub($con, $campus_id, $cip_code, $coursesub, $coursesub_descr); - break; - case "insertFaculty": - insertFaculty($con, $faculty_email, $faculty_firstname, $faculty_lastname, $faculty_account); - break; - case "insertFeature": - insertFeature($con, $feature, $image_alt, $image_path); - break; - case "insertInfotype": - insertInfotype($con, $infotype, $masterinfotype_id, $mastersubject_id); - break; - case "insertLibunit": - insertLibunit($con, $head_staff_id, $libunit, $libunit_abbrev); - break; - case "insertLocation": - insertLocation($con, $address1, $address2, $address3, $address4, $campus, - $hoursURL, $location, $location_descr, $mainURL, $mapURL, $referenceURL, $telephone); - break; case "insertResource": - insertResource($con, $annotation, $author, $call_no, $cat_num, $coverage_detail, $edition, - $infotype_id, $mastersubject_id, $other_title, $pub_date, $publisher, - $sess_staff_account, $sources_indexed, $title, $url); - break; - case "insertService": - insertService($con, $address1, $address2, $address3, $address4, $email, $fax, - $nonaff, $service, $serviceDescr, $serviceURL, $telephone); - break; - case "insertSingleField": - insertSingleField($con, $display, $field, $newValue, $table); - break; - case "insertStaff": - insertStaff($con, $access_id, $first_name, $last_name, $sess_access_level, - $staff_account, $staff_email, $stafftitle_id); - break; - case "insertStyle": - insertStyle($con, $css_file, $footer_file, $header_file, $style_title); + insertResource($annotation, $author, $call_no, $cat_num, $coverage_detail, $edition, + $guide_url, $infotype_id, $mastersubject_id, $other_title, $pub_date, $publisher, + $resource_message, $resource_status, $sess_staff_account, $sources_indexed, + $title, $url, $vendor_id); break; case "insertSubject": - insertSubject($con, $sess_staff_account, $sess_staff_id, $subject, $subject_descr, $sublocation_id); - break; - } + insertSubject($sess_staff_account, $sess_staff_id, $subject, $subject_descr, $sublocation_id); + break; + } // end author inserts + - // Link to return to admin console - adminReturn($sess_access_level); + /********************************************* + ** Functions requiring manager level access ** + *********************************************/ + + if(isset($libsession) && $sess_access_level >= 100) { + + // Determine which transaction function to call + switch ($transaction){ + + // Insert + case "insertCoursesub": + insertCoursesub($campus_id, $cip_code, $coursesub, $coursesub_descr); + break; + case "insertFaculty": + insertFaculty($faculty_email, $faculty_firstname, $faculty_lastname, $faculty_account); + break; + case "insertFeature": + insertFeature($feature, $image_alt, $image_path); + break; + case "insertInfotype": + insertInfotype($infotype, $masterinfotype_id, $mastersubject_id); + break; + case "insertLibunit": + insertLibunit($head_staff_id, $libunit, $libunit_abbrev); + break; + case "insertLocation": + insertLocation($address1, $address2, $address3, $address4, $campus, + $hoursURL, $location, $location_descr, $mainURL, $mapURL, $referenceURL, $telephone); + break; + case "insertService": + insertService($address1, $address2, $address3, $address4, $email, $fax, + $nonaff, $service, $serviceDescr, $serviceURL, $telephone); + break; + case "insertSingleField": + insertSingleField($display, $field, $newValue, $table); + break; + case "insertStaff": + insertStaff($access_id, $first_name, $last_name, $sess_access_level, + $staff_account, $staff_email, $stafftitle_id); + break; + case "insertStyle": + insertStyle($css_file, $footer_file, $header_file, $style_title); + break; + case "insertVendor": + insertVendor($vendor, $vendor_descr, $vendor_message, $vendor_status); + break; + } // end manager inserts + + } // end manager functions + + // Link to return to admin console + adminReturn($sess_access_level); -} // logged in +} // end logged in at author or higher // No access else require_once ($GLOBAL_NO_ACCESS);