/************[  Sysop Menu For The Edge of Chaos By (ray-1/A((eSS ]**************/
/*                                                                          */
/*              This is the first of a line of Ami-Express doors            */
/*          from A((eSS This is also The Generic Source that Cray-1         */
/*             has "put together" to be used with further doors!!           */
/*                                                                          */
/*              Edge of Chaos BBS System A((eSS's UK Hq                     */
/*                                                                          */
/**********************[ Use it but DON'T Abuse it! ]************************/

#define Ver "$VER: Sysop Menu Version 2.2 Cray-1 of A((eSS"
#include "doorheader.h"
#include "glue.h"
#include <string.h>
#include <proto/exec.h>
#include <proto/icon.h>
#include <dos/dos.h>
#include <ctype.h>
#define sm sendmessage
#define pm prompt
#include <clib/intuition_protos.h>
#include <clib/dos_protos.h>
#include <exec/types.h>
#include <stdio.h>
#include <stdlib.h>

char Name[100];   /*Where the Name of The User is Stored */
char Access[4]; /* Where The users ACCESS Level Is Stored */
char SysName[100];
char Reply[3];    /*Where Hot key Replys from The user Go */
char buffer[200]; /*A Buffer I Use ALOT */

int AcsNumber,nodes;
BOOL ALL=FALSE;
/* This is The Mail Structure */
int special;

struct MailStruct
{
     char MessageStat;   /* This is A simple ASCII Read Statis */
     char DontKnow[4];   /* Dont Know Might be a Space         */
     char MessageNumber; /* The Message Number                 */
     char ToName[30];    /* The person the Mail is TO          */
     char Space1[1];     /* Some Kind of Space Again           */
     char FromName[30];  /* The Person The Mail is From        */
     char Space2[1];     /* Another Space                      */
     char Subject[30];   /* The Subject of The Mail            */
     char Space3[1];     /* Another Space                      */
     char Date[11];      /* SomeHow This is The Date!!!!       */
};


struct MailStruct *MailPTR, MailHead;
struct DiskObject *dobj;


/* Making a MailStruct Pointer called MailPTR, and a MailStruct */
/* struct called MailHead.                                      */

FILE        *HeaderFile;  /* The Header File */ 
FILE        *MailStatus;  /* The Mail Status File */
FILE        *Mail;        /* The Mail Itself */


/* Prototypes Follow!!!!! */

void SendCurrent( char * );   /*Used For Writting the MailHead To Disk */
void SysMenu( void );       /*The Main Menu For The Door             */
void DlCallers( void );     /*DownLoad The Callers Log Door          */
void Reboot( void );        /*Reboot The Computer Door               */
void KillAdds( void );      /*Currently Not Used                     */
BOOL GetIconTooltype(char *,char *, char *); /* NOT MY CODE */ 
int WipeMail( char * );     /*This Wipes ALL READ mail In The Path Specified*/
void FakeMail( void );      /*Sends Some FAKE Mail To Someone!       */
void EditFile( void  ); /*Edits A Text File */
void DownCallers( int );

/* End of ProtoTypes */

