void kommando(struct RexxMsg *tempmess) { int parseret; if((parseret=parse(hittaefter(tempmess->rm_Args[0])))==-1) { sprintf(outbuffer,"\r\nFelaktigt kommando: %s\r\n",hittaefter(tempmess->rm_Args[0])); puttekn(outbuffer,-1); tempmess->rm_Result1=0; tempmess->rm_Result2=NULL; } else if(parseret==-3) { tempmess->rm_Result1=0; tempmess->rm_Result2=NULL; } else if(parseret==-4) { sprintf(outbuffer,"Du har ingen rätt att utföra kommandot: %s",hittaefter(tempmess->rm_Args[0])); puttekn(outbuffer,-1); tempmess->rm_Result1=0; tempmess->rm_Result2=NULL; } else { if((sendrexxrc=dokmd(parseret,0))==-8) { tempmess->rm_Result1=100; tempmess->rm_Result2=NULL; } else { tempmess->rm_Result1=0; tempmess->rm_Result2=NULL; } } }
void kommando(struct RexxMsg *mess) { int parseret; char *nikcmd; nikcmd = hittaefter(mess->rm_Args[0]); if((parseret = parse(nikcmd)) == -1) { LogEvent(SYSTEM_LOG, WARN, "Invalid NiKom command in ARexx 'NikCommand': '%s'", nikcmd); SetRexxResultString(mess, "1"); } else if(parseret == -3) { LogEvent(SYSTEM_LOG, WARN, "Empty command sent to ARexx 'NikCommand'"); SetRexxResultString(mess, "2"); } else if(parseret == -4) { LogEvent(SYSTEM_LOG, WARN, "User %d has no permission executing NiKom command in ARexx 'NikCommand': '%s'", inloggad, nikcmd); SetRexxResultString(mess, "3"); } else { if((sendrexxrc = dokmd(parseret,0)) == -8) { SetRexxErrorResult(mess, 100); } else { SetRexxResultString(mess, "0"); } } }
void niknrcommand(struct RexxMsg *mess) { int nr; char *commandstr = hittaefter(mess->rm_Args[0]); nr = atoi(commandstr); argument=hittaefter(commandstr); if((sendrexxrc = dokmd(nr, 0)) == -8) { SetRexxErrorResult(mess, 100); } else { SetRexxErrorResult(mess, 0); } }
void niknrcommand(struct RexxMsg *tempmess) { int nr; char *kom=hittaefter(tempmess->rm_Args[0]); nr=atoi(kom); argument=hittaefter(kom); if((sendrexxrc=dokmd(nr,0))==-8) { tempmess->rm_Result1=100; tempmess->rm_Result2=NULL; } else { tempmess->rm_Result1=0; tempmess->rm_Result2=NULL; } }