// Coded by Michelle at Dirk's indirect request.  Early September 92
// Debugged by Quag.

int check_if_can_login(object player)
{
  string *allowed;
  int hour, i, count;
  object *list;

// during holidays and other extraneous all-login days,
// just put a return 1; after this comment.  be damned sure
// someone removes it when regular days come back
// michelle  92 sept 7

  list = users();
  count = 0;
  for(i=0;i<sizeof(list);i++)
    if(!list[i]->query_wiz())
      count++;

  allowed = explode(read_file("/data/allowed.to.login"),"\n");

  sscanf(query_time("hour"), "%d", hour);
  if(!player->query_wiz() && query_time("weekday") != "Sat" &&
     query_time("weekday") != "Sun" && (hour > 8 && hour < 17) &&
     member_array((string)player->query_real_name(),allowed) < 0 &&
     count > 3)
    return 0;
  else
    return 1;
}