main(int argc,char *argv[])
{
       char Msgbase[10]="Msgbase/";  
       char Stats[10]="MailStats";
       char header[12]="Headerfile";
       char string[100];
       char copy[100];
       char copy2[60];
       Register(argv[1][0]-'0');    /* Must Register With X */

/* Get User Information Next */
       MailPTR = &MailHead;
       getuserstring(Name,DT_NAME);
       getuserstring(Access,DT_SECSTATUS);
       getuserstring(SysName,JH_Sysop);
       AcsNumber = atoi(Access);
        
/* End of User Information */

/* The Title Screen */

if(AcsNumber>200)    /* Check The Access Level */
   {       
     SysMenu();    
   }
 

/* If Your Access Level Is Less Than A Certain Amount Do This */                   
       sm("",1);
       sprintf(buffer,"[36mOK %s.. This Option is For Sysops Only.. Informing %s[0m",Name,SysName);
       sm(buffer,1);

/* Write To The Callers Log About Attemp Through A Buffer */

       sprintf(buffer,"[36mUser %s Attempted To Use This SySMenu[0m\n",Name);
       putuserstring(buffer,BB_CALLERSLOG);

/* Open The Mail Header File */
       GetIconTooltype("doors:access/sysmenu/SysMenu", "EALL_CONFERENCE", string);
       sprintf(buffer,"LOCATION.%s",string);
       GetIconTooltype("bbs:ConfConfig", buffer, string);
       strcat(string,Msgbase);
       strcpy(copy,string);
       strcpy(copy2,string);
       strcat(copy,Stats);
       strcat(string,header);
if((HeaderFile = fopen(string,"ab"))==NULL)
   {
    sm("Tell The Sysop That I Had Trouble Opening The Headerfile!\n",1);
    putuserstring("[35mSySmenu Had a Problem With The Header File[0m",BB_CALLERSLOG);
    ShutDown();
    end();
   }
   
/* Open The Mail Header File */

if((MailStatus = fopen(copy,"r+b"))==NULL)
   {
    sm(copy,1);
    sm("Tell The Sysop That I Had Trouble Opening The MailStats!\n",1);
    putuserstring("[35mSySmenu Had a Problem With The MailStats File[0m\n",BB_CALLERSLOG);
    ShutDown();
    end();
   }

/* Mail Files Are Open Prepare To Write The Mail */
  
    fseek( MailStatus, 7, SEEK_SET);               /* Go To HighestMsg Byte */
    special = fgetc( MailStatus );  /* Get HighestMsg        */
    rewind( MailStatus );                          /* Rewind File To start  */
    fclose( MailStatus );                          /* Close The File        */
    MailHead.MessageNumber=special;   
    MailHead.MessageStat='P';                          /* This Makes The Message [P]ublic */
    sprintf(MailHead.ToName,"EALL");                   /* The Message is To EALL */
    sprintf(MailHead.FromName,"Big Time Chaos Security"); /* The Message is From */
    sprintf(MailHead.Subject,"Bit Of A Hacker Here!!");/* The Subject is */

/* Next Part to Be Changed .. The Mail is HardCoded To Be Written in    */ 
/* BBS:Conferences/Sysops/ Will Change This To Be Set From An Icon Soon */   
/* The Next Part just Creates The Mail File With The Right Number       */

    sprintf(buffer,"%s%d",copy2,MailHead.MessageNumber);
    Mail = fopen(buffer,"w"); 

/*The Next Part is The MailFile Itself. I will Be Making That 'Configurable'*/
/*At a Later Date. Just now Its Still HardCoded!                            */
   
          fprintf(Mail,"[33m            SysMenu Would Like To Tell YOU SomeThing...![0m\n");
          fprintf(Mail,"            [33m ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß[0m\n");
          fprintf(Mail,"\n\n [32m Right Guys A Lamer Called: [35m%s [32mAttempted To Use The Sysop Menu \n",Name);
          fprintf(Mail,"\n     In the Future This Message Will Contain A Date And Time! :) \n");
          fprintf(Mail,"   Until That Time I Suggest Some Action Is Take Against The Lamer!\n");
          fprintf(Mail,"[0m\n\nMessage Written By Big Time Chaos Security");
          fclose( Mail);
          
/* Next Call The Routine SendCurrent() Which Actually Updates The header and */ 
/* Mail Stats File To Show Mail Has Been Sent.*/  
          
          GetIconTooltype("doors:access/sysmenu/SysMenu", "EALL_CONFERENCE", string);                  
          sprintf(buffer,"LOCATION.%s",string);
          GetIconTooltype("bbs:ConfConfig", buffer, string);
          strcat(string,Msgbase);
          strcat(string,Stats);
          SendCurrent( string );

/* The Hacker Doesnt Get Anymore Options so ShutDown() To Tell X You Are */
/* Away then end()                                                       */          
      
          ShutDown();
          end();      
}

void SysMenu(void)
{
 
putuserstring("doors:access/sysmenu/SysMenu.txt",JH_SF);

 /* Take An Input From the user */
 
 hotkey("[33m  Please Decided What You Are Going To Do....->",Reply);

     if(!strcmp("1",Reply)) Reboot();     /* if 1 Then Call Reboot()    */
     if(!strcmp("2",Reply)) KillAdds();   /* if 2 Then Call KillAdds()  */ 
     if(!strcmp("3",Reply)) DlCallers();  /* if 3 Then Call DlCallers() */
     if(!strcmp("4",Reply)) FakeMail();  /* if 4 Then Call FakeMail()  */
     if(!strcmp("5",Reply)) EditFile();  /* if 5 Then Call EditFile()  */
     if(!strcmp("6",Reply)) putuserstring("1",PRV_COMMAND);
     if(!strcmp("9",Reply)){ShutDown();end();} /* if 4 Then Quit Door   */
     SysMenu();      /* If Nothing then Call Itself Again */

}  /*!!!!!!!!!!!! END of SysMenu() !!!!!!!!!!!!!*/

