#include <stdio.h>
#include <stdlib.h>  /* for exit */
#include <time.h>
#include <dirent.h>
#include <string.h>

#include <sys/stat.h>
#include <unistd.h>

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

#include "manhat-lib/shared_util.h"
#include "manhat-lib/shared_super_util.h"
#include "manhat-lib/shared_super_menu.h"
#include "manhat-lib/shared_authenticate.h"
#include "manhat-lib/shared_cs_util.h"

void
unlock_server( const char *key)
{
       char tmp_dir[MAX_PATH +1];

       snprintf(tmp_dir, MAX_PATH +1, "%s%s",  TMP_PATH, MAINTENANCE_LOCK);
       unlink(tmp_dir);	
}
	 
	 
int
main ()
{

	char key[MAX_KEY + 1];
	SESSION user;
        
	cs_cgi_init();
	 read_param( key);
         validate_super_key(key, &user);
	 set_admin_page(&user, key, 0, "super_unlock");  /* shared_super_menu.c */
	 unlock_server( key);
	 cs_cgi_display("super_unlock", 1);
	 cs_cgi_destroy();
	 return 0;
}

