/* EditWho.rexx by Galt of Atlantis 1:3612/369 (904)479-3133 | 479-4080     */
/*                                                                          */
/* This is a small utility to edit the items normally found in the various  */
/* 'who' displays, including the stock CNET who.                            */
/* This will allow the user, in one menu, or accessing my EDPWHoBan.rexx,   */
/* Their organization, City, State, and Country.                            */
/* I like this especially because the normal CNET priv flags do not allow   */
/* you to give the user access to change the city state & county WITHOUT    */
/*changing their actual STREET adrress.                                     */
/* Just add a menu item:                              */
/*                                                    */
/* EDW    | {#0pfiles:rexx/editwho.rexx}              */
/*          |                                         */
/*           \Control Q and Path to program.          */

acc=2                /*Lowest access level to use the program */

options results
tr=transmit;ss=sendstring;gu=getuser;pu=putuser
gu 15;access=result
if access < acc then exit
getuser 1;name=result
getuser 1100461;sex=result
if sex=0 then nm='c9'name
if sex=1 then nm='cc'name

MAIN:
changewhere 'EditWho'
gu 1300150;sta=result
gu 1300192;cou=result
gu 1300562;ban=result
gu 59;org=result
call open(last, '_Last.txt',r)
banner=readln(last)
call close(last)
last=left(banner,43)
tr " f1n4 z4cbEditWho.Rexxq1n1"
tr "  cf[cbScf]cetate        cf:ce "sta
tr "  cf[cbCcf]ceountry      cf:ce "cou
tr "  cf[cbBcf]ceanner       cf:ce "ban
/*tr "  cf[cbEcf]cedit Last    cf:ce "last*/
tr "  cf[cbOcf]cerganization cf:ce "org
tr "  cf[cbWcf]ceho"
ss " n1cf[cbSCBOW?cf] ccChoice? ca:"
getchar;ans=result
call CHECK
if ans=" " then call quit
if ans="W" then call who
if ans="O" then call organ
if ans="B" then call newb
if ans="S" then call state
if ans="C" then call count
/*if ans="E" then call elast*/
if ans="?" then call main
if ans="Q" then call quit
call quit

WHO:
tr 'f1'
bbscommand "who"
tr "n1cfPress any key to continue... g1"
call main

ORGAN:
tr 'O'
addkeys org
ss "f1n4c6Change your ORGANIZATION :-->> [cc29 chars maxcf]cfn2 |||||||||||||||||||||||||||||n1"
prompt 29 normal "ca:"
st=result
setobject st
putuser 59
call main

STATE:
tr 'S'
addkeys sta
tr "f1n3c6Change your STATE :-->> [cc20 chars maxcf]cfn2 ||||||||||||||||||||"
prompt 20 normal "ca:"
st=result
setobject st
putuser 1300150
call main

COUNT:
tr 'C'
addkeys cou
tr "f1n3c6Change your COUNTRY :-->> [cc3 chars maxcf]cfn2 |||"
prompt 3 normal "ca:"
ct=upper(result)
setobject ct
putuser 1300192
call main

ELAST:
tr 'ELAST'
bbscommand "elast"
tr "n1cfPress any key to continue... g1"
call main

NEWB:
tr 'NEWB'
bbscommand "newb"
tr "n1cfPress any key to continue... g1"
call main

QUIT:
tr 'Q'
bufferflush
exit

CHECK:;if result~='###PANIC' then return;logentry 'Lost Carrier in EditWho.rexx!';bufferflush;exit
SYNTAX:;ERROR:;IOERR:
e1=' c9Errorcf: ca'rc' cf(ca'errortext(rc)'cf)'
e2='  c9Linecf: ce'left(sigl,4)'c9Filecf:';getuser 1311992;a=result
getuser 1311960;b=result;c='cb"ce'a||b'cb"';e2=e2' 'c;tr e1;tr e2;logentry e1
logentry e2;e=sourceline(sigl);do while e~='';e3='c9Sourcecf: cd'
e3=e3||left(e,37);transmit e3;logentry e3;e=substr(e,38);end;bufferflush;exit

/*Last Edit July 6, 1996*/