void end(void)
{
       exit(0);
}

void LastCommand (void)
{
      sm("",1);
    }

void Reboot( void )
{
    int x=0;  
    char Reason[100];
    char string[100];
    char input[100];
           BOOL Password;
    Password = GetIconTooltype("Doors:Access/SysMenu/SysMenu", "REBOOT_PASSWORD", string);
if(Password)
 {
    sm("",1);
    sm("",1);
    sm("[32m Sorry But Due To The Nature Of This Function A Password Has been Implemented!",1);
    sm("",1);
    sm("[33m Password:",0);
    /* Console ONLY */
    prompt(" [34m[44m",input,100);
    sm("[0m",0);
    /* Back To Both */
    if(strcmp(strupr(input),strupr(string)))
    {
        sm("[0m",1);
        sm("[35m Sorry Thats The Wrong Password. I will note This in The Callers Log!",1);
        sprintf(buffer,"[35mUser %s, Fail Password For Reboot Attempt = %s[0m\n",Name,input);
        putuserstring(buffer,BB_CALLERSLOG);
        ShutDown();
        end();
    }           
 }

    
    sm("",0);
    sm("",1);
    sm("[35m For What Reason Do You Want To Reboot ? ",1);
    prompt("[32m ",Reason,100);  
    sprintf(buffer,"[35mUser %s Rebooted because: %s [0m\n",Name,Reason);  
    putuserstring(buffer,BB_CALLERSLOG);
    sm("[35mOk .. But Be Warned Currently Running In the Background is..[31m",1);
    Execute("Status >t:Fishy",0,0);
    sm("[35",1);
    showfile("t:fishy");
    hotkey("[33m You Still Want To Reboot .............?",Reply);
    putuserstring("[33mReboot Was Aborted![0m\n",BB_CALLERSLOG);
    sm("",1);
    if(!strcmp("N",strupr(Reply))) SysMenu();
    sprintf(buffer,"[33mOK Just Informing %s of Your wish.[0m",SysName);
    sm(buffer,1);
        
    for( x=0; x<10; x++)
        {
         sm("[32mþ",0);
         DisplayBeep(0);
         Delay(10 * 1);
        }  
   for( x=0; x<10; x++)
        {
         sm("\b[34mþ\b",0);
         DisplayBeep(0);
         Delay(10 * 1);
        }
    sm("",1);
    sm("",1);
    sm("[32mOOK... No Abort Was Detected ",1);
    sm("",1); 
    sm("[33m Now Using (ray-1's Reboot....",1);
    sm("[33m Hang on Preserving The ram Disk..",1);
    sm("",1);
    sm("[32mPlease Do NOT Drop Carrier.. Let The BBS Drop On You!",1);
    Delay(50 * 4);
    ColdReboot();
}
    
void DlCallers( void )
{
    char string[100];
    char input[100];
    int x,nodez;
   BOOL Password;
    Password = GetIconTooltype("doors:access/sysmenu/SysMenu", "CALLERSLOG_PASSWORD", string);
   if(Password)
    {
     sm("",1);
     sm("",1);
     sm("[32m Sorry But Due To The Nature Of This Function A Password Has been Implemented!",1);
     sm("",1);
     sm("[33m Password:",0);
     /* Console ONLY */
     prompt(" [34m[44m",input,100);
     sm("[0m",0);
     /* Back To Both */
     if(strcmp(strupr(input),strupr(string)))
      {
        sm("[0m",1);
        sm("[35m Sorry Thats The Wrong Password. I will note This in The Callers Log!",1);
        sprintf(buffer,"[35mUser %s, Fail Password For Fake Mail Attempt = %s[0m\n",Name,input);
                putuserstring(buffer,BB_CALLERSLOG);
        ShutDown();
        end();
      }        
     }
    GetIconTooltype("ACP", "NODES", string);
    nodes = atoi(string);
    sm("",1);
    sm("[34m Which Callers Logs Would You Like?",1);
    sm("",1);
    for(x=0;x<nodes; x++)
        {
        sprintf(buffer,"[36mNode %d's Logs................ - %d",x,x);
        sm("[36m_________________________________________________________________",1);
        sm(buffer,1);
         }
         sm("[36m_________________________________________________________________",1);
    hotkey("[33m---===> ",Reply);
    if(!strcmp("A",strupr(Reply)))ALL=TRUE;
    nodez = atoi(Reply);
   if(nodes<nodez)
     {
        sm("\nPlease Try Again With a Valid Node!!",1);
        DlCallers();
    }
    DownCallers( nodez );
 }


