Esempio n. 1
0
int main(string arg)
{
     string status;
     int time;
     status = SHUTDOWN_D->getStatus();

     if(!adminp(previous_object())) return notify_fail("Error [shutdown]: Access denied.\n");

     if(!arg)
     {
          if(status) write("Shutdown: " + status);
          else write("There is no shutdown or reboot currently in progress.\n");
          return 1;
     }

     if(arg == "stop")
     {
          if(!status) return notify_fail("Error: There is no shutdown or reboot currently in progress.\n");
          else SHUTDOWN_D->stop();
          log_file(LOG_SHUTDOWN, capitalize(this_player()->query_name()) + " canceled the sequence (" + time + "m) on " + ctime(time()) + "\n");
          return 1;
     }

     else
     {
          if(arg == "now") time = 0;
          else time = to_int(arg);
          if(time == 0 && arg != "now" && arg != "0") return notify_fail("SYNTAX: shutdown [<stop>||<time>/now]\n");
          log_file(LOG_SHUTDOWN, capitalize(this_player()->query_name()) + " started shutdown sequence (" + time + "m) on " + ctime(time()) + "\n");
          SHUTDOWN_D->start(time, 1);
          return 1;
     }
}
Esempio n. 2
0
int cmd_checkpath(string str) {
   object act_ob, player;
   string *path, tmp;
   string pname, str2 ;
   int i, add_path;

   act_ob = previous_object();
   seteuid(ROOT_UID);

   if(!str) {
	notify_fail ("You need to supply a name.\n") ;
	return 0 ;
   }

   if(!adminp(geteuid(act_ob))) {
	notify_fail ("Only admins can check other player's paths.\n") ;
	return 0 ;
   }

   player = find_player(str) ;
   if (!player) {
	notify_fail ("checkpath: "+str+" is not on this mud\n") ;
	return 0 ;
   }
   write (player->query("cap_name")+"'s path is: "+player->query("PATH")+"\n") ;

   return 1;
}
Esempio n. 3
0
int cmd_hide(string str) {

   int i;
   object connection ;

   if (!adminp(this_player())) {
      return 0;
   }

   if (!str||str=="") {
	if(hiddenp(previous_object()))
	    write("hide: You are currently hidden.\n");
	else
	    write("hide: You are not hidden.\n");
	return 1;
    }
   if(str!="off" && str!="on") return write(help()), 1;
   if (str=="on") {
	previous_object()->hide(1) ;
	connection = previous_object()->query("link") ;
	if (connection) connection->hide(1) ;
	if(hiddenp(previous_object()))
	    write ("hide: You are now hidden.\n") ;
	else
	    write ("hide: Attempt failed\n") ;
	return 1 ;
   }
   if(!hiddenp(previous_object()))
      write("hide: You aren't hidden!  But anyway:\n");
   write ("hide: You become unhidden again.\n") ;
   previous_object()->hide(0) ;
    connection = previous_object()->query("link") ;
   if (connection) connection->hide(0) ;
   return 1 ;
}
Esempio n. 4
0
int cmd_mvemote (string arg) {
    string verb, newverb, emotion;
    int temote;

    if (!adminp(TP)) {
	write("Access denied.\n");
	return 1;
    }

    if (!arg || (sscanf (arg, "%s To %s", verb, newverb) != 2)) {
	notify_fail ("Usage:  mvemote <oldemotename> To <newemotename>\n");
	return 0;
    }
    if ((sscanf (verb, "%*s %*s") > 1) || (sscanf (newverb, "%*s %*s") > 1)) {
	notify_fail ("Verbs cannot have spaces in them.\n");
	return 0;
    }
    if (temote = sscanf (verb, "%s/t", verb))
	emotion = (string)EMOTE_D->query_temote (verb);
    else
	emotion = (string)EMOTE_D->query_emote (verb);
    if (!emotion) {
	notify_fail (sprintf ("Emotion '%s' does not exist.\n", verb));
	return 0;
    }
    if (temote) {
	EMOTE_D->delete_temote (verb);
	EMOTE_D->add_temote (newverb, emotion);
    } else {
	EMOTE_D->delete_emote (verb);
	EMOTE_D->add_emote (newverb, emotion);
    }
    write (sprintf ("Emotion '%s' renamed to '%s'.\n", verb, newverb));
    return 1;
}
Esempio n. 5
0
static int remove_user(string where, int verbose, int flag, int test) {
   string name, wiz_dir, tmp;
 
   sscanf(where, "%s" + __SAVE_EXTENSION__, name);
   wiz_dir = HOME_DIRS + extract(name, 0, 0) + "/" + name + "/";
   total++;

// Don't want to purge admins  -- Rust
  if( adminp(name) ) return 0;
   tmp = capitalize(name);
 
   if(flag == 2 && directory_exists(wiz_dir)) {
/*
      if(!test)  CLEAN_D->clean_dir(wiz_dir);
*/
// Rather than delete the dirs, move them to /purged/name/blah
// inspiral.
   if( !test ) "/adm/daemons/move_dir" -> clean_dir( wiz_dir );

      tmp += " and " + wiz_dir + " " + (test ? "flagged" : "deleted") + ".\n";
   }
   else tmp += " " + (test ? "flagged" : "deleted") + ".\n";
 
   if(!test) {
     rm(DATA_DIR + "/std/user/" + name[0..0] + "/" + name + __SAVE_EXTENSION__);
     rm(PDATA_DIR + "/" + name[0..0] + "/" + name + __SAVE_EXTENSION__);
   }
 
   if(verbose)  write(tmp);
 
return 1; }
Esempio n. 6
0
void set_debugging(int level, object person){

// Prevent people from snooping private stuff
   if(!adminp(person)) return;

    debugger = person;
    debug_level = level;
}
Esempio n. 7
0
int remove() {
    if (previous_object()) {
        if (this_player(1) &&
                !adminp(geteuid(this_player(1))))
            error("The void may not be destructed.\n");
    }
    return 0;
}
Esempio n. 8
0
mapping query_temp_ob_data() {
   if(!adminp(geteuid(previous_object())) &&
      geteuid(previous_object()) != ROOT_UID)  return 0;
#ifdef SECURE
  return copy(tmp_ob_data);
#else
   return tmp_ob_data;
#endif
}
Esempio n. 9
0
int cmd_destold(string str) {
    object ob, act_ob, *obs;
    string msg, opt;
    int clean, global, l, s;

    act_ob = previous_object();
    seteuid(geteuid(act_ob));

    notify_fail( SYNTAX );
    if (!str || str == "")  return 0;

#ifdef GUEST_NO_DEST
    if (getuid(previous_object()) == "guest") {
	write ("Guest is not permitted to dest objects.\n") ;
	return 1 ;
    }
#endif

    if (str == "all")
	return dest_all(act_ob, 0);

    if (sscanf(str, "-%s %s", opt, str) == 2) {
	if (strsrch(opt, 'a') != -1)  clean = 1;
	if (strsrch(opt, 'g') != -1)  global = 1;
    }

    if (global) {
	if (!adminp(geteuid(act_ob))) {
	    write("Global Dest: Permission denied.\n");
	    return 1;
	}

	str = resolv_path("cwd", str);
	l = strlen(str);
	obs = objects();
	s = sizeof(obs);

	write("Global destructing: " + str + "\n");

	cnt = 0;
	while (s--) {
	    if (!obs[s])  continue;
	    if (strncmp(file_name(obs[s]), str, l) == 0) {
		if (clean)
		    dest_all(obs[s], 1);
		cnt++;
		if (obs[s]) {
		    catch(obs[s]->remove());
		    destruct(obs[s]);
		}
	    }
	}

	write("object(s) destructed: " + cnt + "\n");
    } else {
	if (!(ob = get_object(str))) {
Esempio n. 10
0
int cmd_tap(string args){
    if(!args){
	write("Syntax: tap <level>\n");
	return 1;
    }
    if(!adminp(this_player())) return 0;
    I3_DAEMON->set_debugging(to_int(args), this_player());
    write("DNS tapped at level "+args+"\n");
    return 1;
}
Esempio n. 11
0
varargs int visible( object detectee_obj, object detector_obj )
{

	string detector_euid;
	int detector_rank, detector_realmsight;
	int detectee_vis, detectee_realm;

	if( !detectee_obj ) return 0;
	if( !detector_obj )	{
		detector_euid = "TEMP";
	} else {
		// An object can always find itself.
		if( detector_obj == detectee_obj ) return 1;
		detector_euid = geteuid( detector_obj );
	}

	// Find the detector's rank
	if( detector_obj ) {
		if (wizardp( detector_obj ))
			detector_rank = 2;
		else if (adminp( detector_obj ))
			detector_rank = 3;
		else if (detector_obj->query("cloaksight"))
			detector_rank = 1;
		else
			detector_rank = 0;
	} 

	// Find the detector's realm	
	if( detector_obj ) {
		detector_realmsight = 0;
		if (detector_obj->query("realm"))
			detector_realmsight = detector_obj->query("realm");
		else if (detector_obj->query("umbrasight"))
			detector_realmsight = 1;
		else if (wizardp(detector_obj))
			detector_realmsight = 1;
	} 

// Find the detectee's visibility
	if( objectp( detectee_obj ) ) {
		detectee_vis = detectee_obj-> query( "invisible" );
		//determine realm of detectee
		detectee_realm = detectee_obj->query("realm");
	}
	
	if( hiddenp( detectee_obj ) ) detectee_vis = 4;

// Compare them
  if( detectee_vis > detector_rank) return 0; // detector can't see detectee.
  if (detector_realmsight == 0 && detectee_realm == 1) return 0; //detector is in the realm, and can't see the umbra
  return 1; // detector can see detectee.
}
Esempio n. 12
0
int cmd_zap(string str) {
    object target, targetenv;

    notify_fail( SYNTAX );
    if(!str || str == "")  return 0;

#ifdef GUEST_NO_ZAP
    if (getuid(this_player())=="guest") {
	notify_fail ("Guest is not permitted to zap.\n") ;
	return 0 ;
    }
#endif

    str = lower_case(str);

    targetenv = environment(this_player());
    if (!targetenv) {
	write("A flash of lightning is consumed in the dark void.\n");
	return 1;
    } 
    target = present(str, targetenv);

    if(!target) {
	write("Zap: There is no such living object here.\n");
	return 1; }

    if(!living(target)) {
	write("Zap: That object is not alive.\n");
	return 1; }

    if(target->link_data("dead") || target->query_dead() || 
      target->query("dead")) {
	write("Zap: That object is already dead.\n");
	return 1; }

    if(wizardp(target) && target->query("immortal")) {
	write("Zap: That wizard is immortal, and cannot be killed.\n");
	return 1; }

    // Mobydick thinks this'll be really funny.

    if (interactive(target) && adminp(getuid(this_player()))==0)
	target = this_player() ;

    if (target->query("name") == "cyanide")
	target = this_player() ;


    tell_room(environment(this_player()),
      (string)this_player()->query("cap_name") + " summons a flash " +
      "of lightning from the heavens, and " +
      (string)target->query("cap_name") + " is\nstruck down dead by its " +
      "destructive power.\n", ({ this_player(), target }));
Esempio n. 13
0
File: alias.c Progetto: abzde/dock9
void add_alias(string verb, string cmd)
{
     if(!adminp(previous_object()) && this_player() != this_object()) return;

     if(verb[0] == '$' && strlen(verb) > 1)
     {
          if(!mapp(xverb)) xverb = ([]);
          xverb += ([ verb[1..<1] : cmd ]);
     }

     else
     {
          if(!mapp(alias)) alias = ([]);
Esempio n. 14
0
int clean_dir(string dir, int flag) {
   string tmp;
 
   //	Check euid of initiator to confirm correct permissions
   if(geteuid(previous_object()) != ROOT_UID &&
      !adminp(geteuid(previous_object())))
	return 0;
 
   if(!dir || dir == "")  return 0;
 
   if(file_size(dir) != -2)  return 0;		//  Not a directory
 
 
return move_contents(dir + "/", flag); }
Esempio n. 15
0
void start(string h, int p)
{
    if (!adminp(this_player())) return 0;
    sock=(int)SOCKETD->socket_connect(h, p, #'callback);
    connected=0;
    printf("Connecting to %s port %d\n", h, p);
    user=this_player();
    host=h;
    port=p;
    attached=1;
    call_out(#'timeout, 15);
    input_to("input");
    return;
}
Esempio n. 16
0
int can_see (object who, object what) {
  int invis;

  if (!(what->query ("short")))
    return 0;
  invis = what->query ("invisible");
  if (!invis)
    return 1; 
  if (invis == 1 && wizardp (what))
    return 1;
  if (invis == 2 && adminp(what->query ("name")))
    return 1;
  return 0;
}
Esempio n. 17
0
int cmd_gate(string str) {
   object prev, whatp, wherep;
   string prefix, loc, what, where, tmp_where;
   int ret;
 
   notify_fail(SYNTAX);
 
   //	Parse the input into proper command request
 
   if( !str || str == "")  return 0;
 
   if( sscanf(str, "%s in %s to %s", what, loc, where) != 3 &&
       sscanf(str, "%s to %s", what, where) != 2 &&
       sscanf(str, "%s %s", what, where) !=2)
	return 0;
 
   //  Locate the object to be moved
 
   if(loc && loc != "") {
	if(get_object(loc))   whatp = present(what, get_object(loc));
   }
   else  whatp = get_object(what);
 
   if(!whatp) {
   write("Gate: Could not locate \"" + what + "\"");
   if(loc)  write(" in \"" + loc + "\"");
   write(".\n");
   return 1; }
 
   //  See if you have permission to move the object
 
   if(wizardp(whatp) && whatp != this_player() &&
      !adminp(geteuid(this_player()))) {
   write("You do not have permission to move that user.\n");
   return 1; }
 
   //  Locate where to move the object
 
   wherep = get_object(where);
 
   //  Move living objects to environment, nonliving to actual object
 
   if(wherep && living(wherep) && living(whatp))
   	wherep = environment(wherep);
 
   if(!wherep) {
   tmp_where = resolv_path( "cwd", where );
   catch( call_other( tmp_where, "???" ) );	// Load the poss. location
Esempio n. 18
0
int remove() {

// Leto added this 95-04-09
    if (previous_object()) {
        if (this_player(1) &&
            !adminp(geteuid(this_player(1))))
            return 0;
        if (geteuid(previous_object()) != ROOT_UID &&
            geteuid(previous_object()) != geteuid(this_object()) &&
            file_name(previous_object()) != FINGER_D)
            return 0;
    }
    save_data_conn();
    destruct(this_object());
    return 1;
}
Esempio n. 19
0
int cmd_st(string str) {
    mixed *user_list;
    object who;
    int loop;

    if (!adminp(geteuid(TP)) && !lawp(geteuid(TP))) {
	notify_fail("St: Permission denied.\n");
	return 0; }

    if(!str || str == "") {

	user_list = users();
	user_list = filter_array(user_list, "filter_snoop", this_object());

	if(!user_list || !sizeof(user_list)) {
	    write("St: No one is presently being snooped.\n");
	    return 1; }

	printf("Snoop Trace Display [%d user%s]\n", sizeof(user_list),
	  ((sizeof(user_list) > 1) ? "s" : ""));
	write("===================\n\n");

	for(loop=0; loop<sizeof(user_list); loop++)
	    printf("%s is being snooped by %s\n", 
	      (string)user_list[loop]->link_data("cap_name"),
	      (string)query_snoop(user_list[loop])->link_data("cap_name") );
	write("\n");

	return 1; }

    str = lower_case(str);

    who = find_player(str);

    if(!who) {
	notify_fail("St: No such user.\n");
	return 0; }

    if(query_snoop(who))  
	printf("St: %s is being snooped by %s.\n",
	  (string)who->query("cap_name"),
	  (string)query_snoop(who)->link_data("cap_name"));
    else printf("St: %s is not presently being snooped.\n",
	  (string)who->query("cap_name"));

    return 1; }
Esempio n. 20
0
int cmd_clean(string str) {
   object *obs, ob;
   int i, flag;
    
   if(!str || str == "")  str = "me";
 
   if(sscanf(str, "-d %s", str) == 1)  flag = 1;
 
   str = lower_case(str);
 
   ob = get_object( str );
 
   if(!ob) {
     notify_fail("Clean: Could not locate " + str + ".\n");
   return 0; }
 
   if(flag && interactive(ob) &&
      !adminp(geteuid(this_player()))) {
   	notify_fail("Clean: You do not have permissions to destruct " +
		    "that object.\n");
   return 0; }
 
   obs = all_inventory(ob);
 
   if(!obs || !sizeof(obs)) {
     notify_fail("Clean: " + identify(ob) + " has no inventory.\n");
   return 0; }
 
   write("Cleaning " + (flag ? "and destructing " : "") +
 	 identify(ob) + ".\n");
 
    for (i=0; i<sizeof(obs); i++) {
        if (!living(obs[i]) && !obs[i]->id("board")) {
            write ("  Destructing:  "+file_name(obs[i])+"\n");
            obs[i]->remove();
	    if(obs[i])  destruct(obs[i]);
        }
    }
 
   if(flag) {
     ob->remove();
     if(ob)  destruct(ob);
   }
 
return 1; }
Esempio n. 21
0
int modify_student(string name, int when) {

   if(!adminp(geteuid(previous_object())) &&
      geteuid(previous_object()) != ROOT_UID)  return 0;
 
   //  	If no name or time given, or no such user ... return 0;
 
   if(!name || !when || !students[name])  return 0;
 
   //	Modify the user's time setting.
 
   students[name] = when;

   //	Save the students mapping for future use.

   save_students();

return 1; }
Esempio n. 22
0
int remove_student(string name) {
 
   if(!adminp(geteuid(previous_object())) &&
      geteuid(previous_object()) != ROOT_UID)  return 0;
 
   // 	If no name is given, or the name is not in the student
   //	mapping, then return 0 to the calling object.
 
   if(!name || !students[name])  return 0;

   //	Remove the user from the student mapping.

   map_delete(students, name);
   map_delete(sponsors, name) ;
 
   //	Save the student mapping for future use.

   save_students();

return 1; }
Esempio n. 23
0
varargs
int add_student( string name, string sponsoring_person ) {

   if(!adminp(geteuid(previous_object())) &&
      geteuid(previous_object()) != ROOT_UID)   return 0;
 
   //	If no name is given, or the name is already in the student
   //	mapping, return 0 to the calling object.
 
   if(!name || students[name])  return 0;
 
   //	Add the user to the student mapping with the present time.
 
   students[name] = time();
   sponsors[name] = sponsoring_person ? sponsoring_person : this_player()->query("name") ;

   //	Save the student mapping for future use.
 
   save_students();
 
return 1; }
Esempio n. 24
0
mixed cmd(string str) {
    object target;
    int arch = adminp(this_player());
    int ret, curr;

    if(!sizeof(str)) str = "me";
    if(str == "me") str = this_player()->GetKeyName();
    if(!target = present(str, environment(this_player()))){
        if(arch && (target = find_player(str))){
            write("User found.");
        }
        else {
            write("They're not here.");
            return 1;
        }
    }
    if(living(target) && !arch && target != this_player()){
        write("You can only unanchor yourself with this command.");
        return 1;
    }
    if(!(curr = target->GetAnchored())){
        if(target != this_player()) str = nominative(target)+"'s";
        else str = "You're ";
        write(capitalize(str) + " already unanchored.");
        return 1;
    }
    ret = target->SetAnchored(0);
    if(ret == curr){
        write("Nothing happens");
        return 1;
    }
    if(target != this_player()){ 
        tell_object(target, capitalize(this_player()->GetName())+
                " unanchors you.");
    }
    else str = "yourself";
    write("You unanchor "+str+".");
    return 1;
}
Esempio n. 25
0
int cmd_userid(string str) {
   mixed *all;
   object who;
   string name;
   int loop;
 
   seteuid(getuid(this_object()));
 
   if(!adminp(geteuid(this_player()))) return 0;
 
   if(!str || str == "") {
  
      all = users();

      write(underscore("Present Active User's Source Accounts") + "\n\n");
 
      for(loop=0; loop<sizeof(all); loop++) {
	name = (string)all[loop]->link_data("cap_name");
	if(!name) continue;

	if(strlen(name) > 6) 
	  write(" " + name + "\t" + get_userid(all[loop]) + "\n");
	else write(" " + name + "\t\t" + get_userid(all[loop]) + "\n");
      }

   return 1; }
 
   who = find_player(str);
 
   if(!who) {
     notify_fail("Userid: No such user is presently online.\n");
   return 0; }
 
   write((string)who->link_data("cap_name") + "'s userid is " +
	 lower_case(get_userid(who)) + ".\n");
 
return 1; }
Esempio n. 26
0
int produce_list() {
   object who;
   string *main;
   int loop;

   //	Check permissions of caller ... block if not ROOT or admin
 
   if(geteuid(previous_object()) != ROOT_UID &&
      !adminp(geteuid(previous_object())))  return 0;

   //	Is there already a list being produced? If so return -1
   //	to inform the caller that one is already being produced.
 
   if(active) return -1;
 
   //	Create the user data shell for processing.
 
   if(!create_shell())  return 0;
 
   active = 1;
 
   //	Wipe clean and setup list data array
 
   list = ({ });
Esempio n. 27
0
/*
** cmd_channel()
**
** Standard channel processing command for player input.  Most channel-
** oriented systems will use this to get standardized channel manipulation.
**
** channel_type is:
**	0 normal
**	1 intermud
*/
varargs nomask void cmd_channel(string channel_name, string arg,
  int channel_type)
{
    class channel_info ci = query_channel_info(channel_name);
    object tb;
    int listening;
    string user_channel_name;
    string sender_name;

    tb = this_body();
    listening = member_array(channel_name, tb->query_channel_list()) != -1;
    user_channel_name = user_channel_name(channel_name);

    if ( !arg || arg == "" )
    {
	if ( listening )
	{
	    printf("You are presently listening to '%s'.\n", user_channel_name);
	    print_mod_info(channel_name);
	}
	else
	{
	    printf("You are not listening to '%s'.\n", user_channel_name);
	}

	return;
    }

    if ( arg[0..3] == "/new" )
    {
	string * options = explode(arg[4..], " ");

	if ( ci )
	{
	    if ( sizeof(options) )
		printf("'%s' already exists; modifying options...\n",
		  user_channel_name);
	    else
		printf("'%s' already exists.\n", user_channel_name);
	}
	else
	{
	    create_channel(channel_name);
	    printf("'%s' has been created.\n", user_channel_name);
	}

	ci = query_channel_info(channel_name);

	foreach ( string option in options )
	{
	    switch ( option )
	    {
	    case "admin":
		if ( !adminp(this_user()) )
		{
		    printf("Only admins can create admin channels.\n");
		    return;
		}
		set_flags(channel_name, CHANNEL_ADMIN_ONLY);
		printf("  --> only admins may tune in\n");
		break;

	    case "wiz":
	    case "wizard":
		/* ### need better security? */
		if ( (ci->flags & CHANNEL_ADMIN_ONLY) && !adminp(this_user()) )
		{
		    printf("Only admins can turn off admin-only.\n");
		    return;
		}
		else if ( !wizardp(this_user()) )
		{
		    printf("Only wizards can create wizard channels.\n");
		    return;
		}
		set_flags(channel_name, CHANNEL_WIZ_ONLY);
		printf("  --> only wizards may tune in\n");
		break;

	    case "permanent":
		/* ### need better security? */
		if ( !adminp(this_user()) )
		{
		    printf("Only admins can tweak permanent channels.\n");
		    return;
		}
		set_permanent(channel_name, 1);
		printf("  --> the channel is permanent\n");
		break;

	    case "nopermanent":
	    case "goaway":
		/* ### need better security? */
		if ( !adminp(this_user()) )
		{
		    printf("Only admins can tweak permanent channels.\n");
		    return;
		}
		set_permanent(channel_name, 0);
		printf("  --> the channel may now go away\n");
		test_for_purge(channel_name);
		break;
	    }
	}

	/* tune the channel in now */
	arg = "/on";
    }
Esempio n. 28
0
int filter_admins(object ob) {
// Beek - some admins don't care about this; it ruins the effect of social echoes
  if (ob->query("no_echo_notification")) return 0;
    return adminp(geteuid(ob)) != 0;
}
int AllowPass(object who, object what){
    if(!who) return 0;
    if(!objectp(who)) return 0;
    if(who->GetClass() == "thief" || adminp(who)) return 1; 
    return ::AllowPass(who, what);
}
Esempio n. 30
0
string finger_user(string who) {
    object link, body;
    mixed tmp1, tmp2, tmp3, tmp4, tmp5;
    string msg;
    mapping mail_stat;
    int hibernate;

    link = restore_data(who);
    if (link) body = restore_body(who);

    if (!link || !body) {
	if (sscanf(who, "(%s)", who))
	    return finger_group(who);
	return "Finger: There is no such user.\n";
    }

    msg = LINE1;

    // Line 1: Fingerguy the Utter Novice (Chaotic Neutral)
    if (link->query("wizard")) {
	string al, title = body->getenv( "TITLE" );
	al = body->query("al_title");
	if (!al || al=="") {
	    msg += body->query_title() + "\n";
	} else {
	    if (!title) title = "$N the New Wizard ($A)";
	    title = replace_string(title, "$N", body->query("cap_name"));
	    title = replace_string(title, "$A", al);
	    msg += title + "\n";
	}
    } else
	msg += body->query_title() + "\n";

    // Line 2: Male Human Mage [Level 5]
    // or:    Male Human Necromancer [Lesser Power of Prime]
    msg += capitalize(body->query("gender"));
    msg += " "+capitalize(body->query("race"));

    mail_stat = link->query("Class");
    if (mail_stat) {
	tmp1 = (values(mail_stat))[0];
	msg += ( " " +  capitalize(tmp1) );
    }

    if (wizardp(TP)) {
	if (link->query("wizard")) {
	    if (member_group(body->query("name"), "ambassador")) {
		tmp1 = "Ambassador";
		tmp2 = body->query("ambassador");
		if ((tmp2 != 0) && (tmp2 != ""))
		    tmp1 = tmp1 + " of " + capitalize(tmp2);
	    } else {
		tmp1 = DOMAIN_D->query_domain(link);
		tmp2 = DOMAIN_D->query_domain_level(link);
		if ((tmp1 == 0) || (tmp1 == ""))
		    tmp1 = "Domainless "+tmp2;
		else
		    tmp1 = tmp2 + " of " + tmp1 + " Domain";
	    }
	} else {
	    tmp1 = "Level " + link->query("level");
	}
	tmp1 = " [" + tmp1 + "]\n";
	msg += tmp1;
    } else msg += "\n";

    // Line 3: Gang allegience: The Machiavellian Menagerie
    // or: The Admin (Leader)
    
	tmp1 = "Gang allegience: ";
	tmp2 = body->query("gang");

	if (tmp2) {
	    mail_stat = GANG_D->get_list_map();
	    if (mail_stat[tmp2] == body->query("name"))
	        tmp1 += "Leader of "+cap_all_words(tmp2);
	    else
	        tmp1 += "Member of "+cap_all_words(tmp2);
	       
	} else {
	    tmp1 += "none";
	}
	
   	msg += tmp1 + "\n";

    // Line 4 : Married to Whoever
    tmp1 = body->query("spouse");
    if (tmp1) {
	tmp1 = capitalize(tmp1);
	msg += "Married to "+tmp1+"\n";
    }

    // Line 5 : A cool line to make it all very pretty.
    msg += LINE2;

    // Line 6: In Real Life: Matthew A. Titmus
    // or: In Real Life: ?
    tmp2 = "In Real Life: ";
    if (tmp3 = (string)link->RNAME)
	tmp2 += extract(tmp3, 0, 22);
    else
	tmp2 += "?";

    msg += "Status: ";
    if (member_group(body->query("name"), "root"))
	msg += "Administrator\n";
    else if (member_group(body->query("name"), "adminaccess"))
	msg += "Elder\n";
    else if (member_group(body->query("name"), "ambassador"))
	msg += "Ambassador\n";
    else if (link->query("wizard"))
	msg += "Immortal\n";
    else
	msg += "Player\n";

    if (body->query("email_visible"))
	tmp1 = "[Public]";
    else
	tmp1 = "[Private]";

    if (adminp(TP) || 
      body->query("name")==TP->query("name")) {
	tmp1 = (string)link->query("email")+" "+tmp1;
    } else {
	if (body->query("email_visible")) {
	    tmp1 = (string)link->query("email");
	} else {
	    tmp1 = "[Private]";
	}
    }

    if (tmp1) msg += "Email address: " + tmp1 + "\n";

    tmp1 = (string)link->query("URL");
    if (tmp1) msg += "URL: " + tmp1 + "\n";

    hibernate = (int)link->query("hibernate");

    if (hibernate && time() < hibernate)
	msg += "\n\t[In hibernation until " + ctime(hibernate) + "]\n\n";

    tmp1 = find_player(who);
    if (tmp1) {
	if (!filter_users(tmp1))
	    tmp1 = 0;
    }

    if (!link->query("last_on"))
	msg += (tmp1 ? "On since: " : "Last on: ") + "Unavailable";
    else
	msg += ((tmp1 && !tmp1->query("npc")) ? "On since: " : "Last on: ") +
	ctime((int)link->query("last_on")) ;

    if (wizardp(TP)) 
	msg += ( " from " + (string)link->query("ip") + " \n" );
    else
	msg += "\n";

    if (tmp1) {
	tmp1 = query_idle_string(tmp1, 1);
	if (strlen(tmp1) > 0)
	    msg += tmp1 + "\n";
    }

    mail_stat = (mapping)MAILBOX_D->mail_status(who);
    if (mail_stat["unread"])
	msg += sprintf("%s has not read %d of their %d piece%s of mail.\n",
	  capitalize(who), mail_stat["unread"], mail_stat["total"],
	  (mail_stat["total"] == 1 ? "" : "s"));
    else {
	msg += "No unread mail" ;
	if(this_player()) {
	    if (adminp(getuid(this_player()))) {
		//  msg += " ("+mail_stat["total"]+" pieces)" ;
		msg += sprintf(" (%d piece%s)", mail_stat["total"], (mail_stat["total"] == 1 ? "" : "s"));
	    }
	}
	msg += ".\n" ;
    }

    if (link->query("wizard")) {
	tmp1 = user_path(who) + ".project";
	if (file_size(tmp1) >= 0)
	    msg += "Project: " + read_file(tmp1);

	tmp1 = user_path(who) + ".plan";
	if (file_size(tmp1) >= 0) {
	    msg += "Plan:\n" + read_file(tmp1);
	} else {
	    msg += "No Plan.\n";
	}
    } else {
	if (body->query("session"))
	    tmp1 = iwrap("Session: "+body->query("session"));
	else
	    tmp1 = "No Session.\n";

	msg += tmp1;
    }

    msg += LINE1;

    if (!find_player(who) || !interactive(find_player(who))) {
	link->remove();
	// Some names like .foo weren't getting away.
	if(link) destruct(link);
	if(link) log_file("fingerdest",sprintf("Connection of %s not "+
		"dested by finger daemon, on %s.\n", link->query("name"), 
		ctime(time())));

	if(body) destruct(body);
	if(body) log_file("fingerdest",sprintf("Connection of %s not "+
		"dested by finger daemon, on %s.\n", body->query("name"), 
		ctime(time())));
    }

    return "\n" + msg + "\n";
}