/* ---------------------------------------------------------------------- */
/* Online Commander v0.3.Test                       2:5045/37.18@Fidonet  */
/* Copyright (c)1998-99 by Alex Carcass                  carcass@chat.ru  */
/* ---------------------------------------------------------------------- */

? print "þ Userlist...\n"

void usr_check()        // s1 = string; buf = login
{ AX = DS; BX = #s1;
$ PUSHA; GETLPART(,,#s); $ POPA; CX = BX;            // DS,#s1,#s<-[ACS]
$ PUSHA; GETRPART();     $ POPA                      // DS,#s1,#s1
$ PUSHA; GETLPART(,,#usr_info[USR_LOGIN]); $ POPA    // DS,#s1,#usr_info[...]
$ PUSHA; GETRPART();     $ POPA                      // DS,#s1,#s1
$ PUSHA; GETLPART(,,#usr_info[USR_PASSW]);           // DS,#s1,#usr_info[...]
  VAL(#s); usr_info[USR_ACS]=AL;
$ POPA;  GETRPART();                                 // DS,#s1,#s1<-[TIME]
  VAL(#s1); DSWORD[#usr_info[USR_TIME]]=AX;
  STRCMP(DS,#buf,#usr_info[USR_LOGIN]);
$ DEC  AL
$ JNS  M1
  wVar1 = 1; $ STC; return();
M1:
  wVar1 = 0; $ CLC
}

byte USR_LOAD()         // #buf = login
{ FILLCHAR(CS,#usr_info,USR_SIZE,0); AX = #s1;
$ PUSH AX; GET_PROMPT(,CFG_USERS);
$ POP  AX; DX = AX;
  IF(FREADTEXT(,#usr_check,127)==1)
  { AX = wVar1; $ PUSH AX
    mnt_init(); $ POP  AX
  }
}