void DownCallers( Nodez )
{
    char buffer[100];
    char Reply[2];
 if(!ALL)
   { 
    sprintf(buffer,"Copy BBS:node%d/Callerslog T:Callerslog%d >NIL:",Nodez,Nodez);
    Execute(buffer,0,0);
    hotkey("\n[33m Would You Like Them Compressed In Any Way? ",Reply);
    if(!strcmp("Y",strupr(Reply)))
      {      
       sm("Yes",1);
       hotkey("[33m (L)ha or (Z)ip : ",Reply);
       if(!strcmp("L",strupr(Reply)))
         {  
           sm("[32mLHA",1);
           sm("[32mPlease Hold.. Lha(ing) it Now....",1);
           sprintf(buffer,"lha a t:EocLog.lha t:Callerslog%d >nil:",Nodez,Nodez);
           Execute(buffer,0,0);
           sm("[32mPlease hit Anykey for Zmodem Download",1);
           hotkey("",Reply);
           putuserstring("t:EocLog.lha",ZMODEMSEND);
           remove("t:EocLog.lha");
           sprintf(buffer,"t:CallersLog%d",Nodez);
           remove(buffer);
           SysMenu();
         }
       if(!strcmp("Z",strupr(Reply)))
         {
           sm("[32mZIP",1);
           sm("[32m Sorry Not Implmented Yet!",1);
           Delay(50 * 10);
           remove("t:CallersLog0");
           SysMenu();
         }
         SysMenu();
         remove("t:CallersLog0");
      }
              sm("",1);
              sm("[32m Please hit AnyKey for Zmodem Download",1);
              hotkey("",Reply);
              sprintf(buffer,"t:CallersLog%d",Nodez);
              putuserstring(buffer,ZMODEMSEND);
              remove("t:EocLog.lha");
              sprintf(buffer,"t:CallersLog%d",Nodez);
              remove(buffer);
  } 
              SysMenu();
}

void KillAdds( void )
{
    char Msgbase[20]="Msgbase/";
    int x=1,y=0,Total=0,NumbConfs;
    char string[80];
    char input[100];
           BOOL Password;
    Password = GetIconTooltype("doors:access/sysmenu/SysMenu", "DELETEMAIL_PASSWORD", string);
if(Password)
 {
    sm("",1);
    sm("",1);
    sm("[32m Sorry But Due To The Nature Of This Function A Password Has been Implemented!",1);
    sm("",1);
    sm("[33m Password:",0);
    /* Console ONLY */
    prompt(" [34m[44m",input,100);
    sm("[0m",0);
    /* Back To Both */
    if(strcmp(strupr(input),strupr(string)))
    {
        sm("[0m",1);
        sm("[35m Sorry Thats The Wrong Password. I will note This in The Callers Log!",1);
        sprintf(buffer,"[35mUser %s, Fail Password For DownLoading Logs Attempt = %s[0m\n",Name,input);
        putuserstring(buffer,BB_CALLERSLOG);
        ShutDown();
        end();
    }           
 }


    /* Right here we have the great Task Of Killing ALL read mail!! */
    /* The Following Code is Messy But it Does Work. So Until I get */
    /* All the other things done i have to do it stays messy!       */
    
    GetIconTooltype("BBS:ConfConfig", "NCONFS", string);
    NumbConfs = atoi( string );
    sm("",1);
    sm("",1);
    sprintf(buffer,"About To Delete Mail From %d Conferences.",NumbConfs);
    sm(buffer,1);
    sm("[33mPlease Note This Will NOT Work With READ PUBLIC Msgs..(YET!)",1);
    sm("[33mOK Now Killing All Mail That Has Been Read. Please Hold..",1);
    sm("",1);
for(x=1; x<NumbConfs+1; x++)
   {
    sprintf(buffer,"LOCATION.%d",x);
    GetIconTooltype("BBS:ConfConfig", buffer, string);
    strcat(string,Msgbase);
    y = WipeMail( string );
    Total=Total+y;
   }
   sprintf(buffer,"The Total Amount Of Mail Deleted Was %d ",Total);
   sm("",1);
   sprintf(buffer,"[33mMail Deleted From ALL Confs Total Deleted was %d[0\n",Total);
   putuserstring(buffer,BB_CALLERSLOG);
   sm(buffer,1);
   Delay(50 * 3);
  SysMenu();
}

