/* Password Editor - DMS - march 98 - by Sylvain HUET */ /* Rev. 1.1 - Sep. '98 - by Marc BARILLEY */ typeof promptbanner = ObjText;; typeof pwdbanner = ObjText;; typeof passwd=tab [ObjText ObjText];; typeof editWin = ObjWin;; fun getPasswd(l)= if l==nil then nil else let l->[q n] in if !strcmp hd q "passwd" then ([hd tl q hd tl tl q])::getPasswd n else getPasswd n;; fun getText(i)= if i==8 then nil else let passwd.i -> [tx ps] in ("action"::(strcat "passwd" itoa i)::nil):: ("event"::(strcat "true" itoa i)::nil):: ("event"::(strcat "false" itoa i)::nil):: ("passwd"::(_GETtext tx)::(_GETtext ps)::nil)::getText i+1;; fun setPasswd(l,i)= if l==nil || i>=8 then 0 else let l->[[a b] n] in let passwd.i -> [tx ps] in (_SETtext tx a; _SETtext ps b; setPasswd n i+1);; fun onepasswd(i,x)= let _GETwindowPositionSize editWin -> [_ _ w _] in ( _CRtext _channel editWin 5 25+i*25 10 20 ET_ALIGN_CENTER itoa i; [ _CReditLine _channel editWin 20 25+i*25 w-125 20 ET_DOWN+ET_AHSCROLL "" _CReditLine _channel editWin w-100 25+i*25 95 20 ET_PASSWORD+ET_DOWN+ET_AHSCROLL "" ] );; fun createPasswd()= set passwd=create_tab 8 @onepasswd 0;; fun load (l) = setPasswd getPasswd l 0; 0;; fun save (filename, n)= ("register"::"Dms/Tools/Passwd/passwdw.pkg"::"Dms/Tools/Passwd/passwdce.pkg"::nil):: ("action"::"edit"::nil):: ("action"::"passwd"::nil):: ("event"::"true"::nil):: ("event"::"false"::nil):: ("event"::"log"::"log"::nil):: ("rule"::"1"::"Passwords"::"0"::"log"::"2"::"Log"::"1"::"log"::nil):: getText 0;; fun onesize (i,w,h)= if i > 7 then 0 else let passwd.i -> [prompt pwd] in { _SIZEtext prompt w-125 20 20 25+i*25; _SIZEtext pwd 95 20 w-100 25+i*25; onesize i+1 w h };; fun rflSizeEditWin (wn, blurp, w, h)= _SIZEtext promptbanner w-125 20 20 5; _SIZEtext pwdbanner 95 20 w-100 5; onesize 0 w h;; fun IniEditor(s)= let [315 230] -> [w h] in let startEditor _channel nil nil nil w h WN_MENU EDITOR_NORMAL s "dms/tools/passwd/passwd.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; _CBwinSize editWin @rflSizeEditWin 0; /* loc( set promptbanner = _CRtext _channel editWin 20 5 w-125 20 ET_ALIGN_CENTER "Prompt"; ) */ set promptbanner = _CRtext _channel editWin 20 5 w-125 20 ET_ALIGN_CENTER (_locEditor "820-PASSWD-prompt" nil); /* loc( set pwdbanner = _CRtext _channel editWin w-100 5 95 20 ET_ALIGN_CENTER "Password"; ) */ set pwdbanner = _CRtext _channel editWin w-100 5 95 20 ET_ALIGN_CENTER (_locEditor "830-PASSWD-password" nil); createPasswd; if s==nil then nil else openDMI ed ); 0;;