home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFPRC1
/
GETPRIVS.SRF
< prev
next >
Wrap
Text File
|
1997-07-06
|
1KB
|
48 lines
/****************/
/* extract dynamic privileges for this client */
sref_get_add_privs:
parse arg host_nickname,who,port,enmadd,tempdata_dir,verbose
d1=date('b')
t1=time('m')/(24*60)
nowtime=d1+t1
/* check for file. If not there, give up */
wdir=strip(tempdata_dir,'t','\')||'\'
dafile=wdir||"_ADDPRIV."||port
aa=stream(dafile,'c','query exists')
if aa="" then do
if verbose>2 then call pmprintf_sref('No add-privileges file: 'dafile)
return ' ' /* no entries */
end
ause=sref_open_read(dafile,30,'READ')
if ause<0 then do /* couldn't get it, give up */
if verbose>0 then call pmprintf_sref(" Warning: add-privileges file busy ")
return ' '
end
ause=charin(dafile,1,chars(dafile))
/* see if any thing for client */
if pos(who,ause)=0 then return ' '
if host_nickname<>' ' then
if pos(host_nickname,ause)=0 then return
/* got something for this client/host_nickname; get em */
phold=""
crlf='0d0a'x
ause=translate(ause,' ','001a09'x)
do until ause=""
parse upper var ause . (who) adate anick ',' aprivs (Crlf) ause
anick=strip(anick) ; adate=strip(adate); aprivs=strip(aprivs)
if host_nickname<>' ' & anick<>host_nickname then iterate
if adate<nowtime then iterate
phold=phold||' '||aprivs
end
if verbose>2 & phold<>' ' then call pmprintf_sref(" Adding privileges: " phold)
return phold