int WipeMail( char *path )
{
   char *header="headerfile";
   char copy[80];
   BOOL terminated=FALSE;
   char c;
   int x=0;
   strcpy(copy,path); 
   strcat(path,header);
if((HeaderFile = fopen(path,"r+b"))==NULL)
      {
       sm("Tell The Sysop That I Had Trouble Opening The Headerfile!\n",1);
       ShutDown();
       end();
      }
    rewind( HeaderFile );
    while(!terminated)
      {     
        if((c = fgetc(HeaderFile))==EOF)
           {
            fclose( HeaderFile );
            terminated=TRUE;
            break;
           }    
       
        if(c=='R')        
           {
            sm(".",0);
            remove(copy);
            x++;
            fseek( HeaderFile, -1, SEEK_CUR );
            if(fputc('D',HeaderFile)==EOF)
               {
                 sm("We Have Writting Problems",1);
                 Delay(50 * 2);
                 fclose( HeaderFile );
                 SysMenu();
               }            
            }
      
        fseek( HeaderFile, 109, SEEK_CUR );
      }
    fclose( HeaderFile );        
    return(x);
}



void FakeMail( void )
{
  char string[80],MailSt[80],MsgNum[80],confchar[2];
  int NumbConfs,x,confnumb=0;
  char Msgbase[10]="Msgbase/";
  char *header="headerfile";
  char *mailstat="Mailstats";
  char input[100];
  char buffer[100],special;
         BOOL Password;
    Password = GetIconTooltype("doors:access/sysmenu/sysmenu", "FAKEMAIL_PASSWORD", string);
if(Password)
 {
    sm("",1);
    sm("",1);
    sm("[32m Sorry But Due To The Nature Of This Function A Password Has been Implemented!",1);
    sm("",1);
    sm("[33m Password:",0);
    /* Console ONLY */
    prompt(" [34m[44m",input,100);
    sm("[0m",0);
    /* Back To Both */
    if(strcmp(strupr(input),strupr(string)))
    {
        sm("[0m",1);
        sm("[35m Sorry Thats The Wrong Password. I will note This in The Callers Log!",1);
        sprintf(buffer,"[35mUser %s, Fail Password For Fake Mail Attempt = %s[0m\n",Name,input);
        putuserstring(buffer,BB_CALLERSLOG);                
        ShutDown();
        end();
    }           
 }


  sm("",1);
  sm("[32mWelcome To Fake Mail!",1);
  sm("",1);
  prompt("Who Do You Wish To Recieve This Mail?: ",MailHead.ToName,31);
  prompt("Who Do You Wish This Mail To Be From?: ",MailHead.FromName,31);
  prompt("Whats The Subject?: ",MailHead.Subject,30);
  GetIconTooltype("BBS:ConfConfig", "NCONFS", string);
  NumbConfs = atoi( string ); 
  MailHead.MessageStat='R';

  sm("",1);
for(x=1; x<NumbConfs+1; x++)
    {
     sprintf(buffer,"NAME.%d",x);
     GetIconTooltype("BBS:ConfConfig", buffer, string);
     sprintf(buffer,"%d %s\n",x,string);
     sm(buffer,0);
    }
  sm("",1);
  prompt("Which Conference Would You Like the Mail To Be Sent in?: ",confchar,2);
  confnumb=atoi( confchar );
  sm("Alright Preparing The Mail... Please Wait!",1);
  sprintf(buffer,"LOCATION.%d",confnumb);
  GetIconTooltype("BBS:ConfConfig", buffer, string);
  strcat(string,Msgbase);
  strcpy(MailSt,string);
  strcpy(MsgNum,string);
  strcat(string,header);
  strcat(MailSt,mailstat);

if((HeaderFile = fopen(string,"ab"))==NULL)
   {
    sm("Tell The Sysop That I Had Trouble Opening The Headerfile!\n",1);
    ShutDown();
    end();
   }
if((MailStatus = fopen(MailSt,"r+b"))==NULL)
   {
   sm("Tell The Sysop That I Had Trouble Opening The MailStats!\n",1);
    ShutDown();
    end();
   }  
    fseek( MailStatus, 7, SEEK_SET);               /* Go To HighestMsg Byte */
    special = fgetc( MailStatus );                 /* Get HighestMsg        */
    rewind( MailStatus );                          /* Rewind File To start  */
    fclose( MailStatus );                          /* Close The File        */
    MailHead.MessageNumber=special;                     
    sprintf(buffer,"%s%d",MsgNum,MailHead.MessageNumber);
    
 /* OPTIMIZE and WRITE to The CALLERS LOG FOR TOMMORROW */
   
    putuserstring(buffer,JH_EF);
    SendCurrent( MailSt );
    sprintf(buffer,"[33mUser %s Sent FAKEMAIL to %s \"from\" %s[0m\n",Name,MailHead.ToName,MailHead.FromName);
    putuserstring(buffer,BB_CALLERSLOG);
    sm("ok Your Mail Was Sent!",1);
    SysMenu();     
}  

