#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>

#include "../global.h"

#include "shared_util.h"
#include "shared_cs_util.h"
#include "shared_file_util.h"





int
server_locked()
{
	char path[MAX_PATH +1];

	snprintf(path, MAX_PATH +1, "%s%s", TMP_PATH, MAINTENANCE_LOCK);
	return (file_exists(path));   /* shared_file_util.c */
}



void
check_lockout (const char *key, const char *base_path)
{
  if (server_locked())
     cs_critical_error(ERR_SERVER_LOCK_MESSAGE, "");	
}




void 
central_user_check_lockout(const char *key)
{
  char base_path[MAX_PATH + 1];
  
  snprintf(base_path, MAX_PATH + 1, "../%s/", USERS_DIR);
  check_lockout(key, base_path);
}  
