#include <stdio.h>

#include "ClearSilver.h"

#include "global.h"
#include "custom.h"		/* for date FORMAT strings */

#include "manhat-lib/shared_util.h"
#include "manhat-lib/shared_cs_util.h"



	
void
read_parameters (char *course, char *key)
{
   cs_get_required_parameter("crs", course, MAX_PATH);
   cs_get_required_parameter("id", key, MAX_KEY);
}



int
main ()
{
   char course[MAX_PATH +1];
   char key[MAX_KEY +1];

  SESSION user;
  CONFIG_STRUCT conf;

  cs_cgi_init();    /* shared_cs_util.c */

  read_parameters (course, key);
  read_configuration_file (course, &conf);	
  validate_key (key, &user, &conf);	

  cs_set_course_info(&conf);       			
  cs_set_current_time();    				
  cs_set_back_url(course, key, "grades_fac_menu");  	

  if(user.group != FACULTY)
      cs_critical_error(ERR_REQUEST_DENIED, "");   /** shared_cs_util.h */
  else
  {
    cs_cgi_display ("grades_upload_form", 1);  /** shared_cs_util.h */
    cs_cgi_destroy();                   /** shared_cs_util.h */

   } 

  return 0;			/* exit successfully */

}







	