void EditFile( void )
{
    char string[100];
    char input[100];
    char Filename[200];
    BOOL Password;
    Password = GetIconTooltype("doors:access/sysmenu/SysMenu", "EDITFILE_PASSWORD", string);
if(Password)
 {
    sm("",1);
    sm("",1);
    sm("[32m Sorry But Due To The Nature Of This Function A Password Has been Implemented!",1);
    sm("",1);
    sm("[33m Password:",0);
    /* Console ONLY */
    prompt(" [34m[44m",input,100);
    sm("[0m",0);
    /* Back To Both */
    if(strcmp(strupr(input),strupr(string)))
    {
        sm("[0m",1);
        sm("[35m Sorry Thats The Wrong Password. I will note This in The Callers Log!",1);
        sprintf(buffer,"[35mUser %s, Fail Password For File Editing = %s[0m\n",Name,input);
        putuserstring(buffer,BB_CALLERSLOG);
        ShutDown();
        end();
    }           
 }
    sm("[0m[32mPlease Enter The Filename (With Path) of The File To Edit:",1);
    prompt("->",Filename,200);
    sm("[33mWARNING: If A File is [A]borted, If The FileAlready Exists It Will Be Deleted!",1);
    Delay(50 * 2);
    putuserstring(Filename,JH_EF);
    sprintf(buffer,"[33m User %s Used The Editor on %s[0m\n",Name,Filename);
    putuserstring(buffer,BB_CALLERSLOG);
    SysMenu();
}
void SendCurrent( char *Conf )
{
  if((MailStatus = fopen(Conf,"r+b"))==NULL)
    {
     sm("Sorry There is a Problem with the mail stats file!!",1);
     ShutDown();
     end();
    }
  fseek( MailStatus, 7, SEEK_SET);
  fputc( MailHead.MessageNumber+1, MailStatus);
  fclose( MailStatus );
  fwrite(MailPTR ,sizeof MailHead ,1, HeaderFile);
  fclose( HeaderFile );
}

/* The Next Piece of Code is NOT Mine.. I ripped it Off */
/* it works so .. hay I am happy saved me some time!    */
/* Taken from Some X Developers Thingy Then Modified By */
/* me So it Actually WORKS!... Plagearism is Kewl!!      */
BOOL GetIconTooltype(char *IconName, char *text, char *buffer)
{
    char  *tooltype;
    char  **toolarray;
    
       dobj = GetDiskObject(IconName);
       if (dobj==NULL) 
          { 
            ShutDown(); 
            end();
          }
       toolarray = dobj->do_ToolTypes;
       if (tooltype=FindToolType(toolarray, text))
          {
           strcpy(buffer,tooltype);
           FreeDiskObject(dobj);
           return(1);
          }
       else
          {
           buffer=NULL;
           FreeDiskObject(dobj);
           return(0);
          }
